2017-03-20 17:24:28 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// 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-04 11:38:55 +08:00
|
|
|
|
using osu.Game.Modes.Objects.Drawables;
|
|
|
|
|
using osu.Game.Modes.Taiko.Judgements;
|
|
|
|
|
using OpenTK.Input;
|
2017-04-05 09:01:40 +08:00
|
|
|
|
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
|
2017-03-17 18:08:50 +08:00
|
|
|
|
|
2017-04-04 11:38:55 +08:00
|
|
|
|
namespace osu.Game.Modes.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-04-05 09:01:40 +08:00
|
|
|
|
protected override TaikoPiece CreateMainPiece() => new TickPiece
|
|
|
|
|
{
|
|
|
|
|
Filled = HitObject.FirstTick
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement { SecondHit = HitObject.IsStrong };
|
2017-03-17 18:08:50 +08:00
|
|
|
|
|
|
|
|
|
protected override void CheckJudgement(bool userTriggered)
|
|
|
|
|
{
|
|
|
|
|
if (!userTriggered)
|
|
|
|
|
{
|
2017-04-05 09:01:40 +08:00
|
|
|
|
if (Judgement.TimeOffset > HitObject.HitWindow)
|
2017-03-20 17:07:44 +08:00
|
|
|
|
Judgement.Result = HitResult.Miss;
|
2017-03-17 18:08:50 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-05 09:01:40 +08:00
|
|
|
|
if (Math.Abs(Judgement.TimeOffset) < HitObject.HitWindow)
|
2017-03-17 18:08:50 +08:00
|
|
|
|
{
|
|
|
|
|
Judgement.Result = HitResult.Hit;
|
2017-03-22 00:51:44 +08:00
|
|
|
|
Judgement.TaikoResult = TaikoHitResult.Great;
|
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:
|
2017-04-05 09:01:40 +08:00
|
|
|
|
Content.ScaleTo(0, 100, EasingTypes.OutQuint);
|
2017-03-28 15:49:39 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
2017-03-23 18:43:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-22 00:51:53 +08:00
|
|
|
|
protected override void UpdateScrollPosition(double time)
|
2017-03-17 18:08:50 +08:00
|
|
|
|
{
|
2017-03-28 15:49:39 +08:00
|
|
|
|
// Ticks don't move
|
2017-03-17 18:08:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-25 22:54:50 +08:00
|
|
|
|
protected override bool HandleKeyPress(Key key)
|
2017-03-17 18:08:50 +08:00
|
|
|
|
{
|
2017-03-29 16:57:36 +08:00
|
|
|
|
return Judgement.Result == HitResult.None && UpdateJudgement(true);
|
2017-03-17 18:08:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|