1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-30 08:33:20 +08:00
osu-lazer/osu.Game.Rulesets.Taiko/Mods/TaikoModSwap.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
1.2 KiB
C#
Raw Normal View History

2021-05-16 11:16:12 +08:00
// 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.
2021-05-16 12:03:03 +08:00
using System;
using System.Linq;
2022-08-11 04:09:11 +08:00
using osu.Framework.Localisation;
2021-05-16 11:16:12 +08:00
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
{
2021-05-17 11:04:01 +08:00
public class TaikoModSwap : Mod, IApplicableToBeatmap
2021-05-16 11:16:12 +08:00
{
2021-05-17 11:04:01 +08:00
public override string Name => "Swap";
public override string Acronym => "SW";
2022-08-11 04:09:11 +08:00
public override LocalisableString Description => @"Dons become kats, kats become dons";
public override ModType Type => ModType.Conversion;
public override double ScoreMultiplier => 1;
2021-05-16 12:03:03 +08:00
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModRandom)).ToArray();
2021-05-16 11:16:12 +08:00
public void ApplyToBeatmap(IBeatmap beatmap)
{
var taikoBeatmap = (TaikoBeatmap)beatmap;
foreach (var obj in taikoBeatmap.HitObjects)
{
if (obj is Hit hit)
2021-05-16 11:28:11 +08:00
hit.Type = hit.Type == HitType.Centre ? HitType.Rim : HitType.Centre;
2021-05-16 11:16:12 +08:00
}
}
}
}