mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Parse the mods of a leaderboard's score
This commit is contained in:
parent
07487b5ca9
commit
4c2d7bf343
@ -20,6 +20,24 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
{
|
{
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new CatchRulesetContainer(this, beatmap, isForCurrentRuleset);
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new CatchRulesetContainer(this, beatmap, isForCurrentRuleset);
|
||||||
|
|
||||||
|
public override IEnumerable<Mod> GetAllMods() => new Mod[]
|
||||||
|
{
|
||||||
|
new CatchModEasy(),
|
||||||
|
new CatchModNoFail(),
|
||||||
|
new CatchModHalfTime(),
|
||||||
|
new CatchModDaycore(),
|
||||||
|
new CatchModHardRock(),
|
||||||
|
new CatchModSuddenDeath(),
|
||||||
|
new CatchModPerfect(),
|
||||||
|
new CatchModDoubleTime(),
|
||||||
|
new CatchModNightcore(),
|
||||||
|
new CatchModHidden(),
|
||||||
|
new CatchModFlashlight(),
|
||||||
|
new CatchModRelax(),
|
||||||
|
new ModAutoplay(),
|
||||||
|
new ModCinema()
|
||||||
|
};
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type)
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
@ -19,6 +19,36 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
{
|
{
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaRulesetContainer(this, beatmap, isForCurrentRuleset);
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaRulesetContainer(this, beatmap, isForCurrentRuleset);
|
||||||
|
|
||||||
|
public override IEnumerable<Mod> GetAllMods() => new Mod[]
|
||||||
|
{
|
||||||
|
new ManiaModEasy(),
|
||||||
|
new ManiaModNoFail(),
|
||||||
|
new ManiaModHalfTime(),
|
||||||
|
new ManiaModDaycore(),
|
||||||
|
new ManiaModHardRock(),
|
||||||
|
new ManiaModSuddenDeath(),
|
||||||
|
new ManiaModPerfect(),
|
||||||
|
new ManiaModDoubleTime(),
|
||||||
|
new ManiaModNightcore(),
|
||||||
|
new ManiaModFadeIn(),
|
||||||
|
new ManiaModHidden(),
|
||||||
|
new ManiaModFlashlight(),
|
||||||
|
new ManiaModKey4(),
|
||||||
|
new ManiaModKey5(),
|
||||||
|
new ManiaModKey6(),
|
||||||
|
new ManiaModKey7(),
|
||||||
|
new ManiaModKey8(),
|
||||||
|
new ManiaModKey9(),
|
||||||
|
new ManiaModKey1(),
|
||||||
|
new ManiaModKey2(),
|
||||||
|
new ManiaModKey3(),
|
||||||
|
new ManiaModRandom(),
|
||||||
|
new ManiaModKeyCoop(),
|
||||||
|
new ModAutoplay(),
|
||||||
|
new ModCinema(),
|
||||||
|
new ManiaModGravity()
|
||||||
|
};
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type)
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
@ -68,6 +68,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModFadeIn : Mod
|
public class ManiaModFadeIn : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "FadeIn";
|
public override string Name => "FadeIn";
|
||||||
|
public override string ShortenedName => "FI";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
@ -78,12 +79,14 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModRandom : Mod
|
public class ManiaModRandom : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Random";
|
public override string Name => "Random";
|
||||||
|
public override string ShortenedName => "RD";
|
||||||
public override string Description => @"Shuffle around the notes!";
|
public override string Description => @"Shuffle around the notes!";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class ManiaKeyMod : Mod
|
public abstract class ManiaKeyMod : Mod
|
||||||
{
|
{
|
||||||
|
public override string ShortenedName => Name;
|
||||||
public abstract int KeyCount { get; }
|
public abstract int KeyCount { get; }
|
||||||
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
|
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
@ -146,6 +149,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModKeyCoop : Mod
|
public class ManiaModKeyCoop : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "KeyCoop";
|
public override string Name => "KeyCoop";
|
||||||
|
public override string ShortenedName => "CO";
|
||||||
public override string Description => @"Double the key amount, double the fun!";
|
public override string Description => @"Double the key amount, double the fun!";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
|
@ -15,6 +15,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModGravity : Mod, IGenerateSpeedAdjustments
|
public class ManiaModGravity : Mod, IGenerateSpeedAdjustments
|
||||||
{
|
{
|
||||||
public override string Name => "Gravity";
|
public override string Name => "Gravity";
|
||||||
|
public override string ShortenedName => "GR";
|
||||||
|
|
||||||
public override double ScoreMultiplier => 0;
|
public override double ScoreMultiplier => 0;
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public class OsuModSpunOut : Mod
|
public class OsuModSpunOut : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Spun Out";
|
public override string Name => "Spun Out";
|
||||||
|
public override string ShortenedName => "SO";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
|
||||||
public override string Description => @"Spinners will be automatically completed";
|
public override string Description => @"Spinners will be automatically completed";
|
||||||
public override double ScoreMultiplier => 0.9;
|
public override double ScoreMultiplier => 0.9;
|
||||||
@ -88,6 +89,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public class OsuModAutopilot : Mod
|
public class OsuModAutopilot : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Autopilot";
|
public override string Name => "Autopilot";
|
||||||
|
public override string ShortenedName => "AP";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
|
||||||
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
|
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
|
||||||
public override double ScoreMultiplier => 0;
|
public override double ScoreMultiplier => 0;
|
||||||
@ -108,6 +110,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public class OsuModTarget : Mod
|
public class OsuModTarget : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Target";
|
public override string Name => "Target";
|
||||||
|
public override string ShortenedName => "TP";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
|
||||||
public override string Description => @"";
|
public override string Description => @"";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
|
@ -24,6 +24,27 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
{
|
{
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new OsuRulesetContainer(this, beatmap, isForCurrentRuleset);
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new OsuRulesetContainer(this, beatmap, isForCurrentRuleset);
|
||||||
|
|
||||||
|
public override IEnumerable<Mod> GetAllMods() => new Mod[]
|
||||||
|
{
|
||||||
|
new OsuModEasy(),
|
||||||
|
new OsuModNoFail(),
|
||||||
|
new OsuModHalfTime(),
|
||||||
|
new OsuModDaycore(),
|
||||||
|
new OsuModHardRock(),
|
||||||
|
new OsuModSuddenDeath(),
|
||||||
|
new OsuModPerfect(),
|
||||||
|
new OsuModDoubleTime(),
|
||||||
|
new OsuModNightcore(),
|
||||||
|
new OsuModHidden(),
|
||||||
|
new OsuModFlashlight(),
|
||||||
|
new OsuModRelax(),
|
||||||
|
new OsuModAutopilot(),
|
||||||
|
new OsuModSpunOut(),
|
||||||
|
new OsuModAutoplay(),
|
||||||
|
new ModCinema(),
|
||||||
|
new OsuModTarget(),
|
||||||
|
};
|
||||||
|
|
||||||
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new[]
|
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new[]
|
||||||
{
|
{
|
||||||
new BeatmapStatistic
|
new BeatmapStatistic
|
||||||
|
@ -20,6 +20,24 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
{
|
{
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new TaikoRulesetContainer(this, beatmap, isForCurrentRuleset);
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new TaikoRulesetContainer(this, beatmap, isForCurrentRuleset);
|
||||||
|
|
||||||
|
public override IEnumerable<Mod> GetAllMods() => new Mod[]
|
||||||
|
{
|
||||||
|
new TaikoModEasy(),
|
||||||
|
new TaikoModNoFail(),
|
||||||
|
new TaikoModHalfTime(),
|
||||||
|
new TaikoModDaycore(),
|
||||||
|
new TaikoModHardRock(),
|
||||||
|
new TaikoModSuddenDeath(),
|
||||||
|
new TaikoModPerfect(),
|
||||||
|
new TaikoModDoubleTime(),
|
||||||
|
new TaikoModNightcore(),
|
||||||
|
new TaikoModHidden(),
|
||||||
|
new TaikoModFlashlight(),
|
||||||
|
new TaikoModRelax(),
|
||||||
|
new TaikoModAutoplay(),
|
||||||
|
new ModCinema()
|
||||||
|
};
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type)
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
@ -58,6 +58,8 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
private class DummyRuleset : Ruleset
|
private class DummyRuleset : Ruleset
|
||||||
{
|
{
|
||||||
|
public override IEnumerable<Mod> GetAllMods() => new Mod[] { };
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
|
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
|
||||||
|
|
||||||
public override Mod GetAutoplayMod() => new ModAutoplay();
|
public override Mod GetAutoplayMod() => new ModAutoplay();
|
||||||
|
@ -16,6 +16,11 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract string Name { get; }
|
public abstract string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The shortened name of this mod.
|
||||||
|
/// </summary>
|
||||||
|
public abstract string ShortenedName { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The icon of this mod.
|
/// The icon of this mod.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class ModAutoplay : Mod
|
public class ModAutoplay : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Autoplay";
|
public override string Name => "Autoplay";
|
||||||
|
public override string ShortenedName => "AT";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
|
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 double ScoreMultiplier => 0;
|
||||||
|
@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class ModCinema : ModAutoplay
|
public class ModCinema : ModAutoplay
|
||||||
{
|
{
|
||||||
public override string Name => "Cinema";
|
public override string Name => "Cinema";
|
||||||
|
public override string ShortenedName => "CN";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModDaycore : ModHalfTime
|
public abstract class ModDaycore : ModHalfTime
|
||||||
{
|
{
|
||||||
public override string Name => "Daycore";
|
public override string Name => "Daycore";
|
||||||
|
public override string ShortenedName => "DC";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_question;
|
public override FontAwesome Icon => FontAwesome.fa_question;
|
||||||
public override string Description => "whoaaaaa";
|
public override string Description => "whoaaaaa";
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class ModDoubleTime : Mod, IApplicableToClock
|
public class ModDoubleTime : Mod, IApplicableToClock
|
||||||
{
|
{
|
||||||
public override string Name => "Double Time";
|
public override string Name => "Double Time";
|
||||||
|
public override string ShortenedName => "DT";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Zoooooooooom";
|
public override string Description => "Zoooooooooom";
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModEasy : Mod, IApplicableToDifficulty
|
public abstract class ModEasy : Mod, IApplicableToDifficulty
|
||||||
{
|
{
|
||||||
public override string Name => "Easy";
|
public override string Name => "Easy";
|
||||||
|
public override string ShortenedName => "EZ";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
|
||||||
public override ModType Type => ModType.DifficultyReduction;
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
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.";
|
||||||
|
@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModFlashlight : Mod
|
public abstract class ModFlashlight : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Flashlight";
|
public override string Name => "Flashlight";
|
||||||
|
public override string ShortenedName => "FL";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Restricted view area.";
|
public override string Description => "Restricted view area.";
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModHalfTime : Mod, IApplicableToClock
|
public abstract class ModHalfTime : Mod, IApplicableToClock
|
||||||
{
|
{
|
||||||
public override string Name => "Half Time";
|
public override string Name => "Half Time";
|
||||||
|
public override string ShortenedName => "HT";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
|
||||||
public override ModType Type => ModType.DifficultyReduction;
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
public override string Description => "Less zoom";
|
public override string Description => "Less zoom";
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModHardRock : Mod, IApplicableToDifficulty
|
public abstract class ModHardRock : Mod, IApplicableToDifficulty
|
||||||
{
|
{
|
||||||
public override string Name => "Hard Rock";
|
public override string Name => "Hard Rock";
|
||||||
|
public override string ShortenedName => "HR";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Everything just got a bit harder...";
|
public override string Description => "Everything just got a bit harder...";
|
||||||
|
@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModHidden : Mod
|
public abstract class ModHidden : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Hidden";
|
public override string Name => "Hidden";
|
||||||
|
public override string ShortenedName => "HD";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModNightcore : ModDoubleTime
|
public abstract class ModNightcore : ModDoubleTime
|
||||||
{
|
{
|
||||||
public override string Name => "Nightcore";
|
public override string Name => "Nightcore";
|
||||||
|
public override string ShortenedName => "NC";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore;
|
||||||
public override string Description => "uguuuuuuuu";
|
public override string Description => "uguuuuuuuu";
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModNoFail : Mod
|
public abstract class ModNoFail : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "NoFail";
|
public override string Name => "NoFail";
|
||||||
|
public override string ShortenedName => "NF";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
|
||||||
public override ModType Type => ModType.DifficultyReduction;
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
public override string Description => "You can't fail, no matter what.";
|
public override string Description => "You can't fail, no matter what.";
|
||||||
|
@ -6,6 +6,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModPerfect : ModSuddenDeath
|
public abstract class ModPerfect : ModSuddenDeath
|
||||||
{
|
{
|
||||||
public override string Name => "Perfect";
|
public override string Name => "Perfect";
|
||||||
|
public override string ShortenedName => "PF";
|
||||||
public override string Description => "SS or quit.";
|
public override string Description => "SS or quit.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModRelax : Mod
|
public abstract class ModRelax : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Relax";
|
public override string Name => "Relax";
|
||||||
|
public override string ShortenedName => "RX";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
|
||||||
public override double ScoreMultiplier => 0;
|
public override double ScoreMultiplier => 0;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
|
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
|
||||||
|
@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModSuddenDeath : Mod
|
public abstract class ModSuddenDeath : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Sudden Death";
|
public override string Name => "Sudden Death";
|
||||||
|
public override string ShortenedName => "SD";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Miss a note and fail.";
|
public override string Description => "Miss a note and fail.";
|
||||||
|
@ -6,6 +6,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class MultiMod : Mod
|
public class MultiMod : Mod
|
||||||
{
|
{
|
||||||
public override string Name => string.Empty;
|
public override string Name => string.Empty;
|
||||||
|
public override string ShortenedName => string.Empty;
|
||||||
public override string Description => string.Empty;
|
public override string Description => string.Empty;
|
||||||
public override double ScoreMultiplier => 0.0;
|
public override double ScoreMultiplier => 0.0;
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using System.Collections.Generic;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
@ -19,8 +19,21 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
||||||
|
|
||||||
|
public abstract IEnumerable<Mod> GetAllMods();
|
||||||
|
|
||||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
||||||
|
|
||||||
|
public Mod GetModByShortenedName(string shortenedName)
|
||||||
|
{
|
||||||
|
foreach(Mod mod in GetAllMods())
|
||||||
|
{
|
||||||
|
if (string.Equals(mod.ShortenedName, shortenedName))
|
||||||
|
return mod;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public abstract Mod GetAutoplayMod();
|
public abstract Mod GetAutoplayMod();
|
||||||
|
|
||||||
protected Ruleset(RulesetInfo rulesetInfo)
|
protected Ruleset(RulesetInfo rulesetInfo)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
@ -27,10 +28,31 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
public int Combo { get; set; }
|
public int Combo { get; set; }
|
||||||
|
|
||||||
|
private string[] modStrings;
|
||||||
[JsonProperty(@"mods")]
|
[JsonProperty(@"mods")]
|
||||||
protected string[] ModStrings { get; set; } //todo: parse to Mod objects
|
protected string[] ModStrings {
|
||||||
|
get { return modStrings; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
modStrings = value;
|
||||||
|
|
||||||
public RulesetInfo Ruleset { get; set; }
|
if (ruleset != null)
|
||||||
|
handleModString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private RulesetInfo ruleset;
|
||||||
|
public RulesetInfo Ruleset
|
||||||
|
{
|
||||||
|
get { return ruleset; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ruleset = value;
|
||||||
|
|
||||||
|
if (modStrings != null)
|
||||||
|
handleModString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Mod[] Mods { get; set; }
|
public Mod[] Mods { get; set; }
|
||||||
|
|
||||||
@ -80,5 +102,17 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string, dynamic> Statistics = new Dictionary<string, dynamic>();
|
public Dictionary<string, dynamic> Statistics = new Dictionary<string, dynamic>();
|
||||||
|
|
||||||
|
private void handleModString()
|
||||||
|
{
|
||||||
|
List<Mod> modList = new List<Mod>();
|
||||||
|
|
||||||
|
Ruleset rulesetInstance = Ruleset.CreateInstance();
|
||||||
|
|
||||||
|
foreach (string modShortenedName in modStrings)
|
||||||
|
modList.Add(rulesetInstance.GetModByShortenedName(modShortenedName));
|
||||||
|
|
||||||
|
Mods = modList.ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using System;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -55,6 +55,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
i = 0;
|
i = 0;
|
||||||
foreach (var s in scores)
|
foreach (var s in scores)
|
||||||
{
|
{
|
||||||
|
s.Ruleset = beatmap.Ruleset;
|
||||||
|
|
||||||
var ls = new LeaderboardScore(s, 1 + i)
|
var ls = new LeaderboardScore(s, 1 + i)
|
||||||
{
|
{
|
||||||
AlwaysPresent = true,
|
AlwaysPresent = true,
|
||||||
|
@ -256,8 +256,23 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
{
|
{
|
||||||
foreach (Mod mod in Score.Mods)
|
foreach (Mod mod in Score.Mods)
|
||||||
{
|
{
|
||||||
// TODO: Get actual mod colours
|
Color4 modColor;
|
||||||
modsContainer.Add(new ScoreModIcon(mod.Icon, OsuColour.FromHex(@"ffcc22")));
|
|
||||||
|
switch (mod.Type)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case ModType.DifficultyIncrease:
|
||||||
|
modColor = OsuColour.FromHex(@"ffcc22");
|
||||||
|
break;
|
||||||
|
case ModType.DifficultyReduction:
|
||||||
|
modColor = OsuColour.FromHex(@"88b300");
|
||||||
|
break;
|
||||||
|
case ModType.Special:
|
||||||
|
modColor = OsuColour.FromHex(@"66ccff");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
modsContainer.Add(new ScoreModIcon(mod.Icon, modColor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user