Minor tweaks.

This commit is contained in:
Sam 2020-11-08 18:11:53 -06:00
parent 0618de138e
commit 8fa7e246e9
3 changed files with 11 additions and 59 deletions

View File

@ -208,7 +208,7 @@ impl Tool {
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
max_speed_increase: 1.6,
is_interruptible: true,
},
SpinMelee {
@ -258,7 +258,7 @@ impl Tool {
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
max_speed_increase: 1.4,
is_interruptible: true,
},
ChargedMelee {

View File

@ -98,6 +98,9 @@ impl CharacterBehavior for Data {
}
}
let speed_modifer = 1.0 + self.static_data.max_speed_increase
* (1.0 - self.static_data.speed_increase.powi(self.combo as i32));
match self.stage_section {
StageSection::Buildup => {
if self.timer < self.static_data.stage_data[stage_index].base_buildup_duration {
@ -106,12 +109,7 @@ impl CharacterBehavior for Data {
static_data: self.static_data.clone(),
timer: self
.timer
.checked_add(Duration::from_secs_f32(
(1.0 + self.static_data.max_speed_increase
* (1.0
- self.static_data.speed_increase.powi(self.combo as i32)))
* data.dt.0,
))
.checked_add(Duration::from_secs_f32(data.dt.0 * speed_modifer))
.unwrap_or_default(),
..*self
});
@ -162,12 +160,7 @@ impl CharacterBehavior for Data {
static_data: self.static_data.clone(),
timer: self
.timer
.checked_add(Duration::from_secs_f32(
(1.0 + self.static_data.max_speed_increase
* (1.0
- self.static_data.speed_increase.powi(self.combo as i32)))
* data.dt.0,
))
.checked_add(Duration::from_secs_f32(data.dt.0 * speed_modifer))
.unwrap_or_default(),
..*self
});
@ -190,15 +183,7 @@ impl CharacterBehavior for Data {
static_data: self.static_data.clone(),
timer: self
.timer
.checked_add(Duration::from_secs_f32(
(1.0 + self.static_data.max_speed_increase
* (1.0
- self
.static_data
.speed_increase
.powi(self.combo as i32)))
* data.dt.0,
))
.checked_add(Duration::from_secs_f32(data.dt.0 * speed_modifer))
.unwrap_or_default(),
next_stage: true,
..*self
@ -208,15 +193,7 @@ impl CharacterBehavior for Data {
static_data: self.static_data.clone(),
timer: self
.timer
.checked_add(Duration::from_secs_f32(
(1.0 + self.static_data.max_speed_increase
* (1.0
- self
.static_data
.speed_increase
.powi(self.combo as i32)))
* data.dt.0,
))
.checked_add(Duration::from_secs_f32(data.dt.0 * speed_modifer))
.unwrap_or_default(),
..*self
});

View File

@ -1136,7 +1136,7 @@ impl FigureMgr {
let stage_index = (s.stage - 1) as usize;
let stage_progress = match active_tool_kind {
Some(ToolKind::Sword) => {
Some(_) => {
let stage_time = s.timer.as_secs_f64();
//let stage_progress = match s.stage_section {
match s.stage_section {
@ -1161,32 +1161,7 @@ impl FigureMgr {
_ => 0.0,
}
},
Some(ToolKind::Axe) => {
let stage_time = s.timer.as_secs_f64();
//let stage_progress = match s.stage_section {
match s.stage_section {
StageSection::Buildup => {
stage_time
/ s.static_data.stage_data[stage_index]
.base_buildup_duration
.as_secs_f64()
},
StageSection::Swing => {
stage_time
/ s.static_data.stage_data[stage_index]
.base_swing_duration
.as_secs_f64()
},
StageSection::Recover => {
stage_time
/ s.static_data.stage_data[stage_index]
.base_recover_duration
.as_secs_f64()
},
_ => 0.0,
}
},
_ => state.state_time,
None => state.state_time,
};
match s.stage {
1 => anim::character::AlphaAnimation::update_skeleton(