1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Merge pull request #12834 from Henry-YSLin/flip-mod

Added "invert" mod for taiko
This commit is contained in:
Dean Herbert 2021-05-17 12:47:05 +09:00 committed by GitHub
commit de2900bc7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 0 deletions

View File

@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
@ -12,6 +14,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
public class TaikoModRandom : ModRandom, IApplicableToBeatmap public class TaikoModRandom : ModRandom, IApplicableToBeatmap
{ {
public override string Description => @"Shuffle around the colours!"; public override string Description => @"Shuffle around the colours!";
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(TaikoModSwap)).ToArray();
public void ApplyToBeatmap(IBeatmap beatmap) public void ApplyToBeatmap(IBeatmap beatmap)
{ {

View File

@ -0,0 +1,33 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using osu.Game.Beatmaps;
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 TaikoModSwap : Mod, IApplicableToBeatmap
{
public override string Name => "Swap";
public override string Acronym => "SW";
public override string Description => @"Dons become kats, kats become dons";
public override ModType Type => ModType.Conversion;
public override double ScoreMultiplier => 1;
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModRandom)).ToArray();
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;
}
}
}
}

View File

@ -136,6 +136,7 @@ namespace osu.Game.Rulesets.Taiko
new TaikoModRandom(), new TaikoModRandom(),
new TaikoModDifficultyAdjust(), new TaikoModDifficultyAdjust(),
new TaikoModClassic(), new TaikoModClassic(),
new TaikoModSwap(),
}; };
case ModType.Automation: case ModType.Automation: