fix incorrect difficulty value scaling
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "akatsuki-pp"
|
name = "akatsuki-pp"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
authors = ["MaxOhn <ohn.m@hotmail.de>", "tsunyoku <tsunyoku@gmail.com>"]
|
authors = ["MaxOhn <ohn.m@hotmail.de>", "tsunyoku <tsunyoku@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ pub(crate) struct Aim {
|
|||||||
pub(crate) strain_peaks: Vec<f64>,
|
pub(crate) strain_peaks: Vec<f64>,
|
||||||
with_sliders: bool,
|
with_sliders: bool,
|
||||||
object_strains: Vec<f64>,
|
object_strains: Vec<f64>,
|
||||||
|
difficulty: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Aim {
|
impl Aim {
|
||||||
@@ -26,6 +27,7 @@ impl Aim {
|
|||||||
strain_peaks: Vec::new(),
|
strain_peaks: Vec::new(),
|
||||||
with_sliders,
|
with_sliders,
|
||||||
object_strains: Vec::new(),
|
object_strains: Vec::new(),
|
||||||
|
difficulty: 0.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +103,14 @@ impl OsuStrainSkill for Aim {
|
|||||||
fn strains(&self) -> &Vec<f64> {
|
fn strains(&self) -> &Vec<f64> {
|
||||||
&self.object_strains
|
&self.object_strains
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_raw_difficulty_value(&mut self, value: f64) {
|
||||||
|
self.difficulty = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_raw_difficulty_value(&self) -> f64 {
|
||||||
|
self.difficulty
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct AimEvaluator;
|
struct AimEvaluator;
|
||||||
|
|||||||
@@ -114,6 +114,12 @@ impl OsuStrainSkill for Flashlight {
|
|||||||
fn strains(&self) -> &Vec<f64> {
|
fn strains(&self) -> &Vec<f64> {
|
||||||
HOLDING_VEC
|
HOLDING_VEC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_raw_difficulty_value(&mut self, _value: f64) {}
|
||||||
|
|
||||||
|
fn get_raw_difficulty_value(&self) -> f64 {
|
||||||
|
0.0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FlashlightEvaluator;
|
struct FlashlightEvaluator;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ pub(crate) struct Speed {
|
|||||||
object_strains: Vec<f64>,
|
object_strains: Vec<f64>,
|
||||||
hit_window: f64,
|
hit_window: f64,
|
||||||
mods: u32,
|
mods: u32,
|
||||||
|
difficulty: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Speed {
|
impl Speed {
|
||||||
@@ -30,6 +31,7 @@ impl Speed {
|
|||||||
object_strains: Vec::new(),
|
object_strains: Vec::new(),
|
||||||
hit_window,
|
hit_window,
|
||||||
mods,
|
mods,
|
||||||
|
difficulty: 0.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,6 +127,14 @@ impl OsuStrainSkill for Speed {
|
|||||||
fn strains(&self) -> &Vec<f64> {
|
fn strains(&self) -> &Vec<f64> {
|
||||||
&self.object_strains
|
&self.object_strains
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_raw_difficulty_value(&mut self, value: f64) {
|
||||||
|
self.difficulty = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_raw_difficulty_value(&self) -> f64 {
|
||||||
|
self.difficulty
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SpeedEvaluator;
|
struct SpeedEvaluator;
|
||||||
|
|||||||
@@ -123,13 +123,17 @@ pub(crate) trait OsuStrainSkill: StrainSkill + Sized {
|
|||||||
weight *= Self::DECAY_WEIGHT;
|
weight *= Self::DECAY_WEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.set_raw_difficulty_value(difficulty);
|
||||||
difficulty * Self::DIFFICULTY_MULTIPLER
|
difficulty * Self::DIFFICULTY_MULTIPLER
|
||||||
}
|
}
|
||||||
|
|
||||||
fn strains(&self) -> &Vec<f64>;
|
fn strains(&self) -> &Vec<f64>;
|
||||||
|
|
||||||
|
fn set_raw_difficulty_value(&mut self, value: f64);
|
||||||
|
fn get_raw_difficulty_value(&self) -> f64;
|
||||||
|
|
||||||
fn count_difficult_strains(&mut self) -> f64 {
|
fn count_difficult_strains(&mut self) -> f64 {
|
||||||
let difficulty_value = OsuStrainSkill::difficulty_value(self);
|
let difficulty_value = self.get_raw_difficulty_value();
|
||||||
if difficulty_value == 0.0 {
|
if difficulty_value == 0.0 {
|
||||||
0.0
|
0.0
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user