2017-02-07 12:59:30 +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
|
2016-12-06 17:54:32 +08:00
|
|
|
|
|
2016-11-19 15:19:26 +08:00
|
|
|
|
using System.ComponentModel;
|
2017-04-18 15:05:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Judgements;
|
2017-07-15 00:18:12 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2016-11-19 15:19:26 +08:00
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
2016-11-19 15:19:26 +08:00
|
|
|
|
{
|
2017-03-23 18:00:18 +08:00
|
|
|
|
public class DrawableOsuHitObject : DrawableHitObject<OsuHitObject, OsuJudgement>
|
2016-11-19 15:19:26 +08:00
|
|
|
|
{
|
2016-12-06 17:54:32 +08:00
|
|
|
|
public const float TIME_PREEMPT = 600;
|
|
|
|
|
public const float TIME_FADEIN = 400;
|
|
|
|
|
public const float TIME_FADEOUT = 500;
|
2016-11-28 17:40:54 +08:00
|
|
|
|
|
2017-03-23 14:37:16 +08:00
|
|
|
|
protected DrawableOsuHitObject(OsuHitObject hitObject)
|
2016-11-26 15:51:51 +08:00
|
|
|
|
: base(hitObject)
|
|
|
|
|
{
|
2017-03-23 14:37:16 +08:00
|
|
|
|
AccentColour = HitObject.ComboColour;
|
2017-07-10 06:01:25 +08:00
|
|
|
|
Alpha = 0;
|
2016-11-26 15:51:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-23 18:00:18 +08:00
|
|
|
|
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.Hit300 };
|
2016-11-26 15:51:51 +08:00
|
|
|
|
|
2017-04-28 12:27:20 +08:00
|
|
|
|
protected sealed override void UpdateState(ArmedState state)
|
2016-11-25 15:26:50 +08:00
|
|
|
|
{
|
2017-07-21 23:24:09 +08:00
|
|
|
|
FinishTransforms();
|
2016-11-28 17:40:54 +08:00
|
|
|
|
|
2017-04-27 16:37:38 +08:00
|
|
|
|
using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true))
|
|
|
|
|
{
|
2017-07-10 06:01:25 +08:00
|
|
|
|
UpdateInitialState();
|
|
|
|
|
|
2017-04-27 16:37:38 +08:00
|
|
|
|
UpdatePreemptState();
|
2016-11-28 17:40:54 +08:00
|
|
|
|
|
2017-04-27 16:37:38 +08:00
|
|
|
|
using (BeginDelayedSequence(TIME_PREEMPT + Judgement.TimeOffset, true))
|
|
|
|
|
UpdateCurrentState(state);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-28 17:40:54 +08:00
|
|
|
|
|
2017-07-10 06:01:25 +08:00
|
|
|
|
protected virtual void UpdateInitialState()
|
2017-04-27 16:37:38 +08:00
|
|
|
|
{
|
2017-07-10 06:01:25 +08:00
|
|
|
|
Hide();
|
2016-11-28 17:40:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void UpdatePreemptState()
|
|
|
|
|
{
|
2017-07-15 00:18:12 +08:00
|
|
|
|
this.FadeIn(TIME_FADEIN);
|
2016-11-28 17:40:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-10 06:01:25 +08:00
|
|
|
|
protected virtual void UpdateCurrentState(ArmedState state)
|
2016-11-28 17:40:54 +08:00
|
|
|
|
{
|
2016-11-25 15:26:50 +08:00
|
|
|
|
}
|
2016-11-19 15:19:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-25 15:26:50 +08:00
|
|
|
|
public enum ComboResult
|
2016-11-19 15:19:26 +08:00
|
|
|
|
{
|
|
|
|
|
[Description(@"")]
|
|
|
|
|
None,
|
|
|
|
|
[Description(@"Good")]
|
|
|
|
|
Good,
|
|
|
|
|
[Description(@"Amazing")]
|
|
|
|
|
Perfect
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-26 15:51:51 +08:00
|
|
|
|
public enum OsuScoreResult
|
2016-11-19 15:19:26 +08:00
|
|
|
|
{
|
|
|
|
|
[Description(@"Miss")]
|
|
|
|
|
Miss,
|
|
|
|
|
[Description(@"50")]
|
|
|
|
|
Hit50,
|
|
|
|
|
[Description(@"100")]
|
|
|
|
|
Hit100,
|
|
|
|
|
[Description(@"300")]
|
|
|
|
|
Hit300,
|
2017-02-16 16:02:36 +08:00
|
|
|
|
[Description(@"10")]
|
|
|
|
|
SliderTick
|
2016-11-19 15:19:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|