mirror of https://github.com/ppy/osu
Add basic DrawableDrumRollTick (no graphics yet, just input).
This commit is contained in:
parent
1e7511a923
commit
1ede12d847
|
@ -0,0 +1,21 @@
|
|||
namespace osu.Game.Modes.Taiko.Judgements
|
||||
{
|
||||
public class TaikoDrumRollTickJudgementInfo : TaikoJudgementInfo
|
||||
{
|
||||
protected override int ScoreToInt(TaikoScoreResult result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
default:
|
||||
return 0;
|
||||
case TaikoScoreResult.Great:
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
|
||||
protected override int AccuracyScoreToInt(TaikoScoreResult result)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
using OpenTK.Input;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using System;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public class DrawableDrumRollTick : DrawableTaikoHitObject<DrumRollTick>
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of keys which this HitObject will accept. These are the standard Taiko keys for now.
|
||||
/// These should be moved to bindings later.
|
||||
/// </summary>
|
||||
private List<Key> validKeys = new List<Key>(new[] { Key.D, Key.F, Key.J, Key.K });
|
||||
|
||||
public DrawableDrumRollTick(DrumRollTick tick)
|
||||
: base(tick)
|
||||
{
|
||||
}
|
||||
|
||||
protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoDrumRollTickJudgementInfo();
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (Judgement.TimeOffset > HitObject.TickTimeDistance / 2)
|
||||
Judgement.Result = Modes.Objects.Drawables.HitResult.Miss;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Math.Abs(Judgement.TimeOffset) < HitObject.TickTimeDistance / 2)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.Score = TaikoScoreResult.Great;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
// Drum roll ticks shouldn't move
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat)
|
||||
return false;
|
||||
|
||||
if (Judgement.Result.HasValue)
|
||||
return false;
|
||||
|
||||
if (!validKeys.Contains(args.Key))
|
||||
return false;
|
||||
|
||||
return UpdateJudgement(true);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -49,8 +49,10 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="Beatmaps\TaikoBeatmapConverter.cs" />
|
||||
<Compile Include="Beatmaps\TaikoBeatmapProcessor.cs" />
|
||||
<Compile Include="Judgements\TaikoDrumRollTickJudgementInfo.cs" />
|
||||
<Compile Include="Judgements\TaikoJudgementInfo.cs" />
|
||||
<Compile Include="Judgements\TaikoScoreResult.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableDrumRollTick.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
|
||||
<Compile Include="Objects\DrumRoll.cs" />
|
||||
<Compile Include="Objects\DrumRollTick.cs" />
|
||||
|
|
Loading…
Reference in New Issue