Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: consider slider acc instead of classic mod #46

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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