mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 21:03:08 +08:00
Merge pull request #516 from smoogipooo/taiko_bash_drawable
Drawable Bash Implementation (Input only)
This commit is contained in:
commit
d6d19d726b
@ -61,7 +61,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
||||
if (endTimeData != null)
|
||||
{
|
||||
// We compute the end time manually to add in the Bash convert factor
|
||||
return new Bash
|
||||
return new Swell
|
||||
{
|
||||
StartTime = original.StartTime,
|
||||
Sample = original.Sample,
|
||||
|
75
osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs
Normal file
75
osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public class DrawableSwell : DrawableTaikoHitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The amount of times the user has hit this swell.
|
||||
/// </summary>
|
||||
private int userHits;
|
||||
|
||||
private readonly Swell swell;
|
||||
|
||||
public DrawableSwell(Swell swell)
|
||||
: base(swell)
|
||||
{
|
||||
this.swell = swell;
|
||||
}
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
if (userTriggered)
|
||||
{
|
||||
if (Time.Current < HitObject.StartTime)
|
||||
return;
|
||||
|
||||
userHits++;
|
||||
|
||||
if (userHits == swell.RequiredHits)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.TaikoResult = TaikoHitResult.Great;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Judgement.TimeOffset < 0)
|
||||
return;
|
||||
|
||||
if (userHits > swell.RequiredHits / 2)
|
||||
{
|
||||
Judgement.Result = HitResult.Hit;
|
||||
Judgement.TaikoResult = TaikoHitResult.Good;
|
||||
}
|
||||
else
|
||||
Judgement.Result = HitResult.Miss;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void UpdateScrollPosition(double time)
|
||||
{
|
||||
base.UpdateScrollPosition(Math.Min(time, HitObject.StartTime));
|
||||
}
|
||||
|
||||
protected override bool HandleKeyPress(Key key)
|
||||
{
|
||||
if (Judgement.Result.HasValue)
|
||||
return false;
|
||||
|
||||
UpdateJudgement(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ using OpenTK.Input;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Input;
|
||||
|
||||
@ -26,11 +25,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
RelativePositionAxes = Axes.X;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
CreateCircle()
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -73,7 +67,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
// Handle it!
|
||||
return HandleKeyPress(args.Key);
|
||||
}
|
||||
|
||||
protected abstract CirclePiece CreateCircle();
|
||||
}
|
||||
}
|
||||
|
@ -8,14 +8,14 @@ using osu.Game.Modes.Objects.Types;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects
|
||||
{
|
||||
public class Bash : TaikoHitObject, IHasEndTime
|
||||
public class Swell : TaikoHitObject, IHasEndTime
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
/// <summary>
|
||||
/// The number of hits required to complete the bash successfully.
|
||||
/// The number of hits required to complete the swell successfully.
|
||||
/// </summary>
|
||||
public int RequiredHits { get; protected set; }
|
||||
|
@ -165,7 +165,7 @@ namespace osu.Game.Modes.Taiko.Scoring
|
||||
SecondHit = obj.Accented
|
||||
});
|
||||
}
|
||||
else if (obj is Bash)
|
||||
else if (obj is Swell)
|
||||
{
|
||||
AddJudgement(new TaikoJudgement
|
||||
{
|
||||
|
@ -54,12 +54,13 @@
|
||||
<Compile Include="Judgements\TaikoHitResult.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableAccentedHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
|
||||
<Compile Include="Objects\Bash.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\AccentedCirclePiece.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableSwell.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
|
||||
<Compile Include="Objects\DrumRoll.cs" />
|
||||
<Compile Include="Objects\DrumRollTick.cs" />
|
||||
<Compile Include="Objects\Hit.cs" />
|
||||
<Compile Include="Objects\Swell.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\CirclePiece.cs" />
|
||||
<Compile Include="TaikoDifficultyCalculator.cs" />
|
||||
<Compile Include="Objects\TaikoHitObject.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user