diff --git a/osu.Game.Modes.Catch/CatchMod.cs b/osu.Game.Modes.Catch/CatchMod.cs new file mode 100644 index 0000000000..3cebab8cf2 --- /dev/null +++ b/osu.Game.Modes.Catch/CatchMod.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Modes.Catch +{ + public class CatchModNoFail : ModNoFail + { + + } + + public class CatchModEasy : ModEasy + { + + } + + public class CatchModHidden : ModHidden + { + public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; + public override double ScoreMultiplier => 1.06; + public override Mods[] DisablesMods => new Mods[] { }; + } + + public class CatchModHardRock : ModHardRock + { + public override double ScoreMultiplier => 1.12; + public override bool Ranked => true; + } + + public class CatchModSuddenDeath : ModSuddenDeath + { + + } + + public class CatchModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.06; + } + + public class CatchModRelax : ModRelax + { + public override string Description => @"Use the mouse to control the catcher."; + } + + public class CatchModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.5; + } + + public class CatchModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.06; + } + + public class CatchModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.12; + public override Mods[] DisablesMods => new Mods[] { }; + } +} diff --git a/osu.Game.Modes.Catch/CatchRuleset.cs b/osu.Game.Modes.Catch/CatchRuleset.cs index fd778d1ce6..0a8618f2b1 100644 --- a/osu.Game.Modes.Catch/CatchRuleset.cs +++ b/osu.Game.Modes.Catch/CatchRuleset.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Game.Graphics; using osu.Game.Modes.Catch.UI; using osu.Game.Modes.Objects; @@ -16,6 +17,20 @@ namespace osu.Game.Modes.Catch public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new CatchHitRenderer { Beatmap = beatmap }; + public override IEnumerable AvailableMods => new Mod[] + { + new CatchModNoFail(), + new CatchModEasy(), + new CatchModHidden(), + new CatchModHardRock(), + new CatchModSuddenDeath(), + new CatchModDoubleTime(), + new CatchModRelax(), + new CatchModHalfTime(), + new CatchModNightcore(), + new CatchModFlashlight(), + }; + protected override PlayMode PlayMode => PlayMode.Catch; public override FontAwesome Icon => FontAwesome.fa_osu_fruits_o; diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj index 6b37963da1..42f06608b9 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj @@ -58,6 +58,7 @@ + diff --git a/osu.Game.Modes.Mania/ManiaMod.cs b/osu.Game.Modes.Mania/ManiaMod.cs new file mode 100644 index 0000000000..9c056a0663 --- /dev/null +++ b/osu.Game.Modes.Mania/ManiaMod.cs @@ -0,0 +1,150 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Graphics; + +namespace osu.Game.Modes.Mania +{ + public class ManiaModNoFail : ModNoFail + { + + } + + public class ManiaModEasy : ModEasy + { + + } + + public class ManiaModHidden : ModHidden + { + public override string Description => @"The notes fade out before you hit them!"; + public override double ScoreMultiplier => 1.0; + public override Mods[] DisablesMods => new Mods[] { Mods.Flashlight }; + } + + public class ManiaModHardRock : ModHardRock + { + public override double ScoreMultiplier => 1.0; + public override bool Ranked => false; + } + + public class ManiaModSuddenDeath : ModSuddenDeath + { + + } + + public class ManiaModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.0; + } + + public class ManiaModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.3; + } + + public class ManiaModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.0; + } + + public class ManiaModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.0; + public override Mods[] DisablesMods => new Mods[] { Mods.Hidden }; + } + + public class ManiaModFadeIn : Mod + { + public override Mods Name => Mods.FadeIn; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; + public override string Description => @""; + public override double ScoreMultiplier => 1; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { Mods.Flashlight }; + } + + public class ManiaModRandom : Mod + { + public override Mods Name => Mods.Random; + public override FontAwesome Icon => FontAwesome.fa_close; + public override string Description => @"Shuffle around the notes!"; + public override double ScoreMultiplier => 1; + public override bool Ranked => false; + public override Mods[] DisablesMods => new Mods[] { }; + } + + public abstract class ManiaKeyMod : Mod + { + public abstract int KeyCount { get; } + public override FontAwesome Icon => FontAwesome.fa_close; // TODO: Add proper key icons + public override string Description => @""; + public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { }; + } + + public class ManiaModKey1 : ManiaKeyMod + { + public override int KeyCount => 1; + public override Mods Name => Mods.Key1; + } + + public class ManiaModKey2 : ManiaKeyMod + { + public override int KeyCount => 2; + public override Mods Name => Mods.Key2; + } + + public class ManiaModKey3 : ManiaKeyMod + { + public override int KeyCount => 3; + public override Mods Name => Mods.Key3; + } + + public class ManiaModKey4 : ManiaKeyMod + { + public override int KeyCount => 4; + public override Mods Name => Mods.Key4; + } + + public class ManiaModKey5 : ManiaKeyMod + { + public override int KeyCount => 5; + public override Mods Name => Mods.Key5; + } + + public class ManiaModKey6 : ManiaKeyMod + { + public override int KeyCount => 6; + public override Mods Name => Mods.Key6; + } + + public class ManiaModKey7 : ManiaKeyMod + { + public override int KeyCount => 7; + public override Mods Name => Mods.Key7; + } + + public class ManiaModKey8 : ManiaKeyMod + { + public override int KeyCount => 8; + public override Mods Name => Mods.Key8; + } + + public class ManiaModKey9 : ManiaKeyMod + { + public override int KeyCount => 9; + public override Mods Name => Mods.Key9; + } + + public class ManiaModKeyCoop : Mod + { + public override Mods Name => Mods.KeyCoop; + public override FontAwesome Icon => FontAwesome.fa_close; + public override string Description => @"Double the key amount, double the fun!"; + public override double ScoreMultiplier => 1; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { }; + } +} diff --git a/osu.Game.Modes.Mania/ManiaRuleset.cs b/osu.Game.Modes.Mania/ManiaRuleset.cs index bbf22086c0..9ac40c4ad7 100644 --- a/osu.Game.Modes.Mania/ManiaRuleset.cs +++ b/osu.Game.Modes.Mania/ManiaRuleset.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Game.Graphics; using osu.Game.Modes.Mania.UI; using osu.Game.Modes.Objects; @@ -16,6 +17,31 @@ namespace osu.Game.Modes.Mania public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new ManiaHitRenderer { Beatmap = beatmap }; + public override IEnumerable AvailableMods => new Mod[] + { + new ManiaModNoFail(), + new ManiaModEasy(), + new ManiaModHidden(), + new ManiaModHardRock(), + new ManiaModSuddenDeath(), + new ManiaModDoubleTime(), + new ManiaModHalfTime(), + new ManiaModNightcore(), + new ManiaModFlashlight(), + new ManiaModFadeIn(), + new ManiaModRandom(), + new ManiaModKey1(), + new ManiaModKey2(), + new ManiaModKey3(), + new ManiaModKey4(), + new ManiaModKey5(), + new ManiaModKey6(), + new ManiaModKey7(), + new ManiaModKey8(), + new ManiaModKey9(), + new ManiaModKeyCoop(), + }; + protected override PlayMode PlayMode => PlayMode.Mania; public override FontAwesome Icon => FontAwesome.fa_osu_mania_o; diff --git a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj index b9b7e35ae7..457fb38e00 100644 --- a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj +++ b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj @@ -58,6 +58,7 @@ + diff --git a/osu.Game.Modes.Osu/OsuMod.cs b/osu.Game.Modes.Osu/OsuMod.cs new file mode 100644 index 0000000000..6f28786fa2 --- /dev/null +++ b/osu.Game.Modes.Osu/OsuMod.cs @@ -0,0 +1,91 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Graphics; + +namespace osu.Game.Modes.Osu +{ + public class OsuModNoFail : ModNoFail + { + + } + + public class OsuModEasy : ModEasy + { + + } + + public class OsuModHidden : ModHidden + { + public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; + public override double ScoreMultiplier => 1.06; + public override Mods[] DisablesMods => new Mods[] { }; + } + + public class OsuModHardRock : ModHardRock + { + public override double ScoreMultiplier => 1.06; + public override bool Ranked => true; + } + + public class OsuModSuddenDeath : ModSuddenDeath + { + + } + + public class OsuModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.12; + } + + public class OsuModRelax : ModRelax + { + public override string Description => "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things."; + } + + public class OsuModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.5; + } + + public class OsuModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.12; + } + + public class OsuModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.12; + public override Mods[] DisablesMods => new Mods[] { }; + } + + public class OsuModSpunOut : Mod + { + public override Mods Name => Mods.SpunOut; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout; + public override string Description => @"Spinners will be automatically completed"; + public override double ScoreMultiplier => 0.9; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { Mods.Autoplay, Mods.Cinema, Mods.Autopilot }; + } + + public class OsuModAutopilot : Mod + { + public override Mods Name => Mods.Autopilot; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; + public override string Description => @"Automatic cursor movement - just follow the rhythm."; + public override double ScoreMultiplier => 0; + public override bool Ranked => false; + public override Mods[] DisablesMods => new Mods[] { Mods.SpunOut, Mods.Relax, Mods.SuddenDeath, Mods.Perfect, Mods.NoFail, Mods.Autoplay, Mods.Cinema }; + } + + public class OsuModTarget : Mod + { + public override Mods Name => Mods.Target; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_target; + public override string Description => @""; + public override double ScoreMultiplier => 1; + public override bool Ranked => false; + public override Mods[] DisablesMods => new Mods[] { }; + } +} diff --git a/osu.Game.Modes.Osu/OsuRuleset.cs b/osu.Game.Modes.Osu/OsuRuleset.cs index d05c8193cc..c76c76683e 100644 --- a/osu.Game.Modes.Osu/OsuRuleset.cs +++ b/osu.Game.Modes.Osu/OsuRuleset.cs @@ -34,6 +34,23 @@ namespace osu.Game.Modes.Osu } }; + public override IEnumerable AvailableMods => new Mod[] + { + new OsuModNoFail(), + new OsuModEasy(), + new OsuModHidden(), + new OsuModHardRock(), + new OsuModSuddenDeath(), + new OsuModDoubleTime(), + new OsuModRelax(), + new OsuModHalfTime(), + new OsuModNightcore(), + new OsuModFlashlight(), + new OsuModSpunOut(), + new OsuModAutopilot(), + new OsuModTarget(), + }; + public override FontAwesome Icon => FontAwesome.fa_osu_osu_o; public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser(); diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj index 1d3ee7a6a4..f53066ecde 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj @@ -85,6 +85,7 @@ + diff --git a/osu.Game.Modes.Taiko/TaikoMod.cs b/osu.Game.Modes.Taiko/TaikoMod.cs new file mode 100644 index 0000000000..95bab294a3 --- /dev/null +++ b/osu.Game.Modes.Taiko/TaikoMod.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Modes.Taiko +{ + public class TaikoModNoFail : ModNoFail + { + + } + + public class TaikoModEasy : ModEasy + { + + } + + public class TaikoModHidden : ModHidden + { + public override string Description => @"The notes fade out before you hit them!"; + public override double ScoreMultiplier => 1.06; + public override Mods[] DisablesMods => new Mods[] { }; + } + + public class TaikoModHardRock : ModHardRock + { + public override double ScoreMultiplier => 1.06; + public override bool Ranked => true; + } + + public class TaikoModSuddenDeath : ModSuddenDeath + { + + } + + public class TaikoModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.12; + } + + public class TaikoModRelax : ModRelax + { + public override string Description => @"Relax! You will no longer get dizzyfied by ninja-like spinners, demanding drumrolls or unexpected katu's."; + } + + public class TaikoModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.5; + } + + public class TaikoModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.12; + } + + public class TaikoModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.12; + public override Mods[] DisablesMods => new Mods[] { }; + } +} diff --git a/osu.Game.Modes.Taiko/TaikoRuleset.cs b/osu.Game.Modes.Taiko/TaikoRuleset.cs index 6141838880..9d12e04a53 100644 --- a/osu.Game.Modes.Taiko/TaikoRuleset.cs +++ b/osu.Game.Modes.Taiko/TaikoRuleset.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Game.Graphics; using osu.Game.Modes.Objects; using osu.Game.Modes.Osu.UI; @@ -16,6 +17,20 @@ namespace osu.Game.Modes.Taiko public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new TaikoHitRenderer { Beatmap = beatmap }; + public override IEnumerable AvailableMods => new Mod[] + { + new TaikoModNoFail(), + new TaikoModEasy(), + new TaikoModHidden(), + new TaikoModHardRock(), + new TaikoModSuddenDeath(), + new TaikoModDoubleTime(), + new TaikoModRelax(), + new TaikoModHalfTime(), + new TaikoModNightcore(), + new TaikoModFlashlight(), + }; + protected override PlayMode PlayMode => PlayMode.Taiko; public override FontAwesome Icon => FontAwesome.fa_osu_taiko_o; diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index a964d48288..6c379b1b70 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -56,6 +56,7 @@ + diff --git a/osu.Game/Modes/Mod.cs b/osu.Game/Modes/Mod.cs index 810ae41220..d6139056e8 100644 --- a/osu.Game/Modes/Mod.cs +++ b/osu.Game/Modes/Mod.cs @@ -23,285 +23,128 @@ namespace osu.Game.Modes public abstract FontAwesome Icon { get; } /// - /// The user readable description of this mod for the given . + /// The user readable description of this mod. /// - public virtual string Description(PlayMode mode) => @""; + public abstract string Description { get; } /// - /// The score multiplier of this mod for the given + /// The score multiplier of this mod. /// - public abstract double ScoreMultiplier(PlayMode mode); + public abstract double ScoreMultiplier { get; } /// - /// Returns if this mod is ranked in the given + /// Returns if this mod is ranked. /// - public abstract bool Ranked(PlayMode mode); + public abstract bool Ranked { get; } /// - /// The mods this mod cannot be enabled with + /// The mods this mod cannot be enabled with. /// - public abstract Mods[] DisablesMods(PlayMode mode); + public abstract Mods[] DisablesMods { get; } } - public abstract class KeyMod : Mod - { - public abstract int KeyCount { get; } - public override FontAwesome Icon => FontAwesome.fa_close; // TODO: Add proper key icons - public override string Description(PlayMode mode) => @""; - public override double ScoreMultiplier(PlayMode mode) => 1; // TODO: Implement the mania key mod score multiplier - public override bool Ranked(PlayMode mode) => mode == PlayMode.Mania; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {}; - } - - public class ModNoFail : Mod + public abstract class ModNoFail : Mod { public override Mods Name => Mods.NoFail; public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail; - public override string Description(PlayMode mode) => @"You can't fail, no matter what."; - public override double ScoreMultiplier(PlayMode mode) => 0.5; - public override bool Ranked(PlayMode mode) => true; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SuddenDeath, Mods.Perfect }; + public override string Description => @"You can't fail, no matter what."; + public override double ScoreMultiplier => 0.5; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SuddenDeath, Mods.Perfect }; } - public class ModEasy : Mod + public abstract class ModEasy : Mod { public override Mods Name => Mods.Easy; public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy; - public override string Description(PlayMode mode) => @"Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required."; - public override double ScoreMultiplier(PlayMode mode) => 0.5; - public override bool Ranked(PlayMode mode) => true; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.HardRock }; + public override string Description => @"Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required."; + public override double ScoreMultiplier => 0.5; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { Mods.HardRock }; } - public class ModHidden : Mod + public abstract class ModHidden : Mod { public override Mods Name => Mods.Hidden; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; - public override string Description(PlayMode mode) - { - switch (mode) - { - case PlayMode.Osu: - case PlayMode.Catch: - return @"Play with no approach circles and fading notes for a slight score advantage."; - - case PlayMode.Taiko: - case PlayMode.Mania: - return @"The notes fade out before you hit them!"; - - default: - throw new NotSupportedException(); - } - } - public override double ScoreMultiplier(PlayMode mode) => mode == PlayMode.Mania ? 1.0 : 1.06; - public override bool Ranked(PlayMode mode) => true; - public override Mods[] DisablesMods(PlayMode mode) => (mode == PlayMode.Mania) ? new Mods[] { Mods.Flashlight } : new Mods[] { }; + public override bool Ranked => true; } - public class ModHardRock : Mod + public abstract class ModHardRock : Mod { public override Mods Name => Mods.HardRock; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock; - public override string Description(PlayMode mode) => @"Everything just got a bit harder..."; - public override double ScoreMultiplier(PlayMode mode) - { - switch (mode) - { - case PlayMode.Osu: - case PlayMode.Taiko: - return 1.06; - - case PlayMode.Catch: - return 1.12; - - case PlayMode.Mania: - return 1.0; - - default: - throw new NotSupportedException(); - } - } - public override bool Ranked(PlayMode mode) => mode != PlayMode.Mania; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Easy }; + public override string Description => @"Everything just got a bit harder..."; + public override Mods[] DisablesMods => new Mods[] { Mods.Easy }; } - public class ModSuddenDeath : Mod + public abstract class ModSuddenDeath : Mod { public override Mods Name => Mods.SuddenDeath; public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath; - public override string Description(PlayMode mode) => @"Miss a note and fail."; - public override double ScoreMultiplier(PlayMode mode) => 1; - public override bool Ranked(PlayMode mode) => true; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.NoFail, Mods.Relax, Mods.Autopilot, Mods.Autoplay, Mods.Cinema }; + public override string Description => @"Miss a note and fail."; + public override double ScoreMultiplier => 1; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { Mods.NoFail, Mods.Relax, Mods.Autopilot, Mods.Autoplay, Mods.Cinema }; } - public class ModDoubleTime : Mod + public abstract class ModDoubleTime : Mod { public override Mods Name => Mods.DoubleTime; public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime; - public override string Description(PlayMode mode) => @"Zoooooooooom"; - public override double ScoreMultiplier(PlayMode mode) - { - switch (mode) - { - case PlayMode.Osu: - case PlayMode.Taiko: - return 1.12; - - case PlayMode.Catch: - return 1.06; - - case PlayMode.Mania: - return 1.0; - - default: - throw new NotSupportedException(); - } - } - public override bool Ranked(PlayMode mode) => true; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.HalfTime }; + public override string Description => @"Zoooooooooom"; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { Mods.HalfTime }; } - public class ModRelax : Mod + public abstract class ModRelax : Mod { public override Mods Name => Mods.Relax; public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax; - public override string Description(PlayMode mode) - { - switch (mode) - { - case PlayMode.Osu: - return "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things."; - - case PlayMode.Taiko: - return @"Relax! You will no longer get dizzyfied by ninja-like spinners, demanding drumrolls or unexpected katu's."; - - case PlayMode.Catch: - return @"Use the mouse to control the catcher."; - - case PlayMode.Mania: - return @"Unsupported"; - - default: - throw new NotSupportedException(); - } - } - public override double ScoreMultiplier(PlayMode mode) => 0; - public override bool Ranked(PlayMode mode) => false; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Autopilot, Mods.Autoplay, Mods.Cinema, Mods.NoFail, Mods.SuddenDeath, Mods.Perfect }; + public override double ScoreMultiplier => 0; + public override bool Ranked => false; + public override Mods[] DisablesMods => new Mods[] { Mods.Autopilot, Mods.Autoplay, Mods.Cinema, Mods.NoFail, Mods.SuddenDeath, Mods.Perfect }; } - public class ModHalfTime : Mod + public abstract class ModHalfTime : Mod { public override Mods Name => Mods.HalfTime; public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime; - public override string Description(PlayMode mode) => @"Less zoom"; - public override double ScoreMultiplier(PlayMode mode) => mode == PlayMode.Mania ? 0.5 : 0.3; - public override bool Ranked(PlayMode mode) => true; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.DoubleTime, Mods.Nightcore }; + public override string Description => @"Less zoom"; + public override bool Ranked => true; + public override Mods[] DisablesMods => new Mods[] { Mods.DoubleTime, Mods.Nightcore }; } - public class ModNightcore : ModDoubleTime + public abstract class ModNightcore : ModDoubleTime { public override Mods Name => Mods.Nightcore; public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore; - public override string Description(PlayMode mode) => @"uguuuuuuuu"; + public override string Description => @"uguuuuuuuu"; } - public class ModFlashlight : Mod + public abstract class ModFlashlight : Mod { public override Mods Name => Mods.Flashlight; public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight; - public override string Description(PlayMode mode) => @"Restricted view area."; - public override double ScoreMultiplier(PlayMode mode) => mode == PlayMode.Mania ? 1.0 : 1.12; - public override bool Ranked(PlayMode mode) => true; - public override Mods[] DisablesMods(PlayMode mode) => (mode == PlayMode.Mania) ? new Mods[] { Mods.Hidden } : new Mods[] {}; + public override string Description => @"Restricted view area."; + public override bool Ranked => true; } public class ModAutoplay : Mod { public override Mods Name => Mods.Autoplay; public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto; - public override string Description(PlayMode mode) => @"Watch a perfect automated play through the song"; - public override double ScoreMultiplier(PlayMode mode) => 0; - public override bool Ranked(PlayMode mode) => false; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect }; - } - - public class ModSpunOut : Mod - { - public override Mods Name => Mods.SpunOut; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout; - public override string Description(PlayMode mode) => @"Spinners will be automatically completed"; - public override double ScoreMultiplier(PlayMode mode) => 0.9; - public override bool Ranked(PlayMode mode) => mode == PlayMode.Osu; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Autoplay, Mods.Cinema, Mods.Autopilot }; - } - - public class ModAutopilot : Mod - { - public override Mods Name => Mods.Autopilot; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; - public override string Description(PlayMode mode) => @"Automatic cursor movement - just follow the rhythm."; - public override double ScoreMultiplier(PlayMode mode) => 0; - public override bool Ranked(PlayMode mode) => false; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.SpunOut, Mods.Relax, Mods.SuddenDeath, Mods.Perfect, Mods.NoFail, Mods.Autoplay, Mods.Cinema }; + public override string Description => @"Watch a perfect automated play through the song"; + public override double ScoreMultiplier => 0; + public override bool Ranked => false; + public override Mods[] DisablesMods => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect }; } public class ModPerfect : ModSuddenDeath { public override Mods Name => Mods.Perfect; public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect; - public override string Description(PlayMode mode) => @"SS or quit."; - } - - public class ModKey4 : KeyMod - { - public override int KeyCount => 4; - public override Mods Name => Mods.Key4; - } - - public class ModKey5 : KeyMod - { - public override int KeyCount => 5; - public override Mods Name => Mods.Key5; - } - - public class ModKey6 : KeyMod - { - public override int KeyCount => 6; - public override Mods Name => Mods.Key6; - } - - public class ModKey7 : KeyMod - { - public override int KeyCount => 7; - public override Mods Name => Mods.Key7; - } - - public class ModKey8 : KeyMod - { - public override int KeyCount => 8; - public override Mods Name => Mods.Key8; - } - - public class ModFadeIn : Mod - { - public override Mods Name => Mods.FadeIn; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; - public override double ScoreMultiplier(PlayMode mode) => 1; - public override bool Ranked(PlayMode mode) => mode == PlayMode.Mania; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] { Mods.Flashlight }; - } - - public class ModRandom : Mod - { - public override Mods Name => Mods.Random; - public override FontAwesome Icon => FontAwesome.fa_close; - public override string Description(PlayMode mode) => @"Shuffle around the notes!"; - public override double ScoreMultiplier(PlayMode mode) => 1; - public override bool Ranked(PlayMode mode) => false; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {}; + public override string Description => @"SS or quit."; } public class ModCinema : ModAutoplay @@ -310,50 +153,6 @@ namespace osu.Game.Modes public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema; } - public class ModTarget : Mod - { - public override Mods Name => Mods.Target; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_target; - public override double ScoreMultiplier(PlayMode mode) => 1; - public override bool Ranked(PlayMode mode) => mode == PlayMode.Osu; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {}; - } - - public class ModKey9 : KeyMod - { - public override int KeyCount => 9; - public override Mods Name => Mods.Key9; - } - - public class ModKeyCoop : Mod - { - public override Mods Name => Mods.KeyCoop; - public override FontAwesome Icon => FontAwesome.fa_close; - public override string Description(PlayMode mode) => @"Double the key amount, double the fun!"; - public override double ScoreMultiplier(PlayMode mode) => 1; - public override bool Ranked(PlayMode mode) => mode == PlayMode.Mania; - public override Mods[] DisablesMods(PlayMode mode) => new Mods[] {}; - } - - public class ModKey1 : KeyMod - { - public override int KeyCount => 1; - public override Mods Name => Mods.Key1; - } - - public class ModKey3 : KeyMod - { - public override int KeyCount => 3; - public override Mods Name => Mods.Key3; - } - - public class ModKey2 : KeyMod - { - public override int KeyCount => 2; - public override Mods Name => Mods.Key2; - } - - [Flags] public enum Mods { @@ -451,4 +250,4 @@ namespace osu.Game.Modes FreeModAllowed = NoFail | Easy | Hidden | HardRock | SuddenDeath | Flashlight | FadeIn | Relax | Autopilot | SpunOut | KeyMod, ScoreIncreaseMods = Hidden | HardRock | DoubleTime | Flashlight | FadeIn } -} \ No newline at end of file +} diff --git a/osu.Game/Modes/Ruleset.cs b/osu.Game/Modes/Ruleset.cs index 851e144408..c096a483e7 100644 --- a/osu.Game/Modes/Ruleset.cs +++ b/osu.Game/Modes/Ruleset.cs @@ -26,6 +26,8 @@ namespace osu.Game.Modes public virtual IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { }; + public abstract IEnumerable AvailableMods { get; } + public abstract ScoreProcessor CreateScoreProcessor(int hitObjectCount); public abstract HitRenderer CreateHitRendererWith(Beatmap beatmap); diff --git a/osu.Game/Overlays/Mods/AssistedSection.cs b/osu.Game/Overlays/Mods/AssistedSection.cs index 2e1e41502b..27f274e321 100644 --- a/osu.Game/Overlays/Mods/AssistedSection.cs +++ b/osu.Game/Overlays/Mods/AssistedSection.cs @@ -32,130 +32,129 @@ namespace osu.Game public AssistedSection(PlayMode mode) { Header = @"Assisted"; + //switch (mode) + //{ + // case PlayMode.Osu: + // Buttons = new ModButton[] + // { + // RelaxButton = new ModButton + // { + // ToggleKey = Key.Z, + // Mods = new Mod[] + // { + // new ModRelax(), + // }, + // }, + // AutopilotButton = new ModButton + // { + // ToggleKey = Key.X, + // Mods = new Mod[] + // { + // new OsuModAutopilot(), + // }, + // }, + // TargetPracticeButton = new ModButton + // { + // ToggleKey = Key.C, + // Mods = new Mod[] + // { + // new OsuModTarget(), + // }, + // }, + // SpunOutButton = new ModButton + // { + // ToggleKey = Key.V, + // Mods = new Mod[] + // { + // new OsuModSpunOut(), + // }, + // }, + // AutoplayCinemaButton = new ModButton + // { + // ToggleKey = Key.B, + // Mods = new Mod[] + // { + // new ModAutoplay(), + // new ModCinema(), + // }, + // }, + // }; + // break; - switch (mode) - { - case PlayMode.Osu: - Buttons = new ModButton[] - { - RelaxButton = new ModButton - { - ToggleKey = Key.Z, - Mods = new Mod[] - { - new ModRelax(), - }, - }, - AutopilotButton = new ModButton - { - ToggleKey = Key.X, - Mods = new Mod[] - { - new ModAutopilot(), - }, - }, - TargetPracticeButton = new ModButton - { - ToggleKey = Key.C, - Mods = new Mod[] - { - new ModTarget(), - }, - }, - SpunOutButton = new ModButton - { - ToggleKey = Key.V, - Mods = new Mod[] - { - new ModSpunOut(), - }, - }, - AutoplayCinemaButton = new ModButton - { - ToggleKey = Key.B, - Mods = new Mod[] - { - new ModAutoplay(), - new ModCinema(), - }, - }, - }; - break; + // case PlayMode.Taiko: + // case PlayMode.Catch: + // Buttons = new ModButton[] + // { + // RelaxButton = new ModButton + // { + // ToggleKey = Key.Z, + // Mods = new Mod[] + // { + // new ModRelax(), + // }, + // }, + // AutoplayCinemaButton = new ModButton + // { + // ToggleKey = Key.X, + // Mods = new Mod[] + // { + // new ModAutoplay(), + // new ModCinema(), + // }, + // }, + // }; + // break; - case PlayMode.Taiko: - case PlayMode.Catch: - Buttons = new ModButton[] - { - RelaxButton = new ModButton - { - ToggleKey = Key.Z, - Mods = new Mod[] - { - new ModRelax(), - }, - }, - AutoplayCinemaButton = new ModButton - { - ToggleKey = Key.X, - Mods = new Mod[] - { - new ModAutoplay(), - new ModCinema(), - }, - }, - }; - break; + // case PlayMode.Mania: + // Buttons = new ModButton[] + // { + // KeyButton = new ModButton + // { + // ToggleKey = Key.Z, + // Mods = new Mod[] + // { + // new ManiaModKey4(), + // new ManiaModKey5(), + // new ManiaModKey6(), + // new ManiaModKey7(), + // new ManiaModKey8(), + // new ManiaModKey9(), + // new ManiaModKey1(), + // new ManiaModKey2(), + // new ManiaModKey3(), + // }, + // }, + // CoopButton = new ModButton + // { + // ToggleKey = Key.X, + // Mods = new Mod[] + // { + // new ManiaModKeyCoop(), + // }, + // }, + // RandomButton = new ModButton + // { + // ToggleKey = Key.C, + // Mods = new Mod[] + // { + // new ManiaModRandom(), + // }, + // }, + // AutoplayCinemaButton = new ModButton + // { + // ToggleKey = Key.V, + // Mods = new Mod[] + // { + // new ModAutoplay(), + // new ModCinema(), + // }, + // }, + // }; + // break; - case PlayMode.Mania: - Buttons = new ModButton[] - { - KeyButton = new ModButton - { - ToggleKey = Key.Z, - Mods = new Mod[] - { - new ModKey4(), - new ModKey5(), - new ModKey6(), - new ModKey7(), - new ModKey8(), - new ModKey9(), - new ModKey1(), - new ModKey2(), - new ModKey3(), - }, - }, - CoopButton = new ModButton - { - ToggleKey = Key.X, - Mods = new Mod[] - { - new ModKeyCoop(), - }, - }, - RandomButton = new ModButton - { - ToggleKey = Key.C, - Mods = new Mod[] - { - new ModRandom(), - }, - }, - AutoplayCinemaButton = new ModButton - { - ToggleKey = Key.V, - Mods = new Mod[] - { - new ModAutoplay(), - new ModCinema(), - }, - }, - }; - break; - - default: - throw new NotSupportedException(); - } + // default: + // throw new NotSupportedException(); + //} } } } diff --git a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs index a8ccd24115..fe9bf99a5b 100644 --- a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs +++ b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs @@ -27,51 +27,51 @@ namespace osu.Game public DifficultyIncreaseSection() { Header = @"Gameplay Difficulty Increase"; - Buttons = new ModButton[] - { - new ModButton - { - ToggleKey = Key.A, - Mods = new Mod[] - { - new ModHardRock(), - }, - }, - new ModButton - { - ToggleKey = Key.S, - Mods = new Mod[] - { - new ModSuddenDeath(), - new ModPerfect(), - }, - }, - new ModButton - { - ToggleKey = Key.D, - Mods = new Mod[] - { - new ModDoubleTime(), - new ModNightcore(), - }, - }, - new ModButton - { - ToggleKey = Key.F, - Mods = new Mod[] - { - new ModHidden(), - }, - }, - new ModButton - { - ToggleKey = Key.G, - Mods = new Mod[] - { - new ModFlashlight(), - }, - }, - }; + //Buttons = new ModButton[] + //{ + // new ModButton + // { + // ToggleKey = Key.A, + // Mods = new Mod[] + // { + // new ModHardRock(), + // }, + // }, + // new ModButton + // { + // ToggleKey = Key.S, + // Mods = new Mod[] + // { + // new ModSuddenDeath(), + // new ModPerfect(), + // }, + // }, + // new ModButton + // { + // ToggleKey = Key.D, + // Mods = new Mod[] + // { + // new ModDoubleTime(), + // new ModNightcore(), + // }, + // }, + // new ModButton + // { + // ToggleKey = Key.F, + // Mods = new Mod[] + // { + // new ModHidden(), + // }, + // }, + // new ModButton + // { + // ToggleKey = Key.G, + // Mods = new Mod[] + // { + // new ModFlashlight(), + // }, + // }, + //}; } } } diff --git a/osu.Game/Overlays/Mods/DifficultyReductionSection.cs b/osu.Game/Overlays/Mods/DifficultyReductionSection.cs index 44dd8f8080..da23a8c768 100644 --- a/osu.Game/Overlays/Mods/DifficultyReductionSection.cs +++ b/osu.Game/Overlays/Mods/DifficultyReductionSection.cs @@ -25,33 +25,33 @@ namespace osu.Game public DifficultyReductionSection() { Header = @"Gameplay Difficulty Reduction"; - Buttons = new ModButton[] - { - new ModButton - { - ToggleKey = Key.Q, - Mods = new Mod[] - { - new ModEasy(), - }, - }, - new ModButton - { - ToggleKey = Key.W, - Mods = new Mod[] - { - new ModNoFail(), - }, - }, - new ModButton - { - ToggleKey = Key.E, - Mods = new Mod[] - { - new ModHalfTime(), - }, - }, - }; + //Buttons = new ModButton[] + //{ + // new ModButton + // { + // ToggleKey = Key.Q, + // Mods = new Mod[] + // { + // new ModEasy(), + // }, + // }, + // new ModButton + // { + // ToggleKey = Key.W, + // Mods = new Mod[] + // { + // new ModNoFail(), + // }, + // }, + // new ModButton + // { + // ToggleKey = Key.E, + // Mods = new Mod[] + // { + // new ModHalfTime(), + // }, + // }, + //}; } } } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 1c9a6541b7..c6ba33583d 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -131,7 +131,7 @@ namespace osu.Game.Overlays.Mods { if (selectedMod != null) { - foreach (Modes.Mods disableMod in selectedMod.DisablesMods(ModMode)) + foreach (Modes.Mods disableMod in selectedMod.DisablesMods) { DeselectMod(disableMod); } @@ -143,11 +143,11 @@ namespace osu.Game.Overlays.Mods foreach (Mod mod in SelectedMods.Value) { - multiplier *= mod.ScoreMultiplier(ModMode); + multiplier *= mod.ScoreMultiplier; if (ranked) { - ranked = mod.Ranked(ModMode); + ranked = mod.Ranked; } }