Used integer types to store combo values

This commit is contained in:
Knightress Paladin 2021-07-21 16:46:14 -07:00
parent 578cacc194
commit c48a7c0072
2 changed files with 5 additions and 4 deletions

View File

@ -1923,7 +1923,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
range: *range,
ability_info,
scales_with_combo: *scales_with_combo,
combo_at_cast: data.combo.counter() as f32,
combo_at_cast: data.combo.counter(),
specifier: *specifier,
},
timer: Duration::default(),

View File

@ -35,7 +35,7 @@ pub struct StaticData {
/// Whether the aura's effect scales with the user's current combo
pub scales_with_combo: bool,
/// Combo at the time the aura is first cast
pub combo_at_cast: f32,
pub combo_at_cast: u32,
/// Used to specify aura to the frontend
pub specifier: Specifier,
}
@ -87,8 +87,9 @@ impl CharacterBehavior for Data {
category: _,
source: _,
} => {
data.strength *=
1.0 + self.static_data.combo_at_cast.max(1.0_f32).log(2.0_f32);
data.strength *= 1.0
+ (std::cmp::max(self.static_data.combo_at_cast, 1) as f32)
.log(2.0);
},
}
update.server_events.push_front(ServerEvent::ComboChange {