From 3b34695dfa7e40bb2f16d38d8826b1a92a023403 Mon Sep 17 00:00:00 2001 From: veliusiidx <33435858+veliusiidx@users.noreply.github.com> Date: Wed, 4 Jan 2023 12:17:41 -0600 Subject: [PATCH] Update GaugeIncrementsAsm.cpp Fixed hard gauge's behavior to accurately reflect how LR2 behaves by adding additional checks for when the gauge goes below 32 and if the total is at a certain value. The changes made are based on https://github.com/exch-bms2/beatoraja/pull/628 --- LR2GAS/GaugeIncrementsAsm.cpp | 102 ++++++++++++++++++++++++++++------ 1 file changed, 84 insertions(+), 18 deletions(-) diff --git a/LR2GAS/GaugeIncrementsAsm.cpp b/LR2GAS/GaugeIncrementsAsm.cpp index 80224e1..56e2a18 100644 --- a/LR2GAS/GaugeIncrementsAsm.cpp +++ b/LR2GAS/GaugeIncrementsAsm.cpp @@ -365,37 +365,93 @@ void GetIncrements::HookIncrements() double GetIncrements::Total() { - if (notesNum < 20) + + double f1; + double f2; + + if (magicNumber >= 240) + { + f1 = 1.0; + } + else if (magicNumber >= 230) + { + f1 = 1.11; + } + else if (magicNumber >= 210) + { + f1 = 1.25; + } + else if (magicNumber >= 200) + { + f1 = 1.5; + } + else if (magicNumber >= 180) + { + f1 = 1.666; + } + else if (magicNumber >= 160) + { + f1 = 2.0; + } + else if (magicNumber >= 150) { - return 10.0; + f1 = 2.5; } - if (notesNum < 30) + else if (magicNumber >= 130) { - return 14.0 - (notesNum / 5.0); + f1 = 3.333; } - if (notesNum < 60) + else if (magicNumber >= 120) { - return 9.0 - (notesNum / 15.0); + f1 = 5.0; } - if (notesNum < 125) + else + { + f1 = 10.0; + } + + + if (notesNum <= 20) { - return 5.0 - ((notesNum - 60.0) / 65.0); + f2 = 10.0; } - if (notesNum < 250) + else if (notesNum < 30) { - return 5.0 - (notesNum / 125.0); + f2 = 14.0 - (notesNum / 5.0); } - if (notesNum < 500) + else if (notesNum < 60) { - return 4.0 - (notesNum / 250.0); + f2 = 9.0 - (notesNum / 15.0); } - if (notesNum < 1000) + else if (notesNum < 125) { - return 3.0 - (notesNum / 500.0); + f2 = 5.0 - ((notesNum - 60.0) / 65.0); } - return 1; + else if (notesNum < 250) + { + f2 = 5.0 - (notesNum / 125.0); + } + else if (notesNum < 500) + { + f2 = 4.0 - (notesNum / 250.0); + } + else if (notesNum < 1000) + { + f2 = 3.0 - (notesNum / 500.0); + } + else + { + f2 = 1.0; + } + + if (f1 > f2) + { + return f1; + } + return f2; } + GaugeIncrements GetIncrements::Easy() { constexpr double easyConst = 1.2; @@ -432,9 +488,19 @@ GaugeIncrements GetIncrements::Hard() result.pgreat = 0.1; result.great = 0.1; result.good = 0.05; - result.mashPoor = total * -2.0; - result.bad = total * -6.0; - result.missPoor = total * -10.0; + if (*hkGauge < 32) + { + result.mashPoor = (total * -2.0) * 0.6; + result.bad = (total * -6.0) * 0.6; + result.missPoor = (total * -10.0) * 0.6; + } + else + { + result.mashPoor = total * -2.0; + result.bad = total * -6.0; + result.missPoor = total * -10.0; + } return result; } +