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;
|
2021-04-14 15:52:29 +08:00
|
|
|
using osu.Game.Rulesets.Mods;
|
2021-04-20 17:36:11 +08:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2021-04-15 12:06:52 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2021-04-20 17:36:11 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2021-04-14 15:52:29 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Mods
|
|
|
|
{
|
2021-06-16 17:52:01 +08:00
|
|
|
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) };
|
|
|
|
|
2021-06-16 17:52:01 +08:00
|
|
|
public void ApplyToDrawableHitObject(DrawableHitObject d)
|
2021-04-20 17:36:11 +08:00
|
|
|
{
|
2021-06-16 17:52:01 +08:00
|
|
|
d.OnUpdate += _ =>
|
2021-04-20 17:36:11 +08:00
|
|
|
{
|
2021-06-16 17:52:01 +08:00
|
|
|
switch (d)
|
2021-04-20 17:36:11 +08:00
|
|
|
{
|
2021-06-16 17:52:01 +08:00
|
|
|
case DrawableHitCircle circle:
|
|
|
|
circle.CirclePiece.Rotation = -CurrentRotation;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
2021-04-20 17:36:11 +08:00
|
|
|
}
|
2021-04-14 15:52:29 +08:00
|
|
|
}
|
|
|
|
}
|