1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:25:39 +08:00

Add sane defaults for abstract Mod class and remove remaining use of enum.

This commit is contained in:
Dean Herbert 2017-03-06 18:28:30 +09:00
parent 45f500920c
commit 12a3b1414f
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
6 changed files with 46 additions and 169 deletions

View File

@ -19,7 +19,6 @@ namespace osu.Game.Modes.Catch
{
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 Type[] IncompatibleMods => new Type[] { };
}
public class CatchModHardRock : ModHardRock
@ -56,7 +55,6 @@ namespace osu.Game.Modes.Catch
public class CatchModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
public override Type[] IncompatibleMods => new Type[] { };
}
public class CatchModPerfect : ModPerfect

View File

@ -26,7 +26,6 @@ namespace osu.Game.Modes.Mania
public class ManiaModHardRock : ModHardRock
{
public override double ScoreMultiplier => 1.0;
public override bool Ranked => false;
}
public class ManiaModSuddenDeath : ModSuddenDeath
@ -62,9 +61,8 @@ namespace osu.Game.Modes.Mania
public class ManiaModFadeIn : Mod
{
public override Mods Name => Mods.FadeIn;
public override string Name => "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 Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
@ -72,85 +70,77 @@ namespace osu.Game.Modes.Mania
public class ManiaModRandom : Mod
{
public override Mods Name => Mods.Random;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Name => "Random";
public override string Description => @"Shuffle around the notes!";
public override double ScoreMultiplier => 1;
public override bool Ranked => false;
public override Type[] IncompatibleMods => new Type[] { };
}
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 Type[] IncompatibleMods => new Type[] { };
}
public class ManiaModKey1 : ManiaKeyMod
{
public override int KeyCount => 1;
public override Mods Name => Mods.Key1;
public override string Name => "1K";
}
public class ManiaModKey2 : ManiaKeyMod
{
public override int KeyCount => 2;
public override Mods Name => Mods.Key2;
public override string Name => "2K";
}
public class ManiaModKey3 : ManiaKeyMod
{
public override int KeyCount => 3;
public override Mods Name => Mods.Key3;
public override string Name => "3K";
}
public class ManiaModKey4 : ManiaKeyMod
{
public override int KeyCount => 4;
public override Mods Name => Mods.Key4;
public override string Name => "4K";
}
public class ManiaModKey5 : ManiaKeyMod
{
public override int KeyCount => 5;
public override Mods Name => Mods.Key5;
public override string Name => "5K";
}
public class ManiaModKey6 : ManiaKeyMod
{
public override int KeyCount => 6;
public override Mods Name => Mods.Key6;
public override string Name => "6K";
}
public class ManiaModKey7 : ManiaKeyMod
{
public override int KeyCount => 7;
public override Mods Name => Mods.Key7;
public override string Name => "7K";
}
public class ManiaModKey8 : ManiaKeyMod
{
public override int KeyCount => 8;
public override Mods Name => Mods.Key8;
public override string Name => "8K";
}
public class ManiaModKey9 : ManiaKeyMod
{
public override int KeyCount => 9;
public override Mods Name => Mods.Key9;
public override string Name => "9K";
}
public class ManiaModKeyCoop : Mod
{
public override Mods Name => Mods.KeyCoop;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Name => "KeyCoop";
public override string Description => @"Double the key amount, double the fun!";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new Type[] { };
}
}

View File

