mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Used integer types to store combo values
This commit is contained in:
parent
578cacc194
commit
c48a7c0072
@ -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(),
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user