1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 15:17:44 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Mods/OsuModBarrelRoll.cs

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

42 lines
1.3 KiB
C#
Raw Normal View History

2021-04-14 15:52:29 +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.
2022-12-26 04:33:10 +08:00
using System;
using System.Diagnostics;
2021-04-14 15:52:29 +08:00
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
2021-04-14 15:52:29 +08:00
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModBarrelRoll : ModBarrelRoll<OsuHitObject>, IApplicableToDrawableHitObject
2021-04-14 15:52:29 +08:00
{
2022-12-26 04:33:10 +08:00
public override Type[] IncompatibleMods => new[] { typeof(OsuModBubbles) };
public void ApplyToDrawableHitObject(DrawableHitObject d)
{
d.OnUpdate += _ =>
{
switch (d)
{
case DrawableHitCircle circle:
circle.CirclePiece.Rotation = -CurrentRotation;
break;
}
};
}
public override void Update(Playfield playfield)
{
base.Update(playfield);
OsuPlayfield osuPlayfield = (OsuPlayfield)playfield;
Debug.Assert(osuPlayfield.Cursor != null);
osuPlayfield.Cursor.ActiveCursor.Rotation = -CurrentRotation;
}
2021-04-14 15:52:29 +08:00
}
}