Merge pull request #16524 from stanriders/move-td-reduction

Fix touch device difficulty reduction not affecting star rating
This commit is contained in:
Dan Balasescu 2022-09-21 12:51:14 +09:00 committed by GitHub
commit 1e9b60f07f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -44,6 +44,12 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;
if (mods.Any(m => m is OsuModTouchDevice))
{
aimRating = Math.Pow(aimRating, 0.8);
flashlightRating = Math.Pow(flashlightRating, 0.8);
}
if (mods.Any(h => h is OsuModRelax))
{
aimRating *= 0.9;
@ -127,6 +133,7 @@ protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clo
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
{
new OsuModTouchDevice(),
new OsuModDoubleTime(),
new OsuModHalfTime(),
new OsuModEasy(),

View File

@ -88,12 +88,7 @@ protected override PerformanceAttributes CreatePerformanceAttributes(ScoreInfo s
private double computeAimValue(ScoreInfo score, OsuDifficultyAttributes attributes)
{
double rawAim = attributes.AimDifficulty;
if (score.Mods.Any(m => m is OsuModTouchDevice))
rawAim = Math.Pow(rawAim, 0.8);
double aimValue = Math.Pow(5.0 * Math.Max(1.0, rawAim / 0.0675) - 4.0, 3.0) / 100000.0;
double aimValue = Math.Pow(5.0 * Math.Max(1.0, attributes.AimDifficulty / 0.0675) - 4.0, 3.0) / 100000.0;
double lengthBonus = 0.95 + 0.4 * Math.Min(1.0, totalHits / 2000.0) +
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0) * 0.5 : 0.0);
@ -233,12 +228,7 @@ private double computeFlashlightValue(ScoreInfo score, OsuDifficultyAttributes a
if (!score.Mods.Any(h => h is OsuModFlashlight))
return 0.0;
double rawFlashlight = attributes.FlashlightDifficulty;
if (score.Mods.Any(m => m is OsuModTouchDevice))
rawFlashlight = Math.Pow(rawFlashlight, 0.8);
double flashlightValue = Math.Pow(rawFlashlight, 2.0) * 25.0;
double flashlightValue = Math.Pow(attributes.FlashlightDifficulty, 2.0) * 25.0;
// Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
if (effectiveMissCount > 0)