Skip to content

Commit

Permalink
fix: consider slider acc instead of classic mod (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn authored Nov 19, 2024
1 parent d1f5910 commit 660f44d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/model/mods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ impl_has_mod! {
fl: + Flashlight ["Flashlight"],
so: + SpunOut ["SpunOut"],
bl: - Blinds ["Blinds"],
cl: - Classic ["Classic"],
tc: - Traceable ["Traceable"],
}

Expand Down
27 changes: 13 additions & 14 deletions src/osu/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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,
};
Expand All @@ -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,
} => (
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -1133,7 +1132,7 @@ impl NoComboState {

match origin {
OsuScoreOrigin::Stable => {}
OsuScoreOrigin::LazerWithoutClassic {
OsuScoreOrigin::WithSliderAcc {
max_large_ticks,
max_slider_ends,
} => {
Expand All @@ -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,
} => {
Expand Down Expand Up @@ -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,
};
Expand All @@ -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,
};
Expand Down
12 changes: 6 additions & 6 deletions src/osu/score_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl OsuScoreState {

match origin {
OsuScoreOrigin::Stable => {}
OsuScoreOrigin::LazerWithoutClassic {
OsuScoreOrigin::WithSliderAcc {
max_large_ticks,
max_slider_ends,
} => {
Expand All @@ -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,
} => {
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit 660f44d

Please sign in to comment.