From 660f44d4544b5c86cde808096c123fa9397d684e Mon Sep 17 00:00:00 2001 From: Badewanne3 <41148446+MaxOhn@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:56:48 +0100 Subject: [PATCH] fix: consider slider acc instead of classic mod (#46) --- src/model/mods.rs | 1 - src/osu/performance/mod.rs | 27 +++++++++++++-------------- src/osu/score_state.rs | 12 ++++++------ 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/model/mods.rs b/src/model/mods.rs index e5c0d30e..4bc62a9a 100644 --- a/src/model/mods.rs +++ b/src/model/mods.rs @@ -306,7 +306,6 @@ impl_has_mod! { fl: + Flashlight ["Flashlight"], so: + SpunOut ["SpunOut"], bl: - Blinds ["Blinds"], - cl: - Classic ["Classic"], tc: - Traceable ["Traceable"], } diff --git a/src/osu/performance/mod.rs b/src/osu/performance/mod.rs index 71cd297a..e4cd8156 100644 --- a/src/osu/performance/mod.rs +++ b/src/osu/performance/mod.rs @@ -371,13 +371,13 @@ impl<'map> OsuPerformance<'map> { let mut n100 = self.n100.map_or(0, |n| cmp::min(n, n_remaining)); let mut n50 = self.n50.map_or(0, |n| cmp::min(n, n_remaining)); - let classic = self.difficulty.get_mods().cl(); let lazer = self.difficulty.get_lazer(); + let using_classic_slider_acc = self.difficulty.get_mods().no_slider_head_acc(lazer); - let (origin, slider_end_hits, large_tick_hits) = match (lazer, classic) { + let (origin, slider_end_hits, large_tick_hits) = match (lazer, using_classic_slider_acc) { (false, _) => (OsuScoreOrigin::Stable, 0, 0), (true, false) => { - let origin = OsuScoreOrigin::LazerWithoutClassic { + let origin = OsuScoreOrigin::WithSliderAcc { max_large_ticks: attrs.n_slider_ticks, max_slider_ends: attrs.n_sliders, }; @@ -393,7 +393,7 @@ impl<'map> OsuPerformance<'map> { (origin, slider_end_hits, large_tick_hits) } (true, true) => { - let origin = OsuScoreOrigin::LazerWithClassic { + let origin = OsuScoreOrigin::WithoutSliderAcc { max_large_ticks: attrs.n_sliders + attrs.n_slider_ticks, max_slider_ends: attrs.n_sliders, }; @@ -414,14 +414,14 @@ impl<'map> OsuPerformance<'map> { let (slider_acc_value, max_slider_acc_value) = match origin { OsuScoreOrigin::Stable => (0, 0), - OsuScoreOrigin::LazerWithoutClassic { + OsuScoreOrigin::WithSliderAcc { max_large_ticks, max_slider_ends, } => ( 150 * slider_end_hits + 30 * large_tick_hits, 150 * max_slider_ends + 30 * max_large_ticks, ), - OsuScoreOrigin::LazerWithClassic { + OsuScoreOrigin::WithoutSliderAcc { max_large_ticks, max_slider_ends, } => ( @@ -656,7 +656,6 @@ impl<'map> OsuPerformance<'map> { let mods = self.difficulty.get_mods(); let lazer = self.difficulty.get_lazer(); - let classic = mods.cl(); let using_classic_slider_acc = mods.no_slider_head_acc(lazer); let mut effective_miss_count = f64::from(state.misses); @@ -693,13 +692,13 @@ impl<'map> OsuPerformance<'map> { effective_miss_count = effective_miss_count.max(f64::from(state.misses)); effective_miss_count = effective_miss_count.min(f64::from(state.total_hits())); - let origin = match (lazer, classic) { + let origin = match (lazer, using_classic_slider_acc) { (false, _) => OsuScoreOrigin::Stable, - (true, false) => OsuScoreOrigin::LazerWithoutClassic { + (true, false) => OsuScoreOrigin::WithSliderAcc { max_large_ticks: attrs.n_slider_ticks, max_slider_ends: attrs.n_sliders, }, - (true, true) => OsuScoreOrigin::LazerWithClassic { + (true, true) => OsuScoreOrigin::WithoutSliderAcc { max_large_ticks: attrs.n_sliders + attrs.n_slider_ticks, max_slider_ends: attrs.n_sliders, }, @@ -1133,7 +1132,7 @@ impl NoComboState { match origin { OsuScoreOrigin::Stable => {} - OsuScoreOrigin::LazerWithoutClassic { + OsuScoreOrigin::WithSliderAcc { max_large_ticks, max_slider_ends, } => { @@ -1143,7 +1142,7 @@ impl NoComboState { numerator += 150 * slider_end_hits + 30 * large_tick_hits; denominator += 150 * max_slider_ends + 30 * max_large_ticks; } - OsuScoreOrigin::LazerWithClassic { + OsuScoreOrigin::WithoutSliderAcc { max_large_ticks, max_slider_ends, } => { @@ -1232,7 +1231,7 @@ mod test { let (origin, slider_end_hits, large_tick_hits) = match (lazer, classic) { (false, _) => (OsuScoreOrigin::Stable, 0, 0), (true, false) => { - let origin = OsuScoreOrigin::LazerWithoutClassic { + let origin = OsuScoreOrigin::WithSliderAcc { max_large_ticks: N_SLIDER_TICKS, max_slider_ends: N_SLIDERS, }; @@ -1245,7 +1244,7 @@ mod test { (origin, slider_end_hits, large_tick_hits) } (true, true) => { - let origin = OsuScoreOrigin::LazerWithClassic { + let origin = OsuScoreOrigin::WithoutSliderAcc { max_large_ticks: N_SLIDERS + N_SLIDER_TICKS, max_slider_ends: N_SLIDERS, }; diff --git a/src/osu/score_state.rs b/src/osu/score_state.rs index 63708a84..fd4abbaf 100644 --- a/src/osu/score_state.rs +++ b/src/osu/score_state.rs @@ -53,7 +53,7 @@ impl OsuScoreState { match origin { OsuScoreOrigin::Stable => {} - OsuScoreOrigin::LazerWithoutClassic { + OsuScoreOrigin::WithSliderAcc { max_large_ticks, max_slider_ends, } => { @@ -63,7 +63,7 @@ impl OsuScoreState { numerator += 150 * slider_end_hits + 30 * large_tick_hits; denominator += 150 * max_slider_ends + 30 * max_large_ticks; } - OsuScoreOrigin::LazerWithClassic { + OsuScoreOrigin::WithoutSliderAcc { max_large_ticks, max_slider_ends, } => { @@ -94,13 +94,13 @@ impl Default for OsuScoreState { pub enum OsuScoreOrigin { /// For scores set on osu!stable Stable, - /// For scores set on osu!lazer without the `Classic` mod - LazerWithoutClassic { + /// For scores set on osu!lazer with slider accuracy + WithSliderAcc { max_large_ticks: u32, max_slider_ends: u32, }, - /// For scores set on osu!lazer with the `Classic` mod - LazerWithClassic { + /// For scores set on osu!lazer without slider accuracy + WithoutSliderAcc { max_large_ticks: u32, max_slider_ends: u32, },