1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 14:12:54 +08:00

A bit more protection.

This commit is contained in:
smoogipooo 2017-03-22 01:33:22 +09:00
parent a346191ca7
commit 712d2e194c

View File

@ -25,41 +25,33 @@ namespace osu.Game.Modes.Taiko.Objects
/// <summary>
/// Velocity of the drum roll in positional length units per millisecond.
/// </summary>
public double Velocity;
public double Velocity { get; protected set; }
/// <summary>
/// The distance between ticks of this drumroll.
/// <para>Half of this value is the hit window of the ticks.</para>
/// </summary>
public double TickTimeDistance;
public double TickTimeDistance { get; protected set; }
/// <summary>
/// Number of drum roll ticks required for a "Good" hit.
/// </summary>
public double RequiredGoodHits;
public double RequiredGoodHits { get; protected set; }
/// <summary>
/// Number of drum roll ticks required for a "Great" hit.
/// </summary>
public double RequiredGreatHits;
public double RequiredGreatHits { get; protected set; }
/// <summary>
/// Total number of drum roll ticks.
/// </summary>
public int TotalTicks;
public int TotalTicks => Ticks.Count();
/// <summary>
/// Initializes the drum roll ticks if not initialized and returns them.
/// </summary>
public IEnumerable<DrumRollTick> Ticks
{
get
{
if (ticks == null)
createTicks();
return ticks;
}
}
public IEnumerable<DrumRollTick> Ticks => ticks ?? (ticks = createTicks());
private List<DrumRollTick> ticks;
@ -75,22 +67,21 @@ namespace osu.Game.Modes.Taiko.Objects
else
TickTimeDistance /= 4;
TotalTicks = Ticks.Count();
RequiredGoodHits = TotalTicks * Math.Min(0.15, 0.05 + 0.10 / 6 * difficulty.OverallDifficulty);
RequiredGreatHits = TotalTicks * Math.Min(0.30, 0.10 + 0.20 / 6 * difficulty.OverallDifficulty);
}
private void createTicks()
private List<DrumRollTick> createTicks()
{
ticks = new List<DrumRollTick>();
var ret = new List<DrumRollTick>();
if (TickTimeDistance == 0)
return;
return ret;
bool first = true;
for (double t = StartTime; t < EndTime + (int)TickTimeDistance; t += TickTimeDistance)
{
ticks.Add(new DrumRollTick
ret.Add(new DrumRollTick
{
FirstTick = first,
PreEmpt = PreEmpt,
@ -105,6 +96,8 @@ namespace osu.Game.Modes.Taiko.Objects
first = false;
}
return ret;
}
}
}