2022-11-30 07:44:20 +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.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
2022-12-01 02:50:47 +08:00
|
|
|
|
using osu.Framework.Audio.Track;
|
2022-11-30 07:44:20 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2022-12-01 02:50:47 +08:00
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
2022-11-30 07:44:20 +08:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
|
|
|
|
{
|
2022-12-01 02:50:47 +08:00
|
|
|
|
internal partial class LegacyKiaiGlow : BeatSyncedContainer
|
2022-11-30 07:44:20 +08:00
|
|
|
|
{
|
2022-12-01 02:50:47 +08:00
|
|
|
|
private const float colour_compensation = 1.58f;
|
|
|
|
|
|
2022-11-30 07:44:20 +08:00
|
|
|
|
public LegacyKiaiGlow()
|
|
|
|
|
{
|
|
|
|
|
AlwaysPresent = true;
|
|
|
|
|
Alpha = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(ISkinSource skin)
|
|
|
|
|
{
|
|
|
|
|
Child = new Sprite
|
|
|
|
|
{
|
|
|
|
|
Texture = skin.GetTexture("taiko-glow"),
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Anchor = Anchor.Centre,
|
2022-12-01 02:50:47 +08:00
|
|
|
|
Scale = new Vector2(0.7f),
|
|
|
|
|
Colour = new Colour4(255, 228, 0, 255),
|
2022-11-30 07:44:20 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Resolved(CanBeNull = true)]
|
|
|
|
|
private HealthProcessor? healthProcessor { get; set; }
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
|
|
if (healthProcessor != null)
|
|
|
|
|
healthProcessor.NewJudgement += onNewJudgement;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void onNewJudgement(JudgementResult result)
|
|
|
|
|
{
|
|
|
|
|
if (!result.IsHit)
|
|
|
|
|
return;
|
|
|
|
|
|
2022-12-01 02:50:47 +08:00
|
|
|
|
this.ScaleTo(1.2f)
|
|
|
|
|
.Then().ScaleTo(1f, 80, Easing.OutQuad);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
|
|
|
|
|
{
|
|
|
|
|
if (effectPoint.KiaiMode)
|
|
|
|
|
this.FadeTo(colour_compensation, 180);
|
|
|
|
|
else
|
|
|
|
|
this.FadeOut(180);
|
2022-11-30 07:44:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|