mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Moved hit timer to charged melee and adjusted for tail slap
This commit is contained in:
parent
1f59ef92d8
commit
a1aa3efd29
@ -10,5 +10,6 @@ ChargedMelee(
|
||||
speed: 1.0,
|
||||
charge_duration: 1200,
|
||||
swing_duration: 200,
|
||||
hit_timing: 0.5,
|
||||
recover_duration: 300,
|
||||
)
|
||||
|
@ -10,5 +10,6 @@ ChargedMelee(
|
||||
speed: 1.0,
|
||||
charge_duration: 1200,
|
||||
swing_duration: 700,
|
||||
hit_timing: 0.9,
|
||||
recover_duration: 1200,
|
||||
)
|
||||
|
@ -171,6 +171,7 @@ pub enum CharacterAbility {
|
||||
speed: f32,
|
||||
charge_duration: u64,
|
||||
swing_duration: u64,
|
||||
hit_timing: f32,
|
||||
recover_duration: u64,
|
||||
},
|
||||
ChargedRanged {
|
||||
@ -792,6 +793,7 @@ impl From<(&CharacterAbility, AbilityKey)> for CharacterState {
|
||||
speed,
|
||||
charge_duration,
|
||||
swing_duration,
|
||||
hit_timing,
|
||||
recover_duration,
|
||||
range,
|
||||
max_angle,
|
||||
@ -808,6 +810,7 @@ impl From<(&CharacterAbility, AbilityKey)> for CharacterState {
|
||||
max_angle: *max_angle,
|
||||
charge_duration: Duration::from_millis(*charge_duration),
|
||||
swing_duration: Duration::from_millis(*swing_duration),
|
||||
hit_timing: *hit_timing,
|
||||
recover_duration: Duration::from_millis(*recover_duration),
|
||||
ability_key: key,
|
||||
},
|
||||
|
@ -32,6 +32,8 @@ pub struct StaticData {
|
||||
pub charge_duration: Duration,
|
||||
/// How long the weapon is swinging for
|
||||
pub swing_duration: Duration,
|
||||
/// At what fraction of the swing duration to apply the melee "hit"
|
||||
pub hit_timing: f32,
|
||||
/// How long the state has until exiting
|
||||
pub recover_duration: Duration,
|
||||
/// What key is used to press ability
|
||||
@ -131,7 +133,8 @@ impl CharacterBehavior for Data {
|
||||
},
|
||||
StageSection::Swing => {
|
||||
if self.timer.as_millis() as f32
|
||||
> 0.5 * self.static_data.swing_duration.as_millis() as f32
|
||||
> self.static_data.hit_timing
|
||||
* self.static_data.swing_duration.as_millis() as f32
|
||||
&& !self.exhausted
|
||||
{
|
||||
// Swing
|
||||
|
Loading…
Reference in New Issue
Block a user