2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-03-20 17:24:28 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-03-17 18:08:50 +08:00
|
|
|
|
using System;
|
2017-03-28 15:49:39 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-04-18 15:05:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2017-12-31 04:23:18 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2017-04-18 15:05:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
2017-03-17 18:08:50 +08:00
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
2017-03-17 18:08:50 +08:00
|
|
|
|
{
|
2017-04-05 09:01:40 +08:00
|
|
|
|
public class DrawableDrumRollTick : DrawableTaikoHitObject<DrumRollTick>
|
2017-03-17 18:08:50 +08:00
|
|
|
|
{
|
|
|
|
|
public DrawableDrumRollTick(DrumRollTick tick)
|
|
|
|
|
: base(tick)
|
|
|
|
|
{
|
2017-08-03 12:24:13 +08:00
|
|
|
|
FillMode = FillMode.Fit;
|
2017-03-17 18:08:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-09 19:17:05 +08:00
|
|
|
|
public override bool DisplayJudgement => false;
|
|
|
|
|
|
2017-04-05 09:01:40 +08:00
|
|
|
|
protected override TaikoPiece CreateMainPiece() => new TickPiece
|
|
|
|
|
{
|
|
|
|
|
Filled = HitObject.FirstTick
|
|
|
|
|
};
|
|
|
|
|
|
2017-09-06 16:02:13 +08:00
|
|
|
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
2017-03-17 18:08:50 +08:00
|
|
|
|
{
|
|
|
|
|
if (!userTriggered)
|
|
|
|
|
return;
|
|
|
|
|
|
2017-09-06 16:02:13 +08:00
|
|
|
|
if (!(Math.Abs(timeOffset) < HitObject.HitWindow))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
AddJudgement(new TaikoDrumRollTickJudgement { Result = HitResult.Great });
|
|
|
|
|
if (HitObject.IsStrong)
|
|
|
|
|
AddJudgement(new TaikoStrongHitJudgement());
|
2017-03-17 18:08:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-23 18:43:00 +08:00
|
|
|
|
protected override void UpdateState(ArmedState state)
|
|
|
|
|
{
|
2017-03-28 15:49:39 +08:00
|
|
|
|
switch (state)
|
|
|
|
|
{
|
|
|
|
|
case ArmedState.Hit:
|
2018-03-15 12:41:06 +08:00
|
|
|
|
this.ScaleTo(0, 100, Easing.OutQuint).Expire();
|
2017-03-28 15:49:39 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2017-03-23 18:43:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-09-06 16:02:13 +08:00
|
|
|
|
public override bool OnPressed(TaikoAction action) => UpdateJudgement(true);
|
2017-03-17 18:08:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|