Skip to content

Commit e1cea05

Browse files
authored
Merge pull request #209 from Quaver/revert-200-mines
Revert "Add mines"
2 parents f2ea1e6 + 5cc8fd8 commit e1cea05

9 files changed

Lines changed: 38 additions & 179 deletions

File tree

Quaver.API/Enums/HitObjectType.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

Quaver.API/Maps/Processors/Difficulty/Rulesets/Keys/DifficultyProcessorKeys.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public DifficultyProcessorKeys(Qua map, StrainConstants constants, ModIdentifier
137137
StrainConstants = (StrainConstantsKeys)constants;
138138

139139
// Don't bother calculating map difficulty if there's less than 2 hit objects
140-
if (map.DifficultyContributingHitObjects < 2)
140+
if (map.HitObjects.Count < 2)
141141
return;
142142

143143
// Solve for difficulty
@@ -203,8 +203,6 @@ private void ComputeBaseStrainStates(float rate, Hand assumeHand)
203203
{
204204
if (Map.HasScratchKey && Map.HitObjects[i].Lane == Map.GetKeyCount())
205205
continue;
206-
if (Map.HitObjects[i].Type == HitObjectType.Mine)
207-
continue;
208206

209207
var curHitOb = new StrainSolverHitObject(Map.HitObjects[i]);
210208
var curStrainData = new StrainSolverData(curHitOb, rate);
@@ -677,7 +675,7 @@ private float CalculateOverallDifficulty()
677675
private void ComputeNoteDensityData(float rate)
678676
{
679677
//MapLength = Qua.Length;
680-
AverageNoteDensity = SECONDS_TO_MILLISECONDS * Map.DifficultyContributingHitObjects / (Map.Length * (-.5f * rate + 1.5f));
678+
AverageNoteDensity = SECONDS_TO_MILLISECONDS * Map.HitObjects.Count / (Map.Length * (-.5f * rate + 1.5f));
681679
}
682680

683681
/// <summary>

Quaver.API/Maps/Processors/Scoring/ScoreProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public ScoreProcessor(Replay replay, JudgementWindows windows = null)
223223
/// <summary>
224224
/// Adds a judgement to the score and recalculates the score.
225225
/// </summary>
226-
public abstract void CalculateScore(Judgement judgement, bool isLongNoteRelease = false, bool isMine = false);
226+
public abstract void CalculateScore(Judgement judgement, bool isLongNoteRelease = false);
227227

228228
/// <summary>
229229
/// Calculates the accuracy of the current play session.

Quaver.API/Maps/Processors/Scoring/ScoreProcessorKeys.cs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using Quaver.API.Maps.Processors.Scoring.Data;
1515
using Quaver.API.Maps.Processors.Scoring.Multiplayer;
1616
using Quaver.API.Replays;
17-
using HitObjectType = Quaver.API.Enums.HitObjectType;
1817

1918
namespace Quaver.API.Maps.Processors.Scoring
2019
{
@@ -174,9 +173,7 @@ public ScoreProcessorKeys(Replay replay, JudgementWindows windows = null) : base
174173
/// <param name="hitDifference"></param>
175174
/// <param name="keyPressType"></param>
176175
/// <param name="calculateAllStats"></param>
177-
/// <param name="isMine"></param>
178-
public Judgement CalculateScore(int hitDifference, KeyPressType keyPressType, bool calculateAllStats = true,
179-
bool isMine = false)
176+
public Judgement CalculateScore(int hitDifference, KeyPressType keyPressType, bool calculateAllStats = true)
180177
{
181178
var absoluteDifference = 0;
182179

@@ -225,25 +222,18 @@ public Judgement CalculateScore(int hitDifference, KeyPressType keyPressType, bo
225222
return judgement;
226223

227224
if (calculateAllStats)
228-
CalculateScore(judgement, keyPressType == KeyPressType.Release, isMine);
225+
CalculateScore(judgement, keyPressType == KeyPressType.Release);
229226

230227
return judgement;
231228
}
232229

233-
public void CalculateScore(HitStat hitStat)
234-
{
235-
CalculateScore(hitStat.Judgement, hitStat.KeyPressType == KeyPressType.Release,
236-
hitStat.HitObject.Type is HitObjectType.Mine);
237-
}
238-
239230
/// <inheritdoc />
240231
/// <summary>
241232
/// Calculate Score and Health increase/decrease with a given judgement.
242233
/// </summary>
243234
/// <param name="judgement"></param>
244235
/// <param name="isLongNoteRelease"></param>
245-
/// <param name="isMine"></param>
246-
public override void CalculateScore(Judgement judgement, bool isLongNoteRelease = false, bool isMine = false)
236+
public override void CalculateScore(Judgement judgement, bool isLongNoteRelease = false)
247237
{
248238
// Update Judgement count
249239
CurrentJudgements[judgement]++;
@@ -267,9 +257,7 @@ public override void CalculateScore(Judgement judgement, bool isLongNoteRelease
267257
MultiplierCount++;
268258

269259
// Add to the combo since the user hit.
270-
// Only do this when the note is not a mine (so it is a regular note)
271-
if (!isMine)
272-
Combo++;
260+
Combo++;
273261

274262
// Set the max combo if applicable.
275263
if (Combo > MaxCombo)
@@ -384,7 +372,17 @@ protected override void InitializeHealthWeighting()
384372
/// <returns></returns>
385373
public int GetTotalJudgementCount()
386374
{
387-
return Map.HitObjects.Sum(o => o.JudgementCount);
375+
var judgements = 0;
376+
377+
foreach (var o in Map.HitObjects)
378+
{
379+
if (o.IsLongNote)
380+
judgements += 2;
381+
else
382+
judgements++;
383+
}
384+
385+
return judgements;
388386
}
389387

390388
/// <summary>

Quaver.API/Maps/Qua.cs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,6 @@ public List<ScrollSpeedFactorInfo> ScrollSpeedFactors
185185
/// </summary>
186186
public List<HitObjectInfo> HitObjects { get; private set; } = new List<HitObjectInfo>();
187187

188-
/// <summary>
189-
/// Number of mines in the map
190-
/// </summary>
191-
[YamlIgnore]
192-
public int MineCount => HitObjects.Count(x => x.Type is HitObjectType.Mine);
193-
194-
/// <summary>
195-
/// Number of notes counted for diffcalc.
196-
/// Currently, it's every note except mines
197-
/// </summary>
198-
[YamlIgnore]
199-
public int DifficultyContributingHitObjects => HitObjects.Count - MineCount;
200-
201188
public Dictionary<string, TimingGroup> TimingGroups { get; private set; } =
202189
new Dictionary<string, TimingGroup>();
203190

@@ -372,8 +359,7 @@ static HitObjectInfo SerializableHitObject(HitObjectInfo obj) =>
372359
.Select(x => new KeySoundInfo { Sample = x.Sample, Volume = x.Volume == 100 ? 0 : x.Volume })
373360
.ToList(),
374361
Lane = obj.Lane, StartTime = obj.StartTime,
375-
TimingGroup = obj.TimingGroup == DefaultScrollGroupId ? null : obj.TimingGroup,
376-
Type = obj.Type
362+
TimingGroup = obj.TimingGroup == DefaultScrollGroupId ? null : obj.TimingGroup
377363
};
378364

379365
static SoundEffectInfo SerializableSoundEffect(SoundEffectInfo x) =>
@@ -1115,15 +1101,8 @@ public HitObjectInfo GetHitObjectAtJudgementIndex(int index)
11151101

11161102
// ReSharper disable once ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator
11171103
foreach (var h in HitObjects)
1118-
{
1119-
var judgementCount = h.JudgementCount;
1120-
if (total <= index && index < total + judgementCount)
1121-
{
1104+
if (total++ == index || (h.IsLongNote && total++ == index))
11221105
return h;
1123-
}
1124-
1125-
total += judgementCount;
1126-
}
11271106

11281107
return null;
11291108
}

Quaver.API/Maps/Structures/HitObjectInfo.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ public HitSounds HitSound
6464
set;
6565
}
6666

67-
/// <summary>
68-
/// The hit object could be a normal note or a mine
69-
/// </summary>
70-
public HitObjectType Type { get; [MoonSharpVisible(false)] set; }
71-
7267
/// <summary>
7368
/// Key sounds to play when this object is hit.
7469
/// </summary>
@@ -100,11 +95,6 @@ public string TimingGroup
10095
[YamlIgnore]
10196
public bool IsLongNote => EndTime > 0;
10297

103-
/// <summary>
104-
/// The number of judgements generated by this object
105-
/// </summary>
106-
[YamlIgnore] public int JudgementCount => IsLongNote && Type != HitObjectType.Mine ? 2 : 1;
107-
10898
/// <summary>
10999
/// Returns if the object is allowed to be edited in lua scripts
110100
/// </summary>
@@ -185,7 +175,6 @@ public bool Equals(HitObjectInfo x, HitObjectInfo y)
185175
x.Lane == y.Lane &&
186176
x.EndTime == y.EndTime &&
187177
x.HitSound == y.HitSound &&
188-
x.Type == y.Type &&
189178
x.KeySounds.SequenceEqual(y.KeySounds, KeySoundInfo.ByValueComparer) &&
190179
x.EditorLayer == y.EditorLayer;
191180
}
@@ -197,7 +186,6 @@ public int GetHashCode(HitObjectInfo obj)
197186
var hashCode = obj.StartTime;
198187
hashCode = (hashCode * 397) ^ obj.Lane;
199188
hashCode = (hashCode * 397) ^ obj.EndTime;
200-
hashCode = (hashCode * 397) ^ (int)obj.Type;
201189
hashCode = (hashCode * 397) ^ (int)obj.HitSound;
202190

203191
foreach (var keySound in obj.KeySounds)

Quaver.API/Replays/Replay.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,6 @@ public static Replay GeneratePerfectReplayKeys(Replay replay, Qua map)
332332

333333
foreach (var hitObject in map.HitObjects)
334334
{
335-
if (hitObject.Type is HitObjectType.Mine)
336-
continue;
337-
338335
// Add key press frame
339336
nonCombined.Add(new ReplayAutoplayFrame(hitObject, ReplayAutoplayFrameType.Press, hitObject.StartTime, KeyLaneToPressState(hitObject.Lane)));
340337

0 commit comments

Comments
 (0)