1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 06:23:20 +08:00

Visual adjustments to DrawableSwell.

This commit is contained in:
Dean Herbert 2017-03-31 11:20:04 +09:00
parent b48def1627
commit bcd7e41bf7
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -26,16 +26,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
/// </summary> /// </summary>
public event Action OnStart; public event Action OnStart;
private const float target_ring_thick_border = 4f; private const float target_ring_thick_border = 1.4f;
private const float target_ring_thin_border = 1f; private const float target_ring_thin_border = 1f;
private const float target_ring_scale = 5f; private const float target_ring_scale = 5f;
private const float inner_ring_alpha = 0.35f; private const float inner_ring_alpha = 0.65f;
private readonly Swell swell; private readonly Swell swell;
private readonly Container bodyContainer; private readonly Container bodyContainer;
private readonly CircularContainer targetRing; private readonly CircularContainer targetRing;
private readonly CircularContainer innerRing; private readonly CircularContainer expandingRing;
private readonly CirclePiece circlePiece; private readonly CirclePiece circlePiece;
@ -49,6 +49,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
private int userHits; private int userHits;
private bool hasStarted; private bool hasStarted;
private readonly SwellSymbolPiece symbol;
public DrawableSwell(Swell swell) public DrawableSwell(Swell swell)
: base(swell) : base(swell)
@ -61,12 +62,14 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
{ {
Children = new Framework.Graphics.Drawable[] Children = new Framework.Graphics.Drawable[]
{ {
innerRing = new CircularContainer expandingRing = new CircularContainer
{ {
Name = "Inner ring", Name = "Expanding ring",
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Alpha = 0,
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2), Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
BlendingMode = BlendingMode.Additive,
Masking = true, Masking = true,
Children = new [] Children = new []
{ {
@ -85,6 +88,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2), Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
Masking = true, Masking = true,
BorderThickness = target_ring_thick_border, BorderThickness = target_ring_thick_border,
BlendingMode = BlendingMode.Additive,
Children = new Framework.Graphics.Drawable[] Children = new Framework.Graphics.Drawable[]
{ {
new Box new Box
@ -118,7 +122,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
{ {
Children = new [] Children = new []
{ {
new SwellSymbolPiece() symbol = new SwellSymbolPiece()
} }
} }
} }
@ -130,7 +134,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
circlePiece.AccentColour = colours.YellowDark; circlePiece.AccentColour = colours.YellowDark;
innerRing.Colour = colours.YellowDark; expandingRing.Colour = colours.YellowLight;
targetRing.BorderColour = colours.YellowDark.Opacity(0.25f); targetRing.BorderColour = colours.YellowDark.Opacity(0.25f);
} }
@ -140,9 +144,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
{ {
userHits++; userHits++;
innerRing.FadeTo(1); var completion = (float)userHits / swell.RequiredHits;
innerRing.FadeTo(inner_ring_alpha, 500, EasingTypes.OutQuint);
innerRing.ScaleTo(1f + (target_ring_scale - 1) * userHits / swell.RequiredHits, 1200, EasingTypes.OutElastic); expandingRing.FadeTo(expandingRing.Alpha + MathHelper.Clamp(completion / 16, 0.1f, 0.6f), 50);
expandingRing.Delay(50);
expandingRing.FadeTo(completion / 8, 2000, EasingTypes.OutQuint);
expandingRing.DelayReset();
symbol.RotateTo((float)(completion * swell.Duration / 8), 4000, EasingTypes.OutQuint);
expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, EasingTypes.OutQuint);
if (userHits == swell.RequiredHits) if (userHits == swell.RequiredHits)
{ {
@ -168,23 +179,26 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
const float preempt = 300; const float preempt = 100;
Delay(HitObject.StartTime - Time.Current - preempt, true); Delay(HitObject.StartTime - Time.Current - preempt, true);
targetRing.ScaleTo(target_ring_scale, preempt, EasingTypes.Out); targetRing.ScaleTo(target_ring_scale, preempt * 4, EasingTypes.OutQuint);
Delay(preempt, true); Delay(preempt, true);
Delay(Judgement.TimeOffset + swell.Duration, true); Delay(Judgement.TimeOffset + swell.Duration, true);
const float out_transition_time = 300;
switch (state) switch (state)
{ {
case ArmedState.Hit: case ArmedState.Hit:
bodyContainer.ScaleTo(1.2f, 400, EasingTypes.OutQuad); bodyContainer.ScaleTo(1.4f, out_transition_time);
break; break;
} }
FadeOut(600); FadeOut(out_transition_time, EasingTypes.Out);
Expire(); Expire();
} }