From c7ee737fef8b31e3aa657571450471e7cc805d8f Mon Sep 17 00:00:00 2001 From: maxicarlos08 Date: Thu, 23 Nov 2023 16:41:50 +0100 Subject: [PATCH 1/4] Add hit_timing to BasicMelee --- assets/common/abilities/adlet/hunter/stab.ron | 1 + assets/common/abilities/adlet/icepicker/spike.ron | 1 + assets/common/abilities/custom/beastclaws/basic.ron | 1 + assets/common/abilities/custom/claygolem/strike.ron | 1 + assets/common/abilities/custom/coralgolem/spin.ron | 1 + assets/common/abilities/custom/coralgolem/strike.ron | 1 + .../custom/dwarves/flamekeeper/flamecrush.ron | 1 + assets/common/abilities/custom/gigas_frost/bonk.ron | 1 + assets/common/abilities/custom/gigas_frost/cleave.ron | 3 ++- .../abilities/custom/gigas_frost/wide_cleave.ron | 3 ++- assets/common/abilities/custom/harvester/scythe.ron | 1 + assets/common/abilities/custom/mandragora/basic.ron | 1 + assets/common/abilities/custom/mandragora/scream.ron | 3 ++- .../abilities/custom/minotaur/cripplingstrike.ron | 1 + assets/common/abilities/custom/quadmedhoof/basic.ron | 1 + assets/common/abilities/custom/stonegolemfist/spin.ron | 1 + assets/common/abilities/custom/tidalwarrior/pincer.ron | 1 + assets/common/abilities/custom/tursus/tursus_claws.ron | 1 + assets/common/abilities/custom/woodgolem/spin.ron | 1 + assets/common/abilities/custom/woodgolem/strike.ron | 1 + assets/common/abilities/custom/yeti/strike.ron | 1 + assets/common/abilities/dagger/tempbasic.ron | 1 + assets/common/abilities/empty/basic.ron | 1 + assets/common/abilities/farming/basic.ron | 1 + assets/common/abilities/gnarling/axe/chop.ron | 1 + .../abilities/gnarling/chieftain/flamestrike.ron | 1 + assets/common/abilities/gnarling/dagger/stab.ron | 1 + assets/common/abilities/pick/swing.ron | 1 + assets/common/abilities/shield/tempbasic.ron | 1 + assets/common/abilities/shovel/dig.ron | 1 + common/src/comp/ability.rs | 5 +++++ common/src/states/basic_melee.rs | 10 ++++++++-- voxygen/src/audio/sfx/event_mapper/combat/tests.rs | 1 + 33 files changed, 47 insertions(+), 5 deletions(-) diff --git a/assets/common/abilities/adlet/hunter/stab.ron b/assets/common/abilities/adlet/hunter/stab.ron index 472ba9507d..6ad047c682 100644 --- a/assets/common/abilities/adlet/hunter/stab.ron +++ b/assets/common/abilities/adlet/hunter/stab.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.4, swing_duration: 0.2, + hit_timing: 0.8, recover_duration: 0.4, melee_constructor: ( kind: Stab( diff --git a/assets/common/abilities/adlet/icepicker/spike.ron b/assets/common/abilities/adlet/icepicker/spike.ron index 47e415424e..dd0c7d0998 100644 --- a/assets/common/abilities/adlet/icepicker/spike.ron +++ b/assets/common/abilities/adlet/icepicker/spike.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.4, swing_duration: 0.25, + hit_timing: 0.6, recover_duration: 0.45, melee_constructor: ( kind: Stab( diff --git a/assets/common/abilities/custom/beastclaws/basic.ron b/assets/common/abilities/custom/beastclaws/basic.ron index 4829d1aa99..ec8dc8eb12 100644 --- a/assets/common/abilities/custom/beastclaws/basic.ron +++ b/assets/common/abilities/custom/beastclaws/basic.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.5, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 0.5, melee_constructor: ( kind: Slash( diff --git a/assets/common/abilities/custom/claygolem/strike.ron b/assets/common/abilities/custom/claygolem/strike.ron index e49a51ab3a..8300358338 100644 --- a/assets/common/abilities/custom/claygolem/strike.ron +++ b/assets/common/abilities/custom/claygolem/strike.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 1.2, swing_duration: 0.1, + hit_timing: 0.4, recover_duration: 1.0, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/coralgolem/spin.ron b/assets/common/abilities/custom/coralgolem/spin.ron index f4f6052ce9..391cb6dd49 100644 --- a/assets/common/abilities/custom/coralgolem/spin.ron +++ b/assets/common/abilities/custom/coralgolem/spin.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.9, swing_duration: 0.3, + hit_timing: 0.6, recover_duration: 0.6, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/coralgolem/strike.ron b/assets/common/abilities/custom/coralgolem/strike.ron index ed5331673c..6ad615947b 100644 --- a/assets/common/abilities/custom/coralgolem/strike.ron +++ b/assets/common/abilities/custom/coralgolem/strike.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 1.6, swing_duration: 0.1, + hit_timing: 0.6, recover_duration: 1.0, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/dwarves/flamekeeper/flamecrush.ron b/assets/common/abilities/custom/dwarves/flamekeeper/flamecrush.ron index 34e8bbebf1..d66039d52a 100644 --- a/assets/common/abilities/custom/dwarves/flamekeeper/flamecrush.ron +++ b/assets/common/abilities/custom/dwarves/flamekeeper/flamecrush.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.8, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 0.7, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/gigas_frost/bonk.ron b/assets/common/abilities/custom/gigas_frost/bonk.ron index 5d478e6d5f..234c012d59 100644 --- a/assets/common/abilities/custom/gigas_frost/bonk.ron +++ b/assets/common/abilities/custom/gigas_frost/bonk.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.7, swing_duration: 0.15, + hit_timing: 0.7, recover_duration: 0.6, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/gigas_frost/cleave.ron b/assets/common/abilities/custom/gigas_frost/cleave.ron index 14725893fa..5d3dfac0e5 100644 --- a/assets/common/abilities/custom/gigas_frost/cleave.ron +++ b/assets/common/abilities/custom/gigas_frost/cleave.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.5, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 0.7, melee_constructor: ( kind: Slash( @@ -21,4 +22,4 @@ BasicMelee( multi_target: Some(Normal), ), ori_modifier: 0.2, -) \ No newline at end of file +) diff --git a/assets/common/abilities/custom/gigas_frost/wide_cleave.ron b/assets/common/abilities/custom/gigas_frost/wide_cleave.ron index 8164e0d7c9..744d6c5438 100644 --- a/assets/common/abilities/custom/gigas_frost/wide_cleave.ron +++ b/assets/common/abilities/custom/gigas_frost/wide_cleave.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.4, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 0.8, melee_constructor: ( kind: Slash( @@ -21,4 +22,4 @@ BasicMelee( multi_target: Some(Normal), ), ori_modifier: 1.0, -) \ No newline at end of file +) diff --git a/assets/common/abilities/custom/harvester/scythe.ron b/assets/common/abilities/custom/harvester/scythe.ron index 72144f75b3..2a6fd89a72 100644 --- a/assets/common/abilities/custom/harvester/scythe.ron +++ b/assets/common/abilities/custom/harvester/scythe.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.9, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 1.2, melee_constructor: ( kind: Slash( diff --git a/assets/common/abilities/custom/mandragora/basic.ron b/assets/common/abilities/custom/mandragora/basic.ron index 17a7d9ecd7..c1b067bfe1 100644 --- a/assets/common/abilities/custom/mandragora/basic.ron +++ b/assets/common/abilities/custom/mandragora/basic.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.4, swing_duration: 0.05, + hit_timing: 0.8, recover_duration: 0.6, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/mandragora/scream.ron b/assets/common/abilities/custom/mandragora/scream.ron index 2c241324f0..4b0a4c6563 100644 --- a/assets/common/abilities/custom/mandragora/scream.ron +++ b/assets/common/abilities/custom/mandragora/scream.ron @@ -1,7 +1,8 @@ BasicMelee( energy_cost: 0, - buildup_duration: 0.25, + buildup_duration: 0.5, swing_duration: 0.3, + hit_timing: 0.5, recover_duration: 1.0, melee_constructor: ( kind: SonicWave( diff --git a/assets/common/abilities/custom/minotaur/cripplingstrike.ron b/assets/common/abilities/custom/minotaur/cripplingstrike.ron index dcdb6b81aa..c82a6227f3 100644 --- a/assets/common/abilities/custom/minotaur/cripplingstrike.ron +++ b/assets/common/abilities/custom/minotaur/cripplingstrike.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.45, swing_duration: 0.1, + hit_timing: 0.7, recover_duration: 1.2, melee_constructor: ( kind: Slash( diff --git a/assets/common/abilities/custom/quadmedhoof/basic.ron b/assets/common/abilities/custom/quadmedhoof/basic.ron index b96a88ad48..5d404fd965 100644 --- a/assets/common/abilities/custom/quadmedhoof/basic.ron +++ b/assets/common/abilities/custom/quadmedhoof/basic.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 1.15, swing_duration: 0.3, + hit_timing: 0.4, recover_duration: 0.85, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/stonegolemfist/spin.ron b/assets/common/abilities/custom/stonegolemfist/spin.ron index 7f699b374c..c2e1a128d9 100644 --- a/assets/common/abilities/custom/stonegolemfist/spin.ron +++ b/assets/common/abilities/custom/stonegolemfist/spin.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.2, swing_duration: 0.3, + hit_timing: 0.5, recover_duration: 0.1, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/tidalwarrior/pincer.ron b/assets/common/abilities/custom/tidalwarrior/pincer.ron index 90891032df..a4989a279f 100644 --- a/assets/common/abilities/custom/tidalwarrior/pincer.ron +++ b/assets/common/abilities/custom/tidalwarrior/pincer.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.45, swing_duration: 0.1, + hit_timing: 0.3, recover_duration: 1.2, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/tursus/tursus_claws.ron b/assets/common/abilities/custom/tursus/tursus_claws.ron index 4829d1aa99..5006b9fc3c 100644 --- a/assets/common/abilities/custom/tursus/tursus_claws.ron +++ b/assets/common/abilities/custom/tursus/tursus_claws.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.5, swing_duration: 0.1, + hit_timing: 0.4, recover_duration: 0.5, melee_constructor: ( kind: Slash( diff --git a/assets/common/abilities/custom/woodgolem/spin.ron b/assets/common/abilities/custom/woodgolem/spin.ron index 3ff6b35841..6c31acc22a 100644 --- a/assets/common/abilities/custom/woodgolem/spin.ron +++ b/assets/common/abilities/custom/woodgolem/spin.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.9, swing_duration: 0.3, + hit_timing: 0.6, recover_duration: 0.6, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/woodgolem/strike.ron b/assets/common/abilities/custom/woodgolem/strike.ron index ed5331673c..6ad615947b 100644 --- a/assets/common/abilities/custom/woodgolem/strike.ron +++ b/assets/common/abilities/custom/woodgolem/strike.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 1.6, swing_duration: 0.1, + hit_timing: 0.6, recover_duration: 1.0, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/custom/yeti/strike.ron b/assets/common/abilities/custom/yeti/strike.ron index 911bb6f07d..d14132f6f8 100644 --- a/assets/common/abilities/custom/yeti/strike.ron +++ b/assets/common/abilities/custom/yeti/strike.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 1.2, swing_duration: 0.1, + hit_timing: 0.8, recover_duration: 2.0, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/dagger/tempbasic.ron b/assets/common/abilities/dagger/tempbasic.ron index 91c60c050b..e589fa1fff 100644 --- a/assets/common/abilities/dagger/tempbasic.ron +++ b/assets/common/abilities/dagger/tempbasic.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.1, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 0.3, melee_constructor: ( kind: Stab( diff --git a/assets/common/abilities/empty/basic.ron b/assets/common/abilities/empty/basic.ron index c4c9226ad4..5bd29a45d8 100644 --- a/assets/common/abilities/empty/basic.ron +++ b/assets/common/abilities/empty/basic.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.0, swing_duration: 0.1, + hit_timing: 0.0, recover_duration: 0.9, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/farming/basic.ron b/assets/common/abilities/farming/basic.ron index 25fa0ba93b..aa65c8254b 100644 --- a/assets/common/abilities/farming/basic.ron +++ b/assets/common/abilities/farming/basic.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.6, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 0.15, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/gnarling/axe/chop.ron b/assets/common/abilities/gnarling/axe/chop.ron index 079f32e12e..9a5734236c 100644 --- a/assets/common/abilities/gnarling/axe/chop.ron +++ b/assets/common/abilities/gnarling/axe/chop.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.3, swing_duration: 0.05, + hit_timing: 0.8, recover_duration: 0.45, melee_constructor: ( kind: Slash( diff --git a/assets/common/abilities/gnarling/chieftain/flamestrike.ron b/assets/common/abilities/gnarling/chieftain/flamestrike.ron index 13d0f3b7e9..300e4f5e1b 100644 --- a/assets/common/abilities/gnarling/chieftain/flamestrike.ron +++ b/assets/common/abilities/gnarling/chieftain/flamestrike.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.6, swing_duration: 0.1, + hit_timing: 0.5, recover_duration: 0.45, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/gnarling/dagger/stab.ron b/assets/common/abilities/gnarling/dagger/stab.ron index 3435cfcf2c..503ecd8dbc 100644 --- a/assets/common/abilities/gnarling/dagger/stab.ron +++ b/assets/common/abilities/gnarling/dagger/stab.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.15, swing_duration: 0.05, + hit_timing: 0.4, recover_duration: 0.375, melee_constructor: ( kind: Stab( diff --git a/assets/common/abilities/pick/swing.ron b/assets/common/abilities/pick/swing.ron index dd1c02be5c..2766a3b587 100644 --- a/assets/common/abilities/pick/swing.ron +++ b/assets/common/abilities/pick/swing.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.25, swing_duration: 0.05, + hit_timing: 0.5, recover_duration: 0.075, melee_constructor: ( kind: Stab( diff --git a/assets/common/abilities/shield/tempbasic.ron b/assets/common/abilities/shield/tempbasic.ron index 7793bb5b1b..bb79339a46 100644 --- a/assets/common/abilities/shield/tempbasic.ron +++ b/assets/common/abilities/shield/tempbasic.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.1, swing_duration: 0.1, + hit_timing: 0.0, recover_duration: 0.3, melee_constructor: ( kind: Bash( diff --git a/assets/common/abilities/shovel/dig.ron b/assets/common/abilities/shovel/dig.ron index dd1c02be5c..2766a3b587 100644 --- a/assets/common/abilities/shovel/dig.ron +++ b/assets/common/abilities/shovel/dig.ron @@ -2,6 +2,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.25, swing_duration: 0.05, + hit_timing: 0.5, recover_duration: 0.075, melee_constructor: ( kind: Stab( diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index ab5ccb9877..e366d65bb3 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -687,6 +687,7 @@ pub enum CharacterAbility { energy_cost: f32, buildup_duration: f32, swing_duration: f32, + hit_timing: f32, recover_duration: f32, melee_constructor: MeleeConstructor, ori_modifier: f32, @@ -1026,6 +1027,7 @@ impl Default for CharacterAbility { energy_cost: 0.0, buildup_duration: 0.25, swing_duration: 0.25, + hit_timing: 0.0, recover_duration: 0.5, melee_constructor: MeleeConstructor { kind: MeleeConstructorKind::Slash { @@ -1185,6 +1187,7 @@ impl CharacterAbility { ref mut recover_duration, ref mut melee_constructor, ori_modifier: _, + hit_timing: _, meta: _, } => { *buildup_duration /= stats.speed; @@ -2230,6 +2233,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { CharacterAbility::BasicMelee { buildup_duration, swing_duration, + hit_timing, recover_duration, melee_constructor, ori_modifier, @@ -2239,6 +2243,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { static_data: basic_melee::StaticData { buildup_duration: Duration::from_secs_f32(*buildup_duration), swing_duration: Duration::from_secs_f32(*swing_duration), + hit_timing: hit_timing.min(1.0), recover_duration: Duration::from_secs_f32(*recover_duration), melee_constructor: *melee_constructor, ori_modifier: *ori_modifier, diff --git a/common/src/states/basic_melee.rs b/common/src/states/basic_melee.rs index 98e91ea8d2..2996977728 100644 --- a/common/src/states/basic_melee.rs +++ b/common/src/states/basic_melee.rs @@ -23,6 +23,8 @@ pub struct StaticData { pub swing_duration: Duration, /// How long the state has until exiting pub recover_duration: Duration, + /// At what fraction of swing_duration to make the hit + pub hit_timing: f32, /// Used to construct the Melee attack pub melee_constructor: MeleeConstructor, /// Adjusts turning rate during the attack @@ -70,9 +72,13 @@ impl CharacterBehavior for Data { } }, StageSection::Action => { - if !self.exhausted { + if !self.exhausted + && self.timer.as_secs_f32() + >= self.static_data.swing_duration.as_secs_f32() + * self.static_data.hit_timing + { update.character = CharacterState::BasicMelee(Data { - timer: Duration::default(), + timer: tick_attack_or_default(data, self.timer, None), exhausted: true, ..*self }); diff --git a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs index 545ce6508c..6de8f43ecc 100644 --- a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs @@ -74,6 +74,7 @@ fn maps_basic_melee() { static_data: states::basic_melee::StaticData { buildup_duration: Duration::default(), swing_duration: Duration::default(), + hit_timing: 0.0, recover_duration: Duration::default(), melee_constructor: melee::MeleeConstructor { kind: melee::MeleeConstructorKind::Slash { From fc3634aaa894cb6c95aecb6ce793dd6c07eec850 Mon Sep 17 00:00:00 2001 From: maxicarlos08 Date: Thu, 23 Nov 2023 16:42:40 +0100 Subject: [PATCH 2/4] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a7f2c5520..b0a9a4fb98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - A few new commands, `/tether`, `/destroy_tethers`, `/mount` and `/dismount`. - A way to target non-player entities with commands. With rtsim_id: `rtsim@`, with uid: `uid@`. - Shorthand in voxygen for specific entities in commands, some examples `@target`, `@mount`, `@viewpoint`. +- Added hit_timing to BasicMelee abilities ### Changed From d05586f08a563df0ec280f5b1978f05c6eef3312 Mon Sep 17 00:00:00 2001 From: maxicarlos08 Date: Fri, 24 Nov 2023 11:36:22 +0100 Subject: [PATCH 3/4] fix small precision bug --- common/systems/src/melee.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/systems/src/melee.rs b/common/systems/src/melee.rs index 2d44f5e4af..2ee6941f77 100644 --- a/common/systems/src/melee.rs +++ b/common/systems/src/melee.rs @@ -223,7 +223,10 @@ impl<'a> System<'a> for Sys { // Note: Don't use ori.look_vec() here, it leads to incorrect results for wide // angle melee attacks let precision_from_flank = combat::precision_mult_from_flank( - (pos_b.0 - pos.0).try_normalized().unwrap_or(ori.look_vec()), + (pos_b.0 - pos.0) + .with_z(0.0) + .try_normalized() + .unwrap_or(ori.look_vec()), target_ori, ); From 2da97747e5eebb1ffe1dcd6fe95d4f0903e75dfa Mon Sep 17 00:00:00 2001 From: Maxicarlos08 Date: Mon, 27 Nov 2023 21:29:13 +0100 Subject: [PATCH 4/4] Addressed review comments --- common/src/comp/ability.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index e366d65bb3..f74fd70b93 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1027,7 +1027,7 @@ impl Default for CharacterAbility { energy_cost: 0.0, buildup_duration: 0.25, swing_duration: 0.25, - hit_timing: 0.0, + hit_timing: 0.5, recover_duration: 0.5, melee_constructor: MeleeConstructor { kind: MeleeConstructorKind::Slash { @@ -2243,7 +2243,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { static_data: basic_melee::StaticData { buildup_duration: Duration::from_secs_f32(*buildup_duration), swing_duration: Duration::from_secs_f32(*swing_duration), - hit_timing: hit_timing.min(1.0), + hit_timing: hit_timing.clamp(0.0, 1.0), recover_duration: Duration::from_secs_f32(*recover_duration), melee_constructor: *melee_constructor, ori_modifier: *ori_modifier,