mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
A bit more protection.
This commit is contained in:
@ -25,41 +25,33 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Velocity of the drum roll in positional length units per millisecond.
|
/// Velocity of the drum roll in positional length units per millisecond.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Velocity;
|
public double Velocity { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The distance between ticks of this drumroll.
|
/// The distance between ticks of this drumroll.
|
||||||
/// <para>Half of this value is the hit window of the ticks.</para>
|
/// <para>Half of this value is the hit window of the ticks.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double TickTimeDistance;
|
public double TickTimeDistance { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of drum roll ticks required for a "Good" hit.
|
/// Number of drum roll ticks required for a "Good" hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double RequiredGoodHits;
|
public double RequiredGoodHits { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of drum roll ticks required for a "Great" hit.
|
/// Number of drum roll ticks required for a "Great" hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double RequiredGreatHits;
|
public double RequiredGreatHits { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Total number of drum roll ticks.
|
/// Total number of drum roll ticks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TotalTicks;
|
public int TotalTicks => Ticks.Count();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes the drum roll ticks if not initialized and returns them.
|
/// Initializes the drum roll ticks if not initialized and returns them.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<DrumRollTick> Ticks
|
public IEnumerable<DrumRollTick> Ticks => ticks ?? (ticks = createTicks());
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (ticks == null)
|
|
||||||
createTicks();
|
|
||||||
return ticks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<DrumRollTick> ticks;
|
private List<DrumRollTick> ticks;
|
||||||
|
|
||||||
@ -75,22 +67,21 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
else
|
else
|
||||||
TickTimeDistance /= 4;
|
TickTimeDistance /= 4;
|
||||||
|
|
||||||
TotalTicks = Ticks.Count();
|
|
||||||
RequiredGoodHits = TotalTicks * Math.Min(0.15, 0.05 + 0.10 / 6 * difficulty.OverallDifficulty);
|
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);
|
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)
|
if (TickTimeDistance == 0)
|
||||||
return;
|
return ret;
|
||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (double t = StartTime; t < EndTime + (int)TickTimeDistance; t += TickTimeDistance)
|
for (double t = StartTime; t < EndTime + (int)TickTimeDistance; t += TickTimeDistance)
|
||||||
{
|
{
|
||||||
ticks.Add(new DrumRollTick
|
ret.Add(new DrumRollTick
|
||||||
{
|
{
|
||||||
FirstTick = first,
|
FirstTick = first,
|
||||||
PreEmpt = PreEmpt,
|
PreEmpt = PreEmpt,
|
||||||
@ -105,6 +96,8 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
|
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user