Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Quaver.API/Enums/ModIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public enum ModIdentifier : long
Speed195X = 1L << 42, // Speed 1.95x
HeatlthAdjust = 1L << 43, // Test mod for making long note windows easier
NoMiss = 1L << 44, // You miss, you die
NoMines = 1L << 45, // Removes mines from the map

SpeedMods = Speed05X | Speed055X | Speed06X | Speed065X | Speed07X | Speed075X | Speed08X | Speed085X | Speed09X | Speed095X | Speed105X | Speed11X | Speed115X | Speed12X | Speed125X | Speed13X | Speed135X | Speed14X | Speed145X | Speed15X | Speed155X | Speed16X | Speed165X | Speed17X | Speed175X | Speed18X | Speed185X | Speed19X | Speed195X | Speed20X
}
Expand Down
3 changes: 3 additions & 0 deletions Quaver.API/Helpers/ModHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ public static string GetModsString(ModIdentifier mods)
case ModIdentifier.NoMiss:
modStrings.Add("NM");
break;
case ModIdentifier.NoMines:
modStrings.Add("NMN");
break;
default:
throw new ArgumentOutOfRangeException($"Short string for ModIdentifier: {mod} does not exist.");
}
Expand Down
10 changes: 9 additions & 1 deletion Quaver.API/Maps/Qua.cs
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,11 @@ public void ReplaceLongNotesWithRegularNotes()
temp.EndTime = 0;
}

/// <summary>
/// Removes all mines from the map.
/// </summary>
public void RemoveMines() => HitObjects = HitObjects.Where(x => x.Type != HitObjectType.Mine).ToList();

/// <summary>
/// Replaces regular notes with long notes and vice versa.
///
Expand Down Expand Up @@ -1014,6 +1019,9 @@ public void ApplyInverse()
/// <param name="mods">a list of mods to apply</param>
public void ApplyMods(ModIdentifier mods)
{
if (mods.HasFlag(ModIdentifier.NoMines))
RemoveMines();

if (mods.HasFlag(ModIdentifier.NoLongNotes))
ReplaceLongNotesWithRegularNotes();

Expand Down Expand Up @@ -1543,4 +1551,4 @@ private int MaxObjectTime()
return max;
}
}
}
}
Loading