port akatsuki autopilot changes
This commit is contained in:
@@ -230,6 +230,7 @@ impl_has_mod! {
|
||||
dt: + DoubleTime ["DoubleTime"],
|
||||
nc: + Nightcore ["Nightcore"],
|
||||
ht: + HalfTime ["HalfTime"],
|
||||
ap: + Autopilot ["Autopilot"],
|
||||
bl: - Blinds ["Blinds"],
|
||||
cl: - Classic ["Classic"],
|
||||
tc: - Traceable ["Traceable"],
|
||||
|
||||
@@ -183,6 +183,11 @@ impl DifficultyValues {
|
||||
flashlight_rating *= 0.7;
|
||||
}
|
||||
|
||||
if mods.ap() {
|
||||
aim_rating = 0.0;
|
||||
flashlight_rating *= 0.4;
|
||||
}
|
||||
|
||||
let base_aim_performance = OsuStrainSkill::difficulty_to_performance(aim_rating);
|
||||
let base_speed_performance = OsuStrainSkill::difficulty_to_performance(speed_rating);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ impl OsuSkills {
|
||||
|
||||
let aim = Aim::new(true);
|
||||
let aim_no_sliders = Aim::new(false);
|
||||
let speed = Speed::new(hit_window);
|
||||
let speed = Speed::new(hit_window, mods);
|
||||
let flashlight = Flashlight::new(mods, scaling_factor.radius, time_preempt, time_fade_in);
|
||||
|
||||
Self {
|
||||
|
||||
@@ -10,6 +10,7 @@ use crate::{
|
||||
},
|
||||
osu::difficulty::object::OsuDifficultyObject,
|
||||
util::strains_vec::StrainsVec,
|
||||
GameMods,
|
||||
};
|
||||
|
||||
use super::strain::{DifficultyValue, OsuStrainSkill, UsedOsuStrainSkills};
|
||||
@@ -24,15 +25,17 @@ pub struct Speed {
|
||||
curr_strain: f64,
|
||||
curr_rhythm: f64,
|
||||
hit_window: f64,
|
||||
has_autopilot_mod: bool,
|
||||
inner: OsuStrainSkill,
|
||||
}
|
||||
|
||||
impl Speed {
|
||||
pub fn new(hit_window: f64) -> Self {
|
||||
pub fn new(hit_window: f64, mods: &GameMods) -> Self {
|
||||
Self {
|
||||
curr_strain: 0.0,
|
||||
curr_rhythm: 0.0,
|
||||
hit_window,
|
||||
has_autopilot_mod: mods.ap(),
|
||||
inner: OsuStrainSkill::default(),
|
||||
}
|
||||
}
|
||||
@@ -123,9 +126,12 @@ impl<'a> Skill<'a, Speed> {
|
||||
|
||||
fn strain_value_at(&mut self, curr: &'a OsuDifficultyObject<'a>) -> f64 {
|
||||
self.inner.curr_strain *= strain_decay(curr.strain_time, STRAIN_DECAY_BASE);
|
||||
self.inner.curr_strain +=
|
||||
SpeedEvaluator::evaluate_diff_of(curr, self.diff_objects, self.inner.hit_window)
|
||||
* SKILL_MULTIPLIER;
|
||||
self.inner.curr_strain += SpeedEvaluator::evaluate_diff_of(
|
||||
curr,
|
||||
self.diff_objects,
|
||||
self.inner.hit_window,
|
||||
self.inner.has_autopilot_mod,
|
||||
) * SKILL_MULTIPLIER;
|
||||
self.inner.curr_rhythm =
|
||||
RhythmEvaluator::evaluate_diff_of(curr, self.diff_objects, self.inner.hit_window);
|
||||
|
||||
@@ -148,6 +154,7 @@ impl SpeedEvaluator {
|
||||
curr: &'a OsuDifficultyObject<'a>,
|
||||
diff_objects: &'a [OsuDifficultyObject<'a>],
|
||||
hit_window: f64,
|
||||
has_autopilot_mod: bool,
|
||||
) -> f64 {
|
||||
if curr.base.is_spinner() {
|
||||
return 0.0;
|
||||
@@ -179,7 +186,11 @@ impl SpeedEvaluator {
|
||||
};
|
||||
|
||||
let travel_dist = osu_prev_obj.map_or(0.0, |obj| obj.travel_dist);
|
||||
let mut dist = travel_dist + osu_curr_obj.min_jump_dist;
|
||||
let mut dist = if has_autopilot_mod {
|
||||
0.0
|
||||
} else {
|
||||
Self::SINGLE_SPACING_THRESHOLD.min(travel_dist + osu_curr_obj.min_jump_dist)
|
||||
};
|
||||
|
||||
// * Cap distance at single_spacing_threshold
|
||||
dist = Self::SINGLE_SPACING_THRESHOLD.min(dist);
|
||||
|
||||
@@ -824,6 +824,10 @@ impl OsuPerformanceInner<'_> {
|
||||
}
|
||||
|
||||
fn compute_aim_value(&self) -> f64 {
|
||||
if self.mods.ap() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
let mut aim_value = OsuStrainSkill::difficulty_to_performance(self.attrs.aim);
|
||||
|
||||
let total_hits = self.total_hits();
|
||||
@@ -922,7 +926,9 @@ impl OsuPerformanceInner<'_> {
|
||||
);
|
||||
}
|
||||
|
||||
let ar_factor = if self.attrs.ar > 10.33 {
|
||||
let ar_factor = if self.mods.ap() {
|
||||
0.0
|
||||
} else if self.attrs.ar > 10.33 {
|
||||
0.3 * (self.attrs.ar - 10.33)
|
||||
} else {
|
||||
0.0
|
||||
|
||||
Reference in New Issue
Block a user