added rhythm multiplier for strain sections
This commit is contained in:
@@ -56,11 +56,20 @@ impl Skill {
|
|||||||
self.kind.pre_process();
|
self.kind.pre_process();
|
||||||
self.current_strain *= self.strain_decay(current.delta);
|
self.current_strain *= self.strain_decay(current.delta);
|
||||||
self.current_strain += self.kind.strain_value_of(¤t) * self.skill_multiplier();
|
self.current_strain += self.kind.strain_value_of(¤t) * self.skill_multiplier();
|
||||||
self.current_section_peak = self.current_section_peak.max(self.current_strain);
|
|
||||||
|
self.current_section_peak = self
|
||||||
|
.current_section_peak
|
||||||
|
.max(self.total_current_strain(current));
|
||||||
|
|
||||||
self.prev_time.replace(current.base.time);
|
self.prev_time.replace(current.base.time);
|
||||||
self.kind.post_process(current);
|
self.kind.post_process(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn total_current_strain(&self, current: &DifficultyObject) -> f32 {
|
||||||
|
self.kind.total_current_strain(self.current_strain, current)
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn difficulty_value(&mut self) -> f32 {
|
pub(crate) fn difficulty_value(&mut self) -> f32 {
|
||||||
let mut difficulty = 0.0;
|
let mut difficulty = 0.0;
|
||||||
let mut weight = 1.0;
|
let mut weight = 1.0;
|
||||||
|
|||||||
@@ -187,6 +187,17 @@ impl SkillKind {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn total_current_strain(
|
||||||
|
&self,
|
||||||
|
current_strain: f32,
|
||||||
|
_current: &DifficultyObject,
|
||||||
|
) -> f32 {
|
||||||
|
match self {
|
||||||
|
SkillKind::Aim | SkillKind::Flashlight { .. } => current_strain,
|
||||||
|
SkillKind::Speed => current_strain * 1.0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn difficulty_values(&self) -> (usize, f32) {
|
pub(crate) fn difficulty_values(&self) -> (usize, f32) {
|
||||||
match self {
|
match self {
|
||||||
|
|||||||
Reference in New Issue
Block a user