mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Add support for hit explosions
This commit is contained in:
parent
81df22d2a7
commit
7dc090cc24
@ -13,10 +13,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
public class DrawableDrumRollTick : DrawableTaikoHitObject<DrumRollTick>
|
||||
{
|
||||
/// <summary>
|
||||
/// The action type that the user took which caused this tick to
|
||||
/// have been judged as "hit"
|
||||
/// The hit type corresponding to the <see cref="TaikoAction"/> that the user pressed to hit this <see cref="DrawableDrumRollTick"/>.
|
||||
/// </summary>
|
||||
public TaikoAction JudgedAction;
|
||||
public HitType JudgementType;
|
||||
|
||||
public DrawableDrumRollTick(DrumRollTick tick)
|
||||
: base(tick)
|
||||
@ -57,7 +56,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
public override bool OnPressed(TaikoAction action)
|
||||
{
|
||||
JudgedAction = action;
|
||||
JudgementType = action == TaikoAction.LeftRim || action == TaikoAction.RightRim ? HitType.Rim : HitType.Centre;
|
||||
return UpdateResult(true);
|
||||
}
|
||||
|
||||
|
@ -21,16 +21,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
public override bool RemoveWhenNotAlive => true;
|
||||
|
||||
public readonly DrawableHitObject JudgedObject;
|
||||
private readonly HitType type;
|
||||
|
||||
private readonly Box innerFill;
|
||||
|
||||
private readonly bool isRim;
|
||||
|
||||
public HitExplosion(DrawableHitObject judgedObject, bool isRim)
|
||||
public HitExplosion(DrawableHitObject judgedObject, HitType type)
|
||||
{
|
||||
this.isRim = isRim;
|
||||
|
||||
JudgedObject = judgedObject;
|
||||
this.type = type;
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
@ -58,7 +56,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
innerFill.Colour = isRim ? colours.BlueDarker : colours.PinkDarker;
|
||||
innerFill.Colour = type == HitType.Rim ? colours.BlueDarker : colours.PinkDarker;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -18,14 +18,12 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
public override bool RemoveWhenNotAlive => true;
|
||||
|
||||
public readonly DrawableHitObject JudgedObject;
|
||||
private readonly HitType type;
|
||||
|
||||
private readonly bool isRim;
|
||||
|
||||
public KiaiHitExplosion(DrawableHitObject judgedObject, bool isRim)
|
||||
public KiaiHitExplosion(DrawableHitObject judgedObject, HitType type)
|
||||
{
|
||||
this.isRim = isRim;
|
||||
|
||||
JudgedObject = judgedObject;
|
||||
this.type = type;
|
||||
|
||||
Anchor = Anchor.CentreLeft;
|
||||
Origin = Anchor.Centre;
|
||||
@ -53,7 +51,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
Colour = isRim ? colours.BlueDarker : colours.PinkDarker,
|
||||
Colour = type == HitType.Rim ? colours.BlueDarker : colours.PinkDarker,
|
||||
Radius = 60,
|
||||
};
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Rulesets.UI.Scrolling;
|
||||
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||
@ -197,8 +196,13 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
break;
|
||||
|
||||
case TaikoDrumRollTickJudgement _:
|
||||
if (result.IsHit)
|
||||
playDrumrollHit((DrawableDrumRollTick)judgedObject);
|
||||
if (!result.IsHit)
|
||||
return;
|
||||
|
||||
var drawableTick = (DrawableDrumRollTick)judgedObject;
|
||||
|
||||
addDrumRollHit(drawableTick);
|
||||
addExplosion(drawableTick, drawableTick.JudgementType);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -213,25 +217,19 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
if (!result.IsHit)
|
||||
break;
|
||||
|
||||
bool isRim = (judgedObject.HitObject as Hit)?.Type == HitType.Rim;
|
||||
|
||||
hitExplosionContainer.Add(new HitExplosion(judgedObject, isRim));
|
||||
|
||||
if (judgedObject.HitObject.Kiai)
|
||||
kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject, isRim));
|
||||
addExplosion(judgedObject, (judgedObject.HitObject as Hit)?.Type ?? HitType.Centre);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void playDrumrollHit(DrawableDrumRollTick drumrollTick)
|
||||
private void addDrumRollHit(DrawableDrumRollTick drawableTick)
|
||||
{
|
||||
TaikoAction action = drumrollTick.JudgedAction;
|
||||
bool isStrong = drumrollTick.HitObject.IsStrong;
|
||||
double time = drumrollTick.HitObject.GetEndTime();
|
||||
bool isStrong = drawableTick.HitObject.IsStrong;
|
||||
double time = drawableTick.HitObject.GetEndTime();
|
||||
|
||||
DrawableHit drawableHit;
|
||||
if (action == TaikoAction.LeftRim || action == TaikoAction.RightRim)
|
||||
if (drawableTick.JudgementType == HitType.Rim)
|
||||
drawableHit = new DrawableFlyingRimHit(time, isStrong);
|
||||
else
|
||||
drawableHit = new DrawableFlyingCentreHit(time, isStrong);
|
||||
@ -239,6 +237,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
drumRollHitContainer.Add(drawableHit);
|
||||
}
|
||||
|
||||
private void addExplosion(DrawableHitObject drawableObject, HitType type)
|
||||
{
|
||||
hitExplosionContainer.Add(new HitExplosion(drawableObject, type));
|
||||
|
||||
if (drawableObject.HitObject.Kiai)
|
||||
kiaiExplosionContainer.Add(new KiaiHitExplosion(drawableObject, type));
|
||||
}
|
||||
|
||||
private class ProxyContainer : LifetimeManagementContainer
|
||||
{
|
||||
public new MarginPadding Padding
|
||||
|
Loading…
Reference in New Issue
Block a user