From e9ddf232f0141bb136ebafb5f9af0383befdb840 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 31 Jan 2019 11:51:40 +0900 Subject: [PATCH 1/2] Add touchdevice mod to performance calculation --- .../Difficulty/OsuPerformanceCalculator.cs | 7 ++++++- osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs | 14 ++++++++++++++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index 83deac78a1..13a21c5c55 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -88,7 +88,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty private double computeAimValue() { - double aimValue = Math.Pow(5.0f * Math.Max(1.0f, Attributes.AimStrain / 0.0675f) - 4.0f, 3.0f) / 100000.0f; + double rawAim = Attributes.AimStrain; + + if (mods.Any(m => m is OsuModTouchDevice)) + rawAim = Math.Pow(rawAim, 0.8); + + double aimValue = Math.Pow(5.0f * Math.Max(1.0f, rawAim / 0.0675f) - 4.0f, 3.0f) / 100000.0f; // Longer maps are worth more double lengthBonus = 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) + diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs new file mode 100644 index 0000000000..7c476a49c0 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs @@ -0,0 +1,14 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModTouchDevice : Mod + { + public override string Name => "Touch Device"; + public override string Acronym => "TD"; + public override double ScoreMultiplier => 1; + } +} diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 9415adc411..12d0a28a8f 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -82,6 +82,9 @@ namespace osu.Game.Rulesets.Osu if (mods.HasFlag(LegacyMods.Target)) yield return new OsuModTarget(); + + if (mods.HasFlag(LegacyMods.TouchDevice)) + yield return new OsuModTouchDevice(); } public override IEnumerable GetModsFor(ModType type) From 581544e1d641b44263172509bf5a6cec490c9f46 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 31 Jan 2019 11:59:36 +0900 Subject: [PATCH 2/2] Fix TD mod not being ranked --- osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs index 7c476a49c0..571756d056 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs @@ -10,5 +10,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override string Name => "Touch Device"; public override string Acronym => "TD"; public override double ScoreMultiplier => 1; + + public override bool Ranked => true; } }