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;
|
|
|
|
|
using osu.Game.Modes.Objects;
|
2016-11-25 15:26:50 +08:00
|
|
|
|
using osu.Game.Modes.Objects.Drawables;
|
2017-02-14 17:55:54 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2016-11-19 15:19:26 +08:00
|
|
|
|
|
2016-11-26 15:51:51 +08:00
|
|
|
|
namespace osu.Game.Modes.Osu.Objects.Drawables
|
2016-11-19 15:19:26 +08:00
|
|
|
|
{
|
2016-11-26 15:51:51 +08:00
|
|
|
|
public class DrawableOsuHitObject : DrawableHitObject
|
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
|
|
|
|
|
2016-11-26 15:51:51 +08:00
|
|
|
|
public DrawableOsuHitObject(OsuHitObject hitObject)
|
|
|
|
|
: base(hitObject)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override JudgementInfo CreateJudgementInfo() => new OsuJudgementInfo();
|
|
|
|
|
|
|
|
|
|
protected override void UpdateState(ArmedState state)
|
2016-11-25 15:26:50 +08:00
|
|
|
|
{
|
2016-11-28 17:40:54 +08:00
|
|
|
|
if (!IsLoaded) return;
|
|
|
|
|
|
2016-12-06 23:02:27 +08:00
|
|
|
|
Flush();
|
2016-11-28 17:40:54 +08:00
|
|
|
|
|
|
|
|
|
UpdateInitialState();
|
|
|
|
|
|
2016-11-28 18:42:45 +08:00
|
|
|
|
Delay(HitObject.StartTime - Time.Current - TIME_PREEMPT + Judgement.TimeOffset, true);
|
2016-11-28 17:40:54 +08:00
|
|
|
|
|
|
|
|
|
UpdatePreemptState();
|
|
|
|
|
|
|
|
|
|
Delay(TIME_PREEMPT, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void UpdatePreemptState()
|
|
|
|
|
{
|
|
|
|
|
FadeIn(TIME_FADEIN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void UpdateInitialState()
|
|
|
|
|
{
|
|
|
|
|
Alpha = 0;
|
2016-11-25 15:26:50 +08:00
|
|
|
|
}
|
2016-11-19 15:19:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-26 15:51:51 +08:00
|
|
|
|
public class OsuJudgementInfo : PositionalJudgementInfo
|
2016-11-19 15:19:26 +08:00
|
|
|
|
{
|
2016-11-26 15:51:51 +08:00
|
|
|
|
public OsuScoreResult Score;
|
2016-11-25 15:26:50 +08:00
|
|
|
|
public ComboResult Combo;
|
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,
|
|
|
|
|
}
|
|
|
|
|
}
|