mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Fixed "works only for std" problem
1) Now it use AR/OD calculation from Ruleset class 2) Implemented needed functions in each of default rulesets
This commit is contained in:
parent
ed886a4dc3
commit
17b9b1649a
@ -232,5 +232,9 @@ namespace osu.Game.Rulesets.Catch
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
public override double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5);
|
||||
public override float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5;
|
||||
public override float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate);
|
||||
}
|
||||
}
|
||||
|
@ -427,6 +427,10 @@ namespace osu.Game.Rulesets.Mania
|
||||
public override RulesetSetupSection CreateEditorSetupSection() => new ManiaSetupSection();
|
||||
|
||||
public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection();
|
||||
|
||||
public override double HitwindowFromOd(float OD) => 64.0 - 3 * OD;
|
||||
public override float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3;
|
||||
public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate);
|
||||
}
|
||||
|
||||
public enum PlayfieldType
|
||||
|
@ -328,5 +328,12 @@ namespace osu.Game.Rulesets.Osu
|
||||
}
|
||||
|
||||
public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection();
|
||||
|
||||
public override double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5);
|
||||
public override float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5;
|
||||
public override double HitwindowFromOd(float OD) => 80.0 - 6 * OD;
|
||||
public override float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6;
|
||||
public override float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate);
|
||||
public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate);
|
||||
}
|
||||
}
|
||||
|
@ -263,5 +263,8 @@ namespace osu.Game.Rulesets.Taiko
|
||||
}), true)
|
||||
};
|
||||
}
|
||||
public override double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5;
|
||||
public override float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5);
|
||||
public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate);
|
||||
}
|
||||
}
|
||||
|
@ -389,5 +389,13 @@ namespace osu.Game.Rulesets
|
||||
/// Can be overridden to alter the difficulty section to the editor beatmap setup screen.
|
||||
/// </summary>
|
||||
public virtual DifficultySection? CreateEditorDifficultySection() => null;
|
||||
|
||||
public virtual double PreemptFromAr(float AR) => 0;
|
||||
public virtual float ArFromPreempt(double preempt) => 5;
|
||||
public virtual double HitwindowFromOd(float OD) => 0;
|
||||
public virtual float OdFromHitwindow(double hitwindow300) => 0;
|
||||
|
||||
public virtual float ChangeArFromRate(float AR, double rate) => AR;
|
||||
public virtual float ChangeOdFromRate(float OD, double rate) => OD;
|
||||
}
|
||||
}
|
||||
|
@ -133,12 +133,10 @@ namespace osu.Game.Screens.Select.Details
|
||||
foreach (var mod in mods.Value.OfType<ModRateAdjust>())
|
||||
{
|
||||
double speedChange = (float)mod.SpeedChange.Value;
|
||||
Ruleset ruleset = gameRuleset.Value.CreateInstance();
|
||||
|
||||
double preempt = (int)IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450) / speedChange;
|
||||
adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5);
|
||||
|
||||
float hitwindow300 = (80.0f - 6 * adjustedDifficulty.OverallDifficulty) / (float)speedChange;
|
||||
adjustedDifficulty.OverallDifficulty = (80.0f - hitwindow300) / 6;
|
||||
adjustedDifficulty.ApproachRate = ruleset.ChangeArFromRate(adjustedDifficulty.ApproachRate, speedChange);
|
||||
adjustedDifficulty.OverallDifficulty = ruleset.ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, speedChange);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user