@ -21,7 +21,6 @@ namespace osu.Game.Modes.Osu
{
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 Type[] IncompatibleMods => new Type[] { };
}
public class OsuModHardRock : ModHardRock
@ -59,7 +58,6 @@ namespace osu.Game.Modes.Osu
public class OsuModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
public override Type[] IncompatibleMods => new Type[] { };
}
public class OsuModPerfect : ModPerfect
@ -69,7 +67,7 @@ namespace osu.Game.Modes.Osu
public class OsuModSpunOut : Mod
{
public override Mods Name => Mods.SpunOut;
public override string Name => "Spun Out";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
public override string Description => @"Spinners will be automatically completed";
public override double ScoreMultiplier => 0.9;
@ -79,7 +77,7 @@ namespace osu.Game.Modes.Osu
public class OsuModAutopilot : Mod
{
public override Mods Name => Mods.Autopilot;
public override string Name => "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;
@ -94,11 +92,9 @@ namespace osu.Game.Modes.Osu
public class OsuModTarget : Mod
{
public override Mods Name => Mods.Target;
public override string Name => "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 Type[] IncompatibleMods => new Type[] { };
}
}

View File

@ -19,7 +19,6 @@ namespace osu.Game.Modes.Taiko
{
public override string Description => @"The notes fade out before you hit them!";
public override double ScoreMultiplier => 1.06;
public override Type[] IncompatibleMods => new Type[] { };
}
public class TaikoModHardRock : ModHardRock
@ -56,7 +55,6 @@ namespace osu.Game.Modes.Taiko
public class TaikoModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
public override Type[] IncompatibleMods => new Type[] { };
}
public class TaikoModPerfect : ModPerfect

View File

@ -15,17 +15,17 @@ namespace osu.Game.Modes
/// <summary>
/// The name of this mod.
/// </summary>
public abstract Mods Name { get; }
public abstract string Name { get; }
/// <summary>
/// The icon of this mod.
/// </summary>
public abstract FontAwesome Icon { get; }
public virtual FontAwesome Icon => FontAwesome.fa_question;
/// <summary>
/// The user readable description of this mod.
/// </summary>
public abstract string Description { get; }
public virtual string Description => string.Empty;
/// <summary>
/// The score multiplier of this mod.
@ -35,31 +35,28 @@ namespace osu.Game.Modes
/// <summary>
/// Returns if this mod is ranked.
/// </summary>
public abstract bool Ranked { get; }
public virtual bool Ranked => false;
/// <summary>
/// The mods this mod cannot be enabled with.
/// </summary>
public abstract Type[] IncompatibleMods { get; }
public virtual Type[] IncompatibleMods => new Type[] { };
}
public class MultiMod : Mod
{
public override Mods Name => Modes.Mods.None;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Description => @"";
public override string Name => string.Empty;
public override string Description => string.Empty;
public override double ScoreMultiplier => 0.0;
public override bool Ranked => false;
public override Type[] IncompatibleMods => new Type[] { };
public Mod[] Mods;
}
public abstract class ModNoFail : Mod
{
public override Mods Name => Mods.NoFail;
public override string Name => "NoFail";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
public override string Description => @"You can't fail, no matter what.";
public override string Description => "You can't fail, no matter what.";
public override double ScoreMultiplier => 0.5;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect) };
@ -67,34 +64,33 @@ namespace osu.Game.Modes
public abstract class ModEasy : Mod
{
public override Mods Name => Mods.Easy;
public override string Name => "Easy";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
public override string Description => @"Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required.";
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 Type[] IncompatibleMods => new[] { typeof(ModHardRock) };
}
public abstract class ModHidden : Mod
{
public override Mods Name => Mods.Hidden;
public override string Name => "Hidden";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
public override bool Ranked => true;
}
public abstract class ModHardRock : Mod
{
public override Mods Name => Mods.HardRock;
public override string Name => "Hard Rock";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
public override string Description => @"Everything just got a bit harder...";
public override string Description => "Everything just got a bit harder...";
public override Type[] IncompatibleMods => new[] { typeof(ModEasy) };
}
public abstract class ModSuddenDeath : Mod
{
public override Mods Name => Mods.SuddenDeath;
public override string Name => "Sudden Death";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
public override string Description => @"Miss a note and fail.";
public override string Description => "Miss a note and fail.";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay), typeof(ModCinema) };
@ -102,167 +98,66 @@ namespace osu.Game.Modes
public abstract class ModDoubleTime : Mod
{
public override Mods Name => Mods.DoubleTime;
public override string Name => "Double Time";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
public override string Description => @"Zoooooooooom";
public override string Description => "Zoooooooooom";
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModHalfTime) };
}
public abstract class ModRelax : Mod
{
public override Mods Name => Mods.Relax;
public override string Name => "Relax";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModCinema), typeof(ModNoFail), typeof(ModSuddenDeath), typeof(ModPerfect) };
}
public abstract class ModHalfTime : Mod
{
public override Mods Name => Mods.HalfTime;
public override string Name => "Half Time";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
public override string Description => @"Less zoom";
public override string Description => "Less zoom";
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime), typeof(ModNightcore) };
}
public abstract class ModNightcore : ModDoubleTime
{
public override Mods Name => Mods.Nightcore;
public override string Name => "Nightcore";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore;
public override string Description => @"uguuuuuuuu";
public override string Description => "uguuuuuuuu";
}
public abstract class ModFlashlight : Mod
{
public override Mods Name => Mods.Flashlight;
public override string Name => "Flashlight";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
public override string Description => @"Restricted view area.";
public override string Description => "Restricted view area.";
public override bool Ranked => true;
}
public class ModAutoplay : Mod
{
public override Mods Name => Mods.Autoplay;
public override string Name => "Autoplay";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
public override string Description => @"Watch a perfect automated play through the song";
public override string Description => "Watch a perfect automated play through the song";
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect) };
}
public abstract class ModPerfect : ModSuddenDeath
{
public override Mods Name => Mods.Perfect;
public override FontAwesome Icon => FontAwesome.fa_close;
public override string Description => @"SS or quit.";
public override string Name => "Perfect";
public override string Description => "SS or quit.";
}
public class ModCinema : ModAutoplay
{
public override Mods Name => Mods.Cinema;
public override string Name => "Cinema";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
}
[Flags]
public enum Mods
{
None = 0,
[Description(@"No Fail")]
NoFail = 1 << 0,
[Description(@"Easy")]
Easy = 1 << 1,
//NoVideo = 1 << 2,
[Description(@"Hidden")]
Hidden = 1 << 3,
[Description(@"Hard Rock")]
HardRock = 1 << 4,
[Description(@"Sudden Death")]
SuddenDeath = 1 << 5,
[Description(@"Double Time")]
DoubleTime = 1 << 6,
[Description(@"Relax")]
Relax = 1 << 7,
[Description(@"Halftime")]
HalfTime = 1 << 8,
[Description(@"Nightcore")]
Nightcore = 1 << 9,
[Description(@"Flashlight")]
Flashlight = 1 << 10,
[Description(@"Auto")]
Autoplay = 1 << 11,
[Description(@"Spun Out")]
SpunOut = 1 << 12,
[Description(@"Autopilot")]
Autopilot = 1 << 13,
[Description(@"Perfect")]
Perfect = 1 << 14,
[Description(@"4K")]
Key4 = 1 << 15,
[Description(@"5K")]
Key5 = 1 << 16,
[Description(@"6K")]
Key6 = 1 << 17,
[Description(@"7K")]
Key7 = 1 << 18,
[Description(@"8K")]
Key8 = 1 << 19,
[Description(@"Fade In")]
FadeIn = 1 << 20,
[Description(@"Random")]
Random = 1 << 21,
[Description(@"Cinema")]
Cinema = 1 << 22,
[Description(@"Target Practice")]
Target = 1 << 23,
[Description(@"9K")]
Key9 = 1 << 24,
[Description(@"Co-Op")]
KeyCoop = 1 << 25,
[Description(@"1K")]
Key1 = 1 << 26,
[Description(@"3K")]
Key3 = 1 << 27,
[Description(@"2K")]
Key2 = 1 << 28,
LastMod = 1 << 29,
KeyMod = Key1 | Key2 | Key3 | Key4 | Key5 | Key6 | Key7 | Key8 | Key9 | KeyCoop,
FreeModAllowed = NoFail | Easy | Hidden | HardRock | SuddenDeath | Flashlight | FadeIn | Relax | Autopilot | SpunOut | KeyMod,
ScoreIncreaseMods = Hidden | HardRock | DoubleTime | Flashlight | FadeIn
}
public enum ModType
{
DifficultyReduction,

View File

@ -184,7 +184,7 @@ namespace osu.Game.Overlays.Mods
private void displayMod(Mod mod)
{
displayIcon.Icon = mod.Icon;
text.Text = mod.Name.GetDescription();
text.Text = mod.Name;
}
private void displaySelectedMod()