changed history length in speed
This commit is contained in:
@@ -88,7 +88,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
|
|||||||
let mut skills = Vec::with_capacity(2 + fl as usize);
|
let mut skills = Vec::with_capacity(2 + fl as usize);
|
||||||
|
|
||||||
skills.push(Skill::new(SkillKind::Aim));
|
skills.push(Skill::new(SkillKind::Aim));
|
||||||
skills.push(Skill::new(SkillKind::Speed));
|
skills.push(Skill::new(SkillKind::speed()));
|
||||||
|
|
||||||
if fl {
|
if fl {
|
||||||
skills.push(Skill::new(SkillKind::flashlight(scaling_factor)));
|
skills.push(Skill::new(SkillKind::flashlight(scaling_factor)));
|
||||||
@@ -208,7 +208,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let mut aim = Skill::new(SkillKind::Aim);
|
let mut aim = Skill::new(SkillKind::Aim);
|
||||||
let mut speed = Skill::new(SkillKind::Speed);
|
let mut speed = Skill::new(SkillKind::speed());
|
||||||
|
|
||||||
let mut prev_prev = None;
|
let mut prev_prev = None;
|
||||||
let mut prev = hit_objects.next().unwrap();
|
let mut prev = hit_objects.next().unwrap();
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ impl Skill {
|
|||||||
match self.kind {
|
match self.kind {
|
||||||
SkillKind::Aim => AIM_SKILL_MULTIPLIER,
|
SkillKind::Aim => AIM_SKILL_MULTIPLIER,
|
||||||
SkillKind::Flashlight { .. } => FLASHLIGHT_SKILL_MULTIPLIER,
|
SkillKind::Flashlight { .. } => FLASHLIGHT_SKILL_MULTIPLIER,
|
||||||
SkillKind::Speed => SPEED_SKILL_MULTIPLIER,
|
SkillKind::Speed { .. } => SPEED_SKILL_MULTIPLIER,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ impl Skill {
|
|||||||
match self.kind {
|
match self.kind {
|
||||||
SkillKind::Aim => AIM_STRAIN_DECAY_BASE,
|
SkillKind::Aim => AIM_STRAIN_DECAY_BASE,
|
||||||
SkillKind::Flashlight { .. } => FLASHLIGHT_STRAIN_DECAY_BASE,
|
SkillKind::Flashlight { .. } => FLASHLIGHT_STRAIN_DECAY_BASE,
|
||||||
SkillKind::Speed => SPEED_STRAIN_DECAY_BASE,
|
SkillKind::Speed { .. } => SPEED_STRAIN_DECAY_BASE,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ impl Skill {
|
|||||||
match self.kind {
|
match self.kind {
|
||||||
SkillKind::Aim => AIM_DECAY_WEIGHT,
|
SkillKind::Aim => AIM_DECAY_WEIGHT,
|
||||||
SkillKind::Flashlight { .. } => FLASHLIGHT_DECAY_WEIGHT,
|
SkillKind::Flashlight { .. } => FLASHLIGHT_DECAY_WEIGHT,
|
||||||
SkillKind::Speed => SPEED_DECAY_WEIGHT,
|
SkillKind::Speed { .. } => SPEED_DECAY_WEIGHT,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ const AIM_REDUCED_SECTION_COUNT: usize = 10;
|
|||||||
const FLASHLIGHT_REDUCED_SECTION_COUNT: usize = 10;
|
const FLASHLIGHT_REDUCED_SECTION_COUNT: usize = 10;
|
||||||
const SPEED_REDUCED_SECTION_COUNT: usize = 5;
|
const SPEED_REDUCED_SECTION_COUNT: usize = 5;
|
||||||
|
|
||||||
|
const FLASHLIGHT_HISTORY_LENGTH: usize = 10;
|
||||||
|
const SPEED_HISTORY_LENGTH: usize = 32;
|
||||||
|
|
||||||
const AIM_DIFFICULTY_MULTIPLIER: f32 = 1.06;
|
const AIM_DIFFICULTY_MULTIPLIER: f32 = 1.06;
|
||||||
const FLASHLIGHT_DIFFICULTY_MULTIPLIER: f32 = 1.06;
|
const FLASHLIGHT_DIFFICULTY_MULTIPLIER: f32 = 1.06;
|
||||||
const SPEED_DIFFICULTY_MULTIPLIER: f32 = 1.04;
|
const SPEED_DIFFICULTY_MULTIPLIER: f32 = 1.04;
|
||||||
@@ -36,22 +39,30 @@ pub(crate) enum SkillKind {
|
|||||||
history: VecDeque<FlashlightHistoryEntry>,
|
history: VecDeque<FlashlightHistoryEntry>,
|
||||||
scaling_factor: f32,
|
scaling_factor: f32,
|
||||||
},
|
},
|
||||||
Speed,
|
Speed {
|
||||||
|
history: VecDeque<()>,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SkillKind {
|
impl SkillKind {
|
||||||
pub(crate) fn flashlight(scaling_factor: f32) -> Self {
|
pub(crate) fn flashlight(scaling_factor: f32) -> Self {
|
||||||
Self::Flashlight {
|
Self::Flashlight {
|
||||||
history: VecDeque::with_capacity(FLASHLIGHT_REDUCED_SECTION_COUNT),
|
history: VecDeque::with_capacity(FLASHLIGHT_HISTORY_LENGTH),
|
||||||
scaling_factor,
|
scaling_factor,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn speed() -> Self {
|
||||||
|
Self::Speed {
|
||||||
|
history: VecDeque::with_capacity(SPEED_HISTORY_LENGTH),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn pre_process(&mut self) {
|
pub(crate) fn pre_process(&mut self) {
|
||||||
match self {
|
match self {
|
||||||
Self::Aim => {}
|
Self::Aim => {}
|
||||||
Self::Flashlight { history, .. } => history.truncate(FLASHLIGHT_REDUCED_SECTION_COUNT),
|
Self::Flashlight { history, .. } => history.truncate(FLASHLIGHT_HISTORY_LENGTH),
|
||||||
Self::Speed => {}
|
Self::Speed { history } => history.truncate(SPEED_HISTORY_LENGTH),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +78,7 @@ impl SkillKind {
|
|||||||
|
|
||||||
history.push_front(entry);
|
history.push_front(entry);
|
||||||
}
|
}
|
||||||
Self::Speed => {}
|
Self::Speed { history } => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +156,7 @@ impl SkillKind {
|
|||||||
|
|
||||||
result * result
|
result * result
|
||||||
}
|
}
|
||||||
Self::Speed => {
|
Self::Speed { history } => {
|
||||||
if current.base.is_spinner() {
|
if current.base.is_spinner() {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
@@ -194,7 +205,7 @@ impl SkillKind {
|
|||||||
) -> f32 {
|
) -> f32 {
|
||||||
match self {
|
match self {
|
||||||
SkillKind::Aim | SkillKind::Flashlight { .. } => current_strain,
|
SkillKind::Aim | SkillKind::Flashlight { .. } => current_strain,
|
||||||
SkillKind::Speed => current_strain * 1.0,
|
SkillKind::Speed { history } => current_strain * 1.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +217,7 @@ impl SkillKind {
|
|||||||
FLASHLIGHT_REDUCED_SECTION_COUNT,
|
FLASHLIGHT_REDUCED_SECTION_COUNT,
|
||||||
FLASHLIGHT_DIFFICULTY_MULTIPLIER,
|
FLASHLIGHT_DIFFICULTY_MULTIPLIER,
|
||||||
),
|
),
|
||||||
Self::Speed => (SPEED_REDUCED_SECTION_COUNT, SPEED_DIFFICULTY_MULTIPLIER),
|
Self::Speed { .. } => (SPEED_REDUCED_SECTION_COUNT, SPEED_DIFFICULTY_MULTIPLIER),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user