From 3519398a224ba44f2f2e91ba6dd3aa921741a6a9 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sun, 16 May 2021 11:16:12 +0800 Subject: [PATCH] Added "flip" mod for taiko --- osu.Game.Rulesets.Taiko/Mods/TaikoModFlip.cs | 32 ++++++++++++++++++++ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModFlip.cs diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlip.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlip.cs new file mode 100644 index 0000000000..1f2f2c4784 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlip.cs @@ -0,0 +1,32 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics.Sprites; +using osu.Game.Beatmaps; +using osu.Game.Graphics; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Taiko.Beatmaps; +using osu.Game.Rulesets.Taiko.Objects; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModFlip : Mod, IApplicableToBeatmap + { + public override string Name => "Flip"; + public override string Acronym => "FP"; + public override string Description => @"Dons become kats, kats become dons"; + public override ModType Type => ModType.Conversion; + public override double ScoreMultiplier => 1; + + public void ApplyToBeatmap(IBeatmap beatmap) + { + var taikoBeatmap = (TaikoBeatmap)beatmap; + + foreach (var obj in taikoBeatmap.HitObjects) + { + if (obj is Hit hit) + hit.Type = hit.Type == HitType.Centre ? HitType.Rim : HitType.Centre; + } + } + } +} diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index f4e158ec32..26dc1bd416 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -133,7 +133,7 @@ public override IEnumerable GetModsFor(ModType type) case ModType.Conversion: return new Mod[] { - new TaikoModRandom(), + new MultiMod(new TaikoModFlip(), new TaikoModRandom()), new TaikoModDifficultyAdjust(), new TaikoModClassic(), };