Allow axe combo to reward energy without skillpoint

When the character does not have the Double Strike Combo skill, the
ability's stage_data only contains one element, and thus the
stage_data.len() - 1 expression would set the max_energy_regen to 0.
This change forces the multiplier to 1 in this specific case, so the axe
can still reward energy without the combo skill point, to match the
other weapons.
This commit is contained in:
Ygor Souza 2021-08-03 06:34:36 +02:00
parent a1e22df944
commit 1b5c3883a4
2 changed files with 3 additions and 2 deletions

View File

@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Players no longer spawn underground if their waypoint is underground - Players no longer spawn underground if their waypoint is underground
- Map will now zoom around the cursor's position and drag correctly - Map will now zoom around the cursor's position and drag correctly
- No more jittering while running down slopes with the glider out - No more jittering while running down slopes with the glider out
- Axe normal attack rewards energy without skill points
## [0.10.0] - 2021-06-12 ## [0.10.0] - 2021-06-12

View File

@ -1021,9 +1021,9 @@ impl CharacterAbility {
0 0
}; };
*max_energy_gain = *max_energy_gain *max_energy_gain = *max_energy_gain
* ((energy_level + 1) * stage_data.len() as u16 - 1) as f32 * ((energy_level + 1) * stage_data.len() as u16 - 1).max(1) as f32
/ (Axe(DsRegen).max_level().unwrap() + 1) as f32 / (Axe(DsRegen).max_level().unwrap() + 1) as f32
* (stage_data.len() - 1) as f32; * (stage_data.len() - 1).max(1) as f32;
*scales_from_combo = skillset *scales_from_combo = skillset
.skill_level(Axe(DsDamage)) .skill_level(Axe(DsDamage))
.unwrap_or(None) .unwrap_or(None)