2016-11-26 15:51:51 +08:00
|
|
|
|
using System;
|
2016-11-19 15:19:26 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using osu.Game.Modes.Objects;
|
2016-11-25 15:26:50 +08:00
|
|
|
|
using osu.Game.Modes.Objects.Drawables;
|
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-11-28 17:40:54 +08:00
|
|
|
|
protected const float TIME_PREEMPT = 600;
|
|
|
|
|
protected const float TIME_FADEIN = 400;
|
|
|
|
|
protected const float TIME_FADEOUT = 500;
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
Flush(true);
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
}
|
|
|
|
|
}
|