1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 18:23:04 +08:00

Fix improperly considering rate adjustment mods

This commit is contained in:
Dan Balasescu 2022-02-16 19:50:27 +09:00
parent 1f9892802c
commit a0ee86ddd2
2 changed files with 6 additions and 11 deletions

View File

@ -10,10 +10,10 @@ namespace osu.Game.Rulesets.Mania.Difficulty
public class ManiaDifficultyAttributes : DifficultyAttributes public class ManiaDifficultyAttributes : DifficultyAttributes
{ {
/// <summary> /// <summary>
/// The perceived hit window for a GREAT hit inclusive of rate-adjusting mods (DT/HT/etc). /// The hit window for a GREAT hit inclusive of rate-adjusting mods (DT/HT/etc).
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Rate-adjusting mods don't directly affect the hit window, but have a perceived effect as a result of adjusting audio timing. /// Rate-adjusting mods do not affect the hit window at all in osu-stable.
/// </remarks> /// </remarks>
[JsonProperty("great_hit_window")] [JsonProperty("great_hit_window")]
public double GreatHitWindow { get; set; } public double GreatHitWindow { get; set; }

View File

@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
{ {
StarRating = skills[0].DifficultyValue() * star_scaling_factor, StarRating = skills[0].DifficultyValue() * star_scaling_factor,
Mods = mods, Mods = mods,
GreatHitWindow = Math.Ceiling(getHitWindow300(mods) / clockRate), GreatHitWindow = Math.Ceiling((int)(getHitWindow300(mods) * clockRate) / clockRate),
ScoreMultiplier = getScoreMultiplier(mods), ScoreMultiplier = getScoreMultiplier(mods),
MaxCombo = beatmap.HitObjects.Sum(h => h is HoldNote ? 2 : 1), MaxCombo = beatmap.HitObjects.Sum(h => h is HoldNote ? 2 : 1),
}; };
@ -108,7 +108,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
} }
} }
private int getHitWindow300(Mod[] mods) private double getHitWindow300(Mod[] mods)
{ {
if (isForCurrentRuleset) if (isForCurrentRuleset)
{ {
@ -121,19 +121,14 @@ namespace osu.Game.Rulesets.Mania.Difficulty
return applyModAdjustments(47, mods); return applyModAdjustments(47, mods);
static int applyModAdjustments(double value, Mod[] mods) static double applyModAdjustments(double value, Mod[] mods)
{ {
if (mods.Any(m => m is ManiaModHardRock)) if (mods.Any(m => m is ManiaModHardRock))
value /= 1.4; value /= 1.4;
else if (mods.Any(m => m is ManiaModEasy)) else if (mods.Any(m => m is ManiaModEasy))
value *= 1.4; value *= 1.4;
if (mods.Any(m => m is ManiaModDoubleTime)) return value;
value *= 1.5;
else if (mods.Any(m => m is ManiaModHalfTime))
value *= 0.75;
return (int)value;
} }
} }