mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Add a way to determine the type of a Hit.
This commit is contained in:
@ -44,7 +44,10 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
IHasRepeats repeatsData = original as IHasRepeats;
|
IHasRepeats repeatsData = original as IHasRepeats;
|
||||||
IHasEndTime endTimeData = original as IHasEndTime;
|
IHasEndTime endTimeData = original as IHasEndTime;
|
||||||
|
|
||||||
bool accented = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0;
|
// Old osu! used hit sounding to determine hits
|
||||||
|
SampleType sample = original.Sample?.Type ?? SampleType.None;
|
||||||
|
|
||||||
|
bool accented = (sample & SampleType.Finish) > 0;
|
||||||
|
|
||||||
if (distanceData != null)
|
if (distanceData != null)
|
||||||
{
|
{
|
||||||
@ -71,11 +74,14 @@ namespace osu.Game.Modes.Taiko.Beatmaps
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HitType type = (sample & ~(SampleType.Finish | SampleType.Normal)) == 0 ? HitType.Centre : HitType.Rim;
|
||||||
|
|
||||||
return new Hit
|
return new Hit
|
||||||
{
|
{
|
||||||
StartTime = original.StartTime,
|
StartTime = original.StartTime,
|
||||||
Sample = original.Sample,
|
Sample = original.Sample,
|
||||||
Accented = accented
|
Accented = accented,
|
||||||
|
Type = type
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,11 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
{
|
{
|
||||||
public class Hit : TaikoHitObject
|
public class Hit : TaikoHitObject
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this hit is a centre-hit or a rim-hit.
|
||||||
|
/// </summary>
|
||||||
|
public HitType Type;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The hit window that results in a "GREAT" hit.
|
/// The hit window that results in a "GREAT" hit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
14
osu.Game.Modes.Taiko/Objects/HitType.cs
Normal file
14
osu.Game.Modes.Taiko/Objects/HitType.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Taiko.Objects
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes whether a hit is a centre-hit or a rim-hit.
|
||||||
|
/// </summary>
|
||||||
|
public enum HitType
|
||||||
|
{
|
||||||
|
Centre,
|
||||||
|
Rim
|
||||||
|
}
|
||||||
|
}
|
@ -58,6 +58,7 @@
|
|||||||
<Compile Include="Objects\DrumRoll.cs" />
|
<Compile Include="Objects\DrumRoll.cs" />
|
||||||
<Compile Include="Objects\DrumRollTick.cs" />
|
<Compile Include="Objects\DrumRollTick.cs" />
|
||||||
<Compile Include="Objects\Hit.cs" />
|
<Compile Include="Objects\Hit.cs" />
|
||||||
|
<Compile Include="Objects\HitType.cs" />
|
||||||
<Compile Include="TaikoDifficultyCalculator.cs" />
|
<Compile Include="TaikoDifficultyCalculator.cs" />
|
||||||
<Compile Include="Objects\TaikoHitObject.cs" />
|
<Compile Include="Objects\TaikoHitObject.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
Reference in New Issue
Block a user