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

Delete util functions from rulesets

This commit is contained in:
Givikap120 2023-11-09 18:23:53 +02:00
parent d0b2b4f7b9
commit e451b2197c
4 changed files with 26 additions and 26 deletions

View File

@ -233,15 +233,15 @@ namespace osu.Game.Rulesets.Catch
};
}
public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5);
public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5));
public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate);
public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate)
{
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty);
adjustedDifficulty.ApproachRate = ChangeArFromRate(adjustedDifficulty.ApproachRate, rate);
double preempt = adjustedDifficulty.ApproachRate < 5 ?
(1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) :
(1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5);
preempt /= rate;
adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5));
return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
}

View File

@ -428,18 +428,18 @@ namespace osu.Game.Rulesets.Mania
public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection();
public double HitwindowFromOd(float OD) => 64.0 - 3 * OD;
public float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3;
public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate);
// Mania doesn't have rate-adjusted attributes anymore?
public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate)
{
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty);
//public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate)
//{
// BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty);
adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate);
// double hitwindow = 64.0 - 3 * adjustedDifficulty.OverallDifficulty;
// hitwindow /= rate;
// adjustedDifficulty.OverallDifficulty = (float)(64.0 - hitwindow) / 3;
return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
}
// return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
//}
}

View File

@ -329,18 +329,19 @@ namespace osu.Game.Rulesets.Osu
public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection();
public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5);
public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5));
public double HitwindowFromOd(float OD) => 80.0 - 6 * OD;
public float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6;
public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate);
public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate);
public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate)
{
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty);
adjustedDifficulty.ApproachRate = ChangeArFromRate(adjustedDifficulty.ApproachRate, rate);
adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate);
double preempt = adjustedDifficulty.ApproachRate < 5 ?
(1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) :
(1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5);
preempt /= rate;
adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5));
double hitwindow = 80.0 - 6 * adjustedDifficulty.OverallDifficulty;
hitwindow /= rate;
adjustedDifficulty.OverallDifficulty = (float)(80.0 - hitwindow) / 6;
return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
}

View File

@ -263,15 +263,14 @@ namespace osu.Game.Rulesets.Taiko
}), true)
};
}
public double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5;
public float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5);
public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate);
public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate)
{
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty);
adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate);
double hitwindow = 35.0 - 15.0 * (adjustedDifficulty.OverallDifficulty - 5) / 5;
hitwindow /= rate;
adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitwindow) / 15 + 5);
return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty;
}