From f65d449aa368aeb9949c8c48e1ed5c94900fde14 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 28 Dec 2023 19:02:10 -0500 Subject: [PATCH] Deprecated combo melee character state --- .../abilities/axesimple/doublestrike.ron | 98 ++-- .../arthropods/antlion/singlestrike.ron | 56 +- .../arthropods/blackwidow/singlestrike.ron | 54 +- .../arthropods/hornbeetle/singlestrike.ron | 44 +- .../arthropods/tarantula/singlestrike.ron | 54 +- .../custom/arthropods/weevil/singlestrike.ron | 42 +- .../abilities/custom/asp/singlestrike.ron | 42 +- .../custom/basilisk/triplestrike.ron | 102 ++-- .../custom/birdmediumbasic/singlestrike.ron | 39 +- .../boreal_warrior/hammer/singlestrike.ron | 59 +- .../abilities/custom/cyclops/doublestrike.ron | 84 +-- .../abilities/custom/dullahan/melee.ron | 96 ++-- .../custom/husk_brute/singlestrike.ron | 39 +- .../custom/maneater/singlestrike.ron | 42 +- .../abilities/custom/oni/doublestrike.ron | 96 ++-- .../custom/quadlowbasic/singlestrike.ron | 42 +- .../custom/quadlowbasic/triplestrike.ron | 102 ++-- .../custom/quadlowbreathe/triplestrike.ron | 102 ++-- .../custom/quadlowquick/quadstrike.ron | 132 +++-- .../custom/quadlowtail/triplestrike.ron | 102 ++-- .../custom/quadmedbasic/singlestrike.ron | 42 +- .../custom/quadmedbasic/triplestrike.ron | 99 ++-- .../custom/quadmedcharge/doublestrike.ron | 72 +-- .../custom/quadmedjump/doublestrike.ron | 72 +-- .../custom/quadmedquick/triplestrike.ron | 102 ++-- .../custom/quadsmallbasic/singlestrike.ron | 39 +- .../abilities/custom/roshwalr/doublehusk.ron | 74 +-- .../custom/simpleflyingmelee/singlestrike.ron | 39 +- .../custom/stonegolemfist/singlestrike.ron | 39 +- .../custom/theropodbasic/singlestrike.ron | 42 +- .../custom/theropodbasic/triplestrike.ron | 102 ++-- .../custom/theropodbird/singlestrike.ron | 42 +- .../custom/theropodbird/triplestrike.ron | 102 ++-- .../custom/theropodsmall/triplestrike.ron | 104 ++-- .../custom/wendigomagic/singlestrike.ron | 39 +- .../abilities/daggersimple/singlestrike.ron | 50 +- .../common/abilities/hammer/singlestrike.ron | 2 +- .../abilities/hammersimple/doublestrike.ron | 72 +-- .../common/abilities/spear/doublestrike.ron | 96 ++-- .../abilities/swordsimple/doublestrike.ron | 96 ++-- assets/voxygen/audio/sfx.ron | 37 +- common/src/comp/ability.rs | 25 +- common/src/comp/character_state.rs | 28 +- common/src/comp/inventory/loadout_builder.rs | 2 +- common/src/states/combo_melee.rs | 14 +- common/src/states/roll.rs | 19 +- common/src/states/utils.rs | 13 +- common/systems/src/stats.rs | 2 +- server/agent/src/attack.rs | 2 +- .../src/arthropod/{alpha.rs => combomelee.rs} | 18 +- voxygen/anim/src/arthropod/mod.rs | 4 +- voxygen/anim/src/biped_large/alpha.rs | 116 +--- voxygen/anim/src/biped_large/beta.rs | 110 +--- voxygen/anim/src/biped_large/combomelee.rs | 114 +++- voxygen/anim/src/biped_large/mod.rs | 265 +++++++++ voxygen/anim/src/biped_small/alpha.rs | 112 +--- voxygen/anim/src/biped_small/combomelee.rs | 86 ++- voxygen/anim/src/biped_small/mod.rs | 121 ++++ voxygen/anim/src/golem/combomelee.rs | 0 voxygen/anim/src/quadruped_low/alpha.rs | 60 -- voxygen/anim/src/quadruped_low/beta.rs | 40 +- voxygen/anim/src/quadruped_low/combomelee.rs | 90 ++- voxygen/anim/src/quadruped_low/mod.rs | 94 ++- voxygen/anim/src/quadruped_medium/alpha.rs | 99 ---- voxygen/anim/src/quadruped_medium/beta.rs | 99 ---- .../anim/src/quadruped_medium/combomelee.rs | 98 +++- voxygen/anim/src/quadruped_medium/mod.rs | 170 +++++- voxygen/anim/src/quadruped_small/alpha.rs | 10 +- voxygen/anim/src/theropod/alpha.rs | 66 --- voxygen/anim/src/theropod/beta.rs | 65 --- voxygen/anim/src/theropod/combomelee.rs | 118 ++++ voxygen/anim/src/theropod/mod.rs | 7 +- voxygen/egui/src/character_states.rs | 17 +- .../audio/sfx/event_mapper/combat/tests.rs | 122 ---- voxygen/src/audio/sfx/mod.rs | 7 - voxygen/src/scene/figure/mod.rs | 536 ++++-------------- 76 files changed, 2673 insertions(+), 2865 deletions(-) rename voxygen/anim/src/arthropod/{alpha.rs => combomelee.rs} (93%) create mode 100644 voxygen/anim/src/golem/combomelee.rs delete mode 100644 voxygen/anim/src/quadruped_low/alpha.rs delete mode 100644 voxygen/anim/src/quadruped_medium/alpha.rs delete mode 100644 voxygen/anim/src/quadruped_medium/beta.rs delete mode 100644 voxygen/anim/src/theropod/alpha.rs delete mode 100644 voxygen/anim/src/theropod/beta.rs create mode 100644 voxygen/anim/src/theropod/combomelee.rs diff --git a/assets/common/abilities/axesimple/doublestrike.ron b/assets/common/abilities/axesimple/doublestrike.ron index cdcebef941..d80d9e3a38 100644 --- a/assets/common/abilities/axesimple/doublestrike.ron +++ b/assets/common/abilities/axesimple/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 8.0, - damage_increase: 1.0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 8.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.08, + melee_constructor: ( + kind: Slash( + damage: 8, + poise: 15, + knockback: 8, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.4, + swing_duration: 0.08, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 2.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.5, + movement: ( + swing: Some(Forward(2.5)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 10.0, - damage_increase: 1.5, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 12.0, - range: 3.5, - angle: 30.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 20, + knockback: 12, + energy_regen: 0, + ), + range: 3.5, + angle: 30.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.7, - forward_movement: 2.0, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.7, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron b/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron index b8be2929c9..9a7d5d8d98 100644 --- a/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/antlion/singlestrike.ron @@ -1,33 +1,31 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 74, - damage_increase: 0, - base_poise_damage: 27.5, - poise_damage_increase: 0, - knockback: 9.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 1.4, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 74, + poise: 27.5, + knockback: 9, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Ensnared, + dur_secs: 6.0, + strength: Value(0.5), + chance: 0.6, + ))), + ), + buildup_duration: 1.4, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, - damage_effect: Some(Buff(( - kind: Ensnared, - dur_secs: 6.0, - strength: DamageFraction(0.1), - chance: 0.6, - ))), + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron b/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron index 4b996d24e8..d13f5f7b05 100644 --- a/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/blackwidow/singlestrike.ron @@ -1,33 +1,31 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 50, - damage_increase: 0, - base_poise_damage: 16, - poise_damage_increase: 0, - knockback: 2.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Stab( + damage: 50, + poise: 16, + knockback: 2, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Poisoned, + dur_secs: 7.0, + strength: DamageFraction(0.6), + chance: 0.4, + ))), + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Poisoned, - dur_secs: 7.0, - strength: DamageFraction(0.6), - chance: 0.4, - ))), + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron b/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron index 171813d5b0..d50bdaa969 100644 --- a/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/hornbeetle/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 54, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 5.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 54, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.5, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.5, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron b/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron index 491e047f85..9038d0709e 100644 --- a/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/tarantula/singlestrike.ron @@ -1,33 +1,31 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 60, - damage_increase: 0, - base_poise_damage: 21, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Stab( + damage: 60, + poise: 21, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Poisoned, + dur_secs: 9.0, + strength: DamageFraction(0.7), + chance: 0.8, + ))), + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Poisoned, - dur_secs: 9.0, - strength: DamageFraction(0.7), - chance: 0.8, - ))), + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron b/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron index 29692ed1b2..a53e224097 100644 --- a/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron +++ b/assets/common/abilities/custom/arthropods/weevil/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 44, - damage_increase: 0, - base_poise_damage: 14, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 14, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/asp/singlestrike.ron b/assets/common/abilities/custom/asp/singlestrike.ron index 4b20b6615d..99b8bd3a64 100644 --- a/assets/common/abilities/custom/asp/singlestrike.ron +++ b/assets/common/abilities/custom/asp/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 3.5, + angle: 60.0, + ), + buildup_duration: 1.2, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/basilisk/triplestrike.ron b/assets/common/abilities/custom/basilisk/triplestrike.ron index 0339a5a8fe..4e5e5c1d90 100644 --- a/assets/common/abilities/custom/basilisk/triplestrike.ron +++ b/assets/common/abilities/custom/basilisk/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.8, - angle: 30.0, - base_buildup_duration: 1.4, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 15, + knockback: 3, + energy_regen: 0, + ), + range: 2.8, + angle: 30.0, + ), + buildup_duration: 1.4, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.8, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 18, + knockback: 3, + energy_regen: 0, + ), + range: 2.8, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ( - stage: 3, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.8, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.8, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron b/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron index 774dda8307..b4ed42e026 100644 --- a/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron +++ b/assets/common/abilities/custom/birdmediumbasic/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 1.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 0.0, - range: 2.5, - angle: 150.0, - base_buildup_duration: 0.1, - base_swing_duration: 0.07, - hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.0, - damage_kind: Piercing, +BasicMelee( + energy_cost: 0, + buildup_duration: 0.1, + swing_duration: 0.07, + hit_timing: 0.5, + recover_duration: 0.2, + melee_constructor: ( + kind: Stab( + damage: 1, + poise: 0, + knockback: 0, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 2.5, + angle: 150.0, + ), ori_modifier: 0.6, ) diff --git a/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron b/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron index cf12b4631a..6aa0832916 100644 --- a/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron +++ b/assets/common/abilities/custom/boreal_warrior/hammer/singlestrike.ron @@ -1,31 +1,28 @@ -ComboMelee( - stage_data: [( - stage: 1, - base_damage: 15.0, - damage_increase: 0.75, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 3.5, - range: 4.5, - angle: 50.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, - hit_timing: 0.5, - base_recover_duration: 0.45, - forward_movement: 0.0, - damage_kind: Crushing, - damage_effect: Some(Buff(( - kind: Frozen, - dur_secs: 2.0, - strength: Value(0.3), - chance: 0.4, - ))), - )], - initial_energy_gain: 5.0, - max_energy_gain: 12.5, - energy_increase: 2.5, - speed_increase: 0.1, - max_speed_increase: 0.4, - scales_from_combo: 2, - ori_modifier: 1.0, -) \ No newline at end of file +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Bash( + damage: 15, + poise: 0, + knockback: 3.5, + energy_regen: 5, + ), + range: 4.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Frozen, + dur_secs: 2.0, + strength: Value(0.3), + chance: 0.4, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 0.45, + ori_modifier: 1.0, + ), + ], + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/cyclops/doublestrike.ron b/assets/common/abilities/custom/cyclops/doublestrike.ron index 0fa7b32a60..fd1121ab4d 100644 --- a/assets/common/abilities/custom/cyclops/doublestrike.ron +++ b/assets/common/abilities/custom/cyclops/doublestrike.ron @@ -1,49 +1,51 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 32.0, - damage_increase: 0.0, - base_poise_damage: 20, - poise_damage_increase: 0.0, - knockback: 5.0, - range: 6, - angle: 90.0, - base_buildup_duration: 0.5, - base_swing_duration: 0.4, + melee_constructor: ( + kind: Bash( + damage: 32, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 6.0, + angle: 90.0, + ), + buildup_duration: 0.5, + swing_duration: 0.4, hit_timing: 0.4, - base_recover_duration: 0.4, - forward_movement: 0.3, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(0.3)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 36.0, - damage_increase: 0.0, - base_poise_damage: 40.0, - poise_damage_increase: 0.0, - knockback: 10.0, - range: 8, - angle: 45.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.6, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 40, + knockback: 10, + energy_regen: 0, + ), + range: 8.0, + angle: 45.0, + damage_effect: Some(Buff(( + kind: Crippled, + dur_secs: 3.0, + strength: DamageFraction(0.1), + chance: 1.0, + ))), + ), + buildup_duration: 0.6, + swing_duration: 0.6, hit_timing: 0.3, - base_recover_duration: 1.2, - forward_movement: 0.2, - damage_kind: Crushing, - damage_effect: Some(Buff(( - kind: Crippled, - dur_secs: 3.0, - strength: DamageFraction(0.1), - chance: 1.0, - ))), + recover_duration: 1.2, + movement: ( + swing: Some(Forward(0.2)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/dullahan/melee.ron b/assets/common/abilities/custom/dullahan/melee.ron index c5e30bfc0e..3aee8dddf7 100644 --- a/assets/common/abilities/custom/dullahan/melee.ron +++ b/assets/common/abilities/custom/dullahan/melee.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 35.5, - damage_increase: 0.0, - base_poise_damage: 15.0, - poise_damage_increase: 0.0, - knockback: 2.0, - range: 6.0, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 35, + poise: 15, + knockback: 2, + energy_regen: 0, + ), + range: 6.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 3.0, + strength: DamageFraction(0.05), + chance: 0.3, + ))), + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.4, - base_recover_duration: 0.3, - forward_movement: 0.8, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 3.0, - strength: DamageFraction(0.05), - chance: 0.3, - ))), + recover_duration: 0.3, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.6, ), ( - stage: 2, - base_damage: 38.5, - damage_increase: 0.0, - base_poise_damage: 20.0, - poise_damage_increase: 0.0, - knockback: 8.0, - range: 6.0, - angle: 60.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 38.5, + poise: 20, + knockback: 8, + energy_regen: 0, + ), + range: 6.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 3.0, + strength: DamageFraction(0.1), + chance: 0.15, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, hit_timing: 0.4, - base_recover_duration: 1.3, - forward_movement: 0.2, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 3.0, - strength: DamageFraction(0.1), - chance: 0.15, - ))), + recover_duration: 1.3, + movement: ( + swing: Some(Forward(0.2)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/husk_brute/singlestrike.ron b/assets/common/abilities/custom/husk_brute/singlestrike.ron index d0f6834487..0f1ada65f6 100644 --- a/assets/common/abilities/custom/husk_brute/singlestrike.ron +++ b/assets/common/abilities/custom/husk_brute/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 12, - poise_damage_increase: 0, - knockback: 5.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.0, - base_swing_duration: 0.2, - hit_timing: 0.5, - base_recover_duration: 1.0, - forward_movement: 0.5, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 1.0, + swing_duration: 0.2, + hit_timing: 0.5, + recover_duration: 1.0, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 12, + knockback: 5, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 3.5, + angle: 60.0, + ), ori_modifier: 0.6, ) diff --git a/assets/common/abilities/custom/maneater/singlestrike.ron b/assets/common/abilities/custom/maneater/singlestrike.ron index 47624c8d27..756337b4a2 100644 --- a/assets/common/abilities/custom/maneater/singlestrike.ron +++ b/assets/common/abilities/custom/maneater/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.0, - base_swing_duration: 0.075, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 3.5, + angle: 60.0, + ), + buildup_duration: 1.0, + swing_duration: 0.075, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/oni/doublestrike.ron b/assets/common/abilities/custom/oni/doublestrike.ron index 91ad4917b5..f347805769 100644 --- a/assets/common/abilities/custom/oni/doublestrike.ron +++ b/assets/common/abilities/custom/oni/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 18.0, - damage_increase: 1.0, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 4.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.12, + melee_constructor: ( + kind: Slash( + damage: 18, + poise: 0, + knockback: 4, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 1.2, + swing_duration: 0.12, hit_timing: 0.5, - base_recover_duration: 1.2, - forward_movement: 3.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 1.2, + movement: ( + swing: Some(Forward(3.5)), + ), + ori_modifier: 0.6, ), ( - stage: 2, - base_damage: 26.0, - damage_increase: 1.5, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 16.0, - range: 5.5, - angle: 15.0, - base_buildup_duration: 1.0, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Slash( + damage: 26, + poise: 0, + knockback: 16, + energy_regen: 0, + ), + range: 5.5, + angle: 15.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 1.0, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 2.4, - forward_movement: 4.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 2.4, + movement: ( + swing: Some(Forward(4.5)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowbasic/singlestrike.ron b/assets/common/abilities/custom/quadlowbasic/singlestrike.ron index 3938023f8a..a929d60112 100644 --- a/assets/common/abilities/custom/quadlowbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadlowbasic/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.0, - angle: 60.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 2.0, + angle: 60.0, + ), + buildup_duration: 1.2, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 3.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(3.0)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowbasic/triplestrike.ron b/assets/common/abilities/custom/quadlowbasic/triplestrike.ron index b90c3aca84..33276cdc93 100644 --- a/assets/common/abilities/custom/quadlowbasic/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowbasic/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 15, + knockback: 3, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 18, + knockback: 3, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ( - stage: 3, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 28, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron b/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron index 6884a54b17..aa109a29d0 100644 --- a/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 44.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 44.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 44.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 44, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowquick/quadstrike.ron b/assets/common/abilities/custom/quadlowquick/quadstrike.ron index fe86f0e1fb..a0ec0c8b8a 100644 --- a/assets/common/abilities/custom/quadlowquick/quadstrike.ron +++ b/assets/common/abilities/custom/quadlowquick/quadstrike.ron @@ -1,75 +1,85 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 1.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 1, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 1.2, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.8, ), ( - stage: 2, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 1.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.3, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 1, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.3, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.8, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.8, ), ( - stage: 3, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 1.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 1, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.8, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.8, ), ( - stage: 4, - base_damage: 12.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 8.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 12, + poise: 15, + knockback: 8, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.8, - damage_kind: Crushing, + recover_duration: 0.2, + movement: ( + swing: Some(Forward(0.8)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadlowtail/triplestrike.ron b/assets/common/abilities/custom/quadlowtail/triplestrike.ron index 2c532bd30a..2b2e056d84 100644 --- a/assets/common/abilities/custom/quadlowtail/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowtail/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 22, - knockback: 10.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 22, + knockback: 10, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 22, - poise_damage_increase: 0, - knockback: 10.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 22, + knockback: 10, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 22, - poise_damage_increase: 0, - knockback: 10.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 22, + knockback: 10, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.2, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedbasic/singlestrike.ron b/assets/common/abilities/custom/quadmedbasic/singlestrike.ron index 312c4dd9ad..fc8b819beb 100644 --- a/assets/common/abilities/custom/quadmedbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadmedbasic/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.7, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 28, + knockback: 3, + energy_regen: 0, + ), + range: 2.7, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedbasic/triplestrike.ron b/assets/common/abilities/custom/quadmedbasic/triplestrike.ron index 62e3b574ce..757a3d9a8a 100644 --- a/assets/common/abilities/custom/quadmedbasic/triplestrike.ron +++ b/assets/common/abilities/custom/quadmedbasic/triplestrike.ron @@ -1,59 +1,62 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 10.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.9, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 10, + poise: 15, + knockback: 5, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.9, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 10.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 10, + poise: 18, + knockback: 5, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 0.0, - damage_kind: Crushing, + recover_duration: 0.4, + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 10.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Bash( + damage: 10, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.4, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron index 59eeddd680..076cc6c178 100644 --- a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron +++ b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 50.0, - damage_increase: 0, - base_poise_damage: 22, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 50, + poise: 22, + knockback: 4, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 74.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 22, - knockback: 4.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 74, + poise: 22, + knockback: 4, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.5)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedjump/doublestrike.ron b/assets/common/abilities/custom/quadmedjump/doublestrike.ron index ca4fa9c29f..07d0b4d635 100644 --- a/assets/common/abilities/custom/quadmedjump/doublestrike.ron +++ b/assets/common/abilities/custom/quadmedjump/doublestrike.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 30, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 30, + knockback: 4, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.8, ), ( - stage: 2, - base_damage: 16.0, - damage_increase: 0, - base_poise_damage: 30, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.2, - angle: 30.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Bash( + damage: 16, + poise: 30, + knockback: 4, + energy_regen: 0, + ), + range: 2.2, + angle: 30.0, + ), + buildup_duration: 0.8, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(1.5)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadmedquick/triplestrike.ron b/assets/common/abilities/custom/quadmedquick/triplestrike.ron index 015e7dbc2b..2b0ee263c9 100644 --- a/assets/common/abilities/custom/quadmedquick/triplestrike.ron +++ b/assets/common/abilities/custom/quadmedquick/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.2, - angle: 40.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 15, + knockback: 5, + energy_regen: 0, + ), + range: 2.2, + angle: 40.0, + ), + buildup_duration: 1.2, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 0.3, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(0.3)), + ), + ori_modifier: 0.8, ), ( - stage: 2, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 17, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.2, - angle: 40.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 17, + knockback: 5, + energy_regen: 0, + ), + range: 2.2, + angle: 40.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.5)), + ), + ori_modifier: 0.8, ), ( - stage: 3, - base_damage: 20.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 5.0, - range: 2.2, - angle: 40.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 20, + knockback: 5, + energy_regen: 0, + ), + range: 2.2, + angle: 40.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.5)), + ), + ori_modifier: 0.8, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.8, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron b/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron index 8b10305b23..a83773e74b 100644 --- a/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 6.0, - damage_increase: 0, - base_poise_damage: 10, - poise_damage_increase: 0, - knockback: 1.0, - range: 1.5, - angle: 50.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.15, - hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 1.0, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 0.6, + swing_duration: 0.15, + hit_timing: 0.5, + recover_duration: 0.6, + melee_constructor: ( + kind: Bash( + damage: 6, + poise: 10, + knockback: 1, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 1.5, + angle: 50.0, + ), ori_modifier: 0.7, ) diff --git a/assets/common/abilities/custom/roshwalr/doublehusk.ron b/assets/common/abilities/custom/roshwalr/doublehusk.ron index 95b11639ad..002139e71c 100644 --- a/assets/common/abilities/custom/roshwalr/doublehusk.ron +++ b/assets/common/abilities/custom/roshwalr/doublehusk.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 7.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 3, - angle: 75.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Stab( + damage: 28, + poise: 7.5, + knockback: 3, + energy_regen: 5, + ), + range: 3.0, + angle: 75.0, + ), + buildup_duration: 1.2, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 0.25, - damage_kind: Piercing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(0.25)), + ), + ori_modifier: 0.5, ), ( - stage: 2, - base_damage: 28.0, - damage_increase: 0, - base_poise_damage: 7.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 3, - angle: 75.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.07, + melee_constructor: ( + kind: Stab( + damage: 28, + poise: 7.5, + knockback: 3, + energy_regen: 5, + ), + range: 3.0, + angle: 75.0, + ), + buildup_duration: 0.2, + swing_duration: 0.07, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 0.25, - damage_kind: Piercing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(0.25)), + ), + ori_modifier: 0.5, ), ], - initial_energy_gain: 5, - max_energy_gain: 5, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron index 774dda8307..b4ed42e026 100644 --- a/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron +++ b/assets/common/abilities/custom/simpleflyingmelee/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 1.0, - damage_increase: 0, - base_poise_damage: 0, - poise_damage_increase: 0, - knockback: 0.0, - range: 2.5, - angle: 150.0, - base_buildup_duration: 0.1, - base_swing_duration: 0.07, - hit_timing: 0.5, - base_recover_duration: 0.2, - forward_movement: 0.0, - damage_kind: Piercing, +BasicMelee( + energy_cost: 0, + buildup_duration: 0.1, + swing_duration: 0.07, + hit_timing: 0.5, + recover_duration: 0.2, + melee_constructor: ( + kind: Stab( + damage: 1, + poise: 0, + knockback: 0, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 2.5, + angle: 150.0, + ), ori_modifier: 0.6, ) diff --git a/assets/common/abilities/custom/stonegolemfist/singlestrike.ron b/assets/common/abilities/custom/stonegolemfist/singlestrike.ron index 1ecf3c0de5..239124743b 100644 --- a/assets/common/abilities/custom/stonegolemfist/singlestrike.ron +++ b/assets/common/abilities/custom/stonegolemfist/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 60.0, - damage_increase: 0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.5, - angle: 60.0, - base_buildup_duration: 1.8, - base_swing_duration: 0.1, - hit_timing: 0.5, - base_recover_duration: 1.8, - forward_movement: 3.0, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 1.8, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 1.8, + melee_constructor: ( + kind: Bash( + damage: 60, + poise: 40, + knockback: 3, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 3.5, + angle: 60.0, + ), ori_modifier: 0.7, ) diff --git a/assets/common/abilities/custom/theropodbasic/singlestrike.ron b/assets/common/abilities/custom/theropodbasic/singlestrike.ron index dc8fc4fb43..f73beb51c1 100644 --- a/assets/common/abilities/custom/theropodbasic/singlestrike.ron +++ b/assets/common/abilities/custom/theropodbasic/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 54.0, - damage_increase: 0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 4.0, - range: 7.5, - angle: 60.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 54, + poise: 40, + knockback: 4, + energy_regen: 0, + ), + range: 7.5, + angle: 60.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 3.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(3.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodbasic/triplestrike.ron b/assets/common/abilities/custom/theropodbasic/triplestrike.ron index c989cdef26..0d7f779ffb 100644 --- a/assets/common/abilities/custom/theropodbasic/triplestrike.ron +++ b/assets/common/abilities/custom/theropodbasic/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 40.0, - damage_increase: 0, - base_poise_damage: 32.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 7.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 40, + poise: 32.5, + knockback: 3, + energy_regen: 0, + ), + range: 7.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 50.0, - damage_increase: 0, - base_poise_damage: 32.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 5.5, - angle: 30.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 50, + poise: 32.5, + knockback: 3, + energy_regen: 0, + ), + range: 5.5, + angle: 30.0, + ), + buildup_duration: 0.2, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 60.0, - damage_increase: 0, - base_poise_damage: 32.5, - poise_damage_increase: 0, - knockback: 25.0, - range: 5.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.125, + melee_constructor: ( + kind: Bash( + damage: 60, + poise: 32.5, + knockback: 25, + energy_regen: 0, + ), + range: 5.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.125, hit_timing: 0.5, - base_recover_duration: 1.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 1.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodbird/singlestrike.ron b/assets/common/abilities/custom/theropodbird/singlestrike.ron index 217070715f..61c04e29ce 100644 --- a/assets/common/abilities/custom/theropodbird/singlestrike.ron +++ b/assets/common/abilities/custom/theropodbird/singlestrike.ron @@ -1,27 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 22.0, - damage_increase: 0, - base_poise_damage: 28, - poise_damage_increase: 0, - knockback: 2.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.8, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 22, + poise: 28, + knockback: 2, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.8, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 3.0, - damage_kind: Crushing, + recover_duration: 0.8, + movement: ( + swing: Some(Forward(3.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodbird/triplestrike.ron b/assets/common/abilities/custom/theropodbird/triplestrike.ron index 6124283d1b..d4d1965298 100644 --- a/assets/common/abilities/custom/theropodbird/triplestrike.ron +++ b/assets/common/abilities/custom/theropodbird/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 16.5, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.95, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 16.5, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.95, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.50, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ( - stage: 2, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.65, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.65, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.50, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ( - stage: 3, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 3.0, - range: 3.0, - angle: 15.0, - base_buildup_duration: 0.525, - base_swing_duration: 0.125, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 20, + knockback: 3, + energy_regen: 0, + ), + range: 3.0, + angle: 15.0, + ), + buildup_duration: 0.525, + swing_duration: 0.125, hit_timing: 0.5, - base_recover_duration: 1.25, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 1.25, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.6, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.6, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/custom/theropodsmall/triplestrike.ron b/assets/common/abilities/custom/theropodsmall/triplestrike.ron index 95b93b7584..33cf6f3ca7 100644 --- a/assets/common/abilities/custom/theropodsmall/triplestrike.ron +++ b/assets/common/abilities/custom/theropodsmall/triplestrike.ron @@ -1,59 +1,65 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 17.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 4.5, - angle: 30.0, - base_buildup_duration: 1.3, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 17.5, + knockback: 3, + energy_regen: 0, + ), + range: 4.5, + angle: 30.0, + ), + buildup_duration: 1.3, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.5, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 20.5, - poise_damage_increase: 0, - knockback: 3.0, - range: 4.5, - angle: 30.0, - base_buildup_duration: 0.2, - base_swing_duration: 0.15, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 20.5, + knockback: 3, + energy_regen: 0, + ), + range: 4.5, + angle: 30.0, + ), + buildup_duration: 0.2, + swing_duration: 0.15, hit_timing: 0.5, - base_recover_duration: 0.3, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 0.3, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ( - stage: 3, - base_damage: 30.0, - damage_increase: 0, - base_poise_damage: 22.5, - poise_damage_increase: 0, - knockback: 25.0, - range: 5.5, - angle: 30.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.125, + melee_constructor: ( + kind: Bash( + damage: 30, + poise: 22.5, + knockback: 25, + energy_regen: 0, + ), + range: 5.5, + angle: 30.0, + ), + buildup_duration: 0.4, + swing_duration: 0.125, hit_timing: 0.5, - base_recover_duration: 1.6, - forward_movement: 1.0, - damage_kind: Crushing, + recover_duration: 1.6, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/custom/wendigomagic/singlestrike.ron b/assets/common/abilities/custom/wendigomagic/singlestrike.ron index 6e4cd6edcf..3990f13158 100644 --- a/assets/common/abilities/custom/wendigomagic/singlestrike.ron +++ b/assets/common/abilities/custom/wendigomagic/singlestrike.ron @@ -1,27 +1,18 @@ -ComboMelee( - stage_data: [ - ( - stage: 1, - base_damage: 36.0, - damage_increase: 0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 3.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 1.2, - base_swing_duration: 0.4, - hit_timing: 0.5, - base_recover_duration: 0.8, - forward_movement: 5.0, - damage_kind: Crushing, +BasicMelee( + energy_cost: 0, + buildup_duration: 1.2, + swing_duration: 0.4, + hit_timing: 0.5, + recover_duration: 0.8, + melee_constructor: ( + kind: Bash( + damage: 36, + poise: 40, + knockback: 3, + energy_regen: 0, ), - ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, + range: 2.5, + angle: 30.0, + ), ori_modifier: 0.7, ) diff --git a/assets/common/abilities/daggersimple/singlestrike.ron b/assets/common/abilities/daggersimple/singlestrike.ron index 4cf543c1b7..428a8bd297 100644 --- a/assets/common/abilities/daggersimple/singlestrike.ron +++ b/assets/common/abilities/daggersimple/singlestrike.ron @@ -1,33 +1,25 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 2.0, - damage_increase: 1.0, - base_poise_damage: 8, - poise_damage_increase: 0, - knockback: 8.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 0.1, - base_swing_duration: 0.05, + melee_constructor: ( + kind: Slash( + damage: 2, + poise: 8, + knockback: 8, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + ), + buildup_duration: 0.1, + swing_duration: 0.05, hit_timing: 0.5, - base_recover_duration: 0.05, - forward_movement: 1.0, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.05, + movement: ( + swing: Some(Forward(1.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, -) \ No newline at end of file + energy_cost_per_strike: 0, +) diff --git a/assets/common/abilities/hammer/singlestrike.ron b/assets/common/abilities/hammer/singlestrike.ron index 40e8f9ae57..3f93b52230 100644 --- a/assets/common/abilities/hammer/singlestrike.ron +++ b/assets/common/abilities/hammer/singlestrike.ron @@ -1,4 +1,4 @@ -ComboMelee( +ComboMeleeDeprecated( stage_data: [( stage: 1, base_damage: 15.0, diff --git a/assets/common/abilities/hammersimple/doublestrike.ron b/assets/common/abilities/hammersimple/doublestrike.ron index bd98b61286..cfde38dd41 100644 --- a/assets/common/abilities/hammersimple/doublestrike.ron +++ b/assets/common/abilities/hammersimple/doublestrike.ron @@ -1,43 +1,45 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 24.0, - damage_increase: 1.0, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 4.0, - range: 4.5, - angle: 50.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.08, + melee_constructor: ( + kind: Bash( + damage: 24, + poise: 40, + knockback: 4, + energy_regen: 0, + ), + range: 4.5, + angle: 50.0, + ), + buildup_duration: 0.6, + swing_duration: 0.08, hit_timing: 0.5, - base_recover_duration: 0.6, - forward_movement: 3.5, - damage_kind: Crushing, + recover_duration: 0.6, + movement: ( + swing: Some(Forward(3.5)), + ), + ori_modifier: 0.65, ), ( - stage: 2, - base_damage: 32.0, - damage_increase: 1.5, - base_poise_damage: 40, - poise_damage_increase: 0, - knockback: 16.0, - range: 2.5, - angle: 30.0, - base_buildup_duration: 0.6, - base_swing_duration: 0.25, + melee_constructor: ( + kind: Bash( + damage: 32, + poise: 40, + knockback: 16, + energy_regen: 0, + ), + range: 2.5, + angle: 30.0, + ), + buildup_duration: 0.6, + swing_duration: 0.25, hit_timing: 0.5, - base_recover_duration: 1.2, - forward_movement: 2.0, - damage_kind: Crushing, + recover_duration: 1.2, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.65, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.65, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/spear/doublestrike.ron b/assets/common/abilities/spear/doublestrike.ron index 3c7f904ae2..76e629d136 100644 --- a/assets/common/abilities/spear/doublestrike.ron +++ b/assets/common/abilities/spear/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 6.5, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 4.0, - range: 2.5, - angle: 15.0, - base_buildup_duration: 0.35, - base_swing_duration: 0.075, + melee_constructor: ( + kind: Stab( + damage: 6.5, + poise: 18, + knockback: 4, + energy_regen: 0, + ), + range: 2.5, + angle: 15.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.35, + swing_duration: 0.075, hit_timing: 0.5, - base_recover_duration: 0.4, - forward_movement: 0.7, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.4, + movement: ( + swing: Some(Forward(0.7)), + ), + ori_modifier: 0.75, ), ( - stage: 2, - base_damage: 8.0, - damage_increase: 0, - base_poise_damage: 18, - poise_damage_increase: 0, - knockback: 7.0, - range: 2.5, - angle: 15.0, - base_buildup_duration: 0.5, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Stab( + damage: 8, + poise: 18, + knockback: 7, + energy_regen: 0, + ), + range: 2.5, + angle: 15.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.5, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 0.7, - damage_kind: Piercing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.5, + movement: ( + swing: Some(Forward(0.7)), + ), + ori_modifier: 0.75, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 3.0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 2, - ori_modifier: 0.75, + energy_cost_per_strike: 0, ) diff --git a/assets/common/abilities/swordsimple/doublestrike.ron b/assets/common/abilities/swordsimple/doublestrike.ron index 34ca8c1f76..d80d9e3a38 100644 --- a/assets/common/abilities/swordsimple/doublestrike.ron +++ b/assets/common/abilities/swordsimple/doublestrike.ron @@ -1,55 +1,57 @@ -ComboMelee( - stage_data: [ +ComboMelee2( + strikes: [ ( - stage: 1, - base_damage: 8.0, - damage_increase: 1.0, - base_poise_damage: 15, - poise_damage_increase: 0, - knockback: 8.0, - range: 3.5, - angle: 50.0, - base_buildup_duration: 0.4, - base_swing_duration: 0.08, + melee_constructor: ( + kind: Slash( + damage: 8, + poise: 15, + knockback: 8, + energy_regen: 0, + ), + range: 3.5, + angle: 50.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.4, + swing_duration: 0.08, hit_timing: 0.5, - base_recover_duration: 0.5, - forward_movement: 2.5, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.5, + movement: ( + swing: Some(Forward(2.5)), + ), + ori_modifier: 0.7, ), ( - stage: 2, - base_damage: 10.0, - damage_increase: 1.5, - base_poise_damage: 20, - poise_damage_increase: 0, - knockback: 12.0, - range: 3.5, - angle: 30.0, - base_buildup_duration: 0.7, - base_swing_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 20, + knockback: 12, + energy_regen: 0, + ), + range: 3.5, + angle: 30.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 10.0, + strength: DamageFraction(0.1), + chance: 0.1, + ))), + ), + buildup_duration: 0.7, + swing_duration: 0.1, hit_timing: 0.5, - base_recover_duration: 0.7, - forward_movement: 2.0, - damage_kind: Slashing, - damage_effect: Some(Buff(( - kind: Bleeding, - dur_secs: 10.0, - strength: DamageFraction(0.1), - chance: 0.1, - ))), + recover_duration: 0.7, + movement: ( + swing: Some(Forward(2.0)), + ), + ori_modifier: 0.7, ), ], - initial_energy_gain: 0, - max_energy_gain: 0, - energy_increase: 0, - speed_increase: 0.0, - max_speed_increase: 0.0, - scales_from_combo: 0, - ori_modifier: 0.7, + energy_cost_per_strike: 0, ) diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index 86289a130b..04bb163115 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -397,27 +397,6 @@ threshold: 0.7, subtitle: "subtitle-hammer-attack", ), - Attack(ComboMelee(Action, 1), Sword): ( - files: [ - "voxygen.audio.sfx.abilities.swing_sword", - ], - threshold: 0.7, - subtitle: "subtitle-sword_attack", - ), - Attack(ComboMelee(Action, 2), Sword): ( - files: [ - "voxygen.audio.sfx.abilities.separated_second_swing", - ], - threshold: 0.7, - subtitle: "subtitle-sword_attack", - ), - Attack(ComboMelee(Action, 3), Sword): ( - files: [ - "voxygen.audio.sfx.abilities.separated_third_swing", - ], - threshold: 0.7, - subtitle: "subtitle-sword_attack", - ), Inventory(CollectedTool(Sword)): ( files: [ "voxygen.audio.sfx.inventory.pickup_sword", @@ -443,7 +422,7 @@ threshold: 0.5, subtitle: "subtitle-unwield_hammer", ), - Attack(ComboMelee(Action, 1), Hammer): ( + Attack(ComboMeleeDeprecated(Action, 1), Hammer): ( files: [ "voxygen.audio.sfx.abilities.swing", ], @@ -489,20 +468,6 @@ threshold: 0.5, subtitle: "subtitle-unwield_axe", ), - Attack(ComboMelee(Action, 1), Axe): ( - files: [ - "voxygen.audio.sfx.abilities.swing", - ], - threshold: 0.7, - subtitle: "subtitle-axe_attack", - ), - Attack(ComboMelee(Action, 2), Axe): ( - files: [ - "voxygen.audio.sfx.abilities.swing", - ], - threshold: 0.7, - subtitle: "subtitle-axe_attack", - ), Attack(RapidMelee(Action), Axe): ( files: [ "voxygen.audio.sfx.abilities.swing", diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 94729755a2..20560ef8de 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -615,7 +615,7 @@ pub enum CharacterAbilityType { ChargedRanged, DashMelee(StageSection), BasicBlock, - ComboMelee(StageSection, u32), + ComboMeleeDeprecated(StageSection, u32), ComboMelee2(StageSection), FinisherMelee(StageSection), DiveMelee(StageSection), @@ -642,7 +642,9 @@ impl From<&CharacterState> for CharacterAbilityType { CharacterState::BasicBlock(_) => Self::BasicBlock, CharacterState::LeapMelee(data) => Self::LeapMelee(data.stage_section), CharacterState::LeapShockwave(data) => Self::LeapShockwave(data.stage_section), - CharacterState::ComboMelee(data) => Self::ComboMelee(data.stage_section, data.stage), + CharacterState::ComboMeleeDeprecated(data) => { + Self::ComboMeleeDeprecated(data.stage_section, data.stage) + }, CharacterState::ComboMelee2(data) => Self::ComboMelee2(data.stage_section), CharacterState::FinisherMelee(data) => Self::FinisherMelee(data.stage_section), CharacterState::DiveMelee(data) => Self::DiveMelee(data.stage_section), @@ -771,7 +773,7 @@ pub enum CharacterAbility { #[serde(default)] meta: AbilityMeta, }, - ComboMelee { + ComboMeleeDeprecated { stage_data: Vec>, initial_energy_gain: f32, max_energy_gain: f32, @@ -1134,7 +1136,7 @@ impl CharacterAbility { (data.physics.on_ground.is_none() || buildup_duration.is_some()) && update.energy.try_change_by(-*energy_cost).is_ok() }, - CharacterAbility::ComboMelee { .. } + CharacterAbility::ComboMeleeDeprecated { .. } | CharacterAbility::Boost { .. } | CharacterAbility::BasicBeam { .. } | CharacterAbility::Blink { .. } @@ -1303,7 +1305,7 @@ impl CharacterAbility { *recover_duration /= stats.speed; *energy_cost /= stats.energy_efficiency; }, - ComboMelee { + ComboMeleeDeprecated { ref mut stage_data, initial_energy_gain: _, max_energy_gain: _, @@ -1720,7 +1722,7 @@ impl CharacterAbility { } }, Boost { .. } - | ComboMelee { .. } + | ComboMeleeDeprecated { .. } | Blink { .. } | Music { .. } | BasicSummon { .. } @@ -1768,7 +1770,7 @@ impl CharacterAbility { | RiposteMelee { .. } | BasicBeam { .. } | Boost { .. } - | ComboMelee { .. } + | ComboMeleeDeprecated { .. } | Blink { .. } | Music { .. } | BasicSummon { .. } @@ -1795,7 +1797,7 @@ impl CharacterAbility { | SelfBuff { meta, .. } | BasicBeam { meta, .. } | Boost { meta, .. } - | ComboMelee { meta, .. } + | ComboMeleeDeprecated { meta, .. } | ComboMelee2 { meta, .. } | Blink { meta, .. } | BasicSummon { meta, .. } @@ -1872,7 +1874,7 @@ impl CharacterAbility { use skills::{HammerSkill::*, Skill::Hammer}; match self { - CharacterAbility::ComboMelee { + CharacterAbility::ComboMeleeDeprecated { ref mut speed_increase, ref mut max_speed_increase, ref mut stage_data, @@ -2385,9 +2387,8 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { was_wielded: false, // false by default. utils might set it to true prev_aimed_dir: None, is_sneaking: false, - was_combo: None, }), - CharacterAbility::ComboMelee { + CharacterAbility::ComboMeleeDeprecated { stage_data, initial_energy_gain, max_energy_gain, @@ -2397,7 +2398,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { scales_from_combo, ori_modifier, meta: _, - } => CharacterState::ComboMelee(combo_melee::Data { + } => CharacterState::ComboMeleeDeprecated(combo_melee::Data { static_data: combo_melee::StaticData { num_stages: stage_data.len() as u32, stage_data: stage_data.iter().map(|stage| stage.to_duration()).collect(), diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 1854ed5c00..2e2d74b2b5 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -95,7 +95,7 @@ pub enum CharacterState { DashMelee(dash_melee::Data), /// A three-stage attack where each attack pushes player forward /// and successive attacks increase in damage, while player holds button. - ComboMelee(combo_melee::Data), + ComboMeleeDeprecated(combo_melee::Data), /// A state where you progress through multiple melee attacks ComboMelee2(combo_melee2::Data), /// A leap followed by a small aoe ground attack @@ -154,7 +154,7 @@ impl CharacterState { | CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) | CharacterState::DashMelee(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::BasicBlock(_) | CharacterState::LeapMelee(_) @@ -220,7 +220,7 @@ impl CharacterState { CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) | CharacterState::DashMelee(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::LeapMelee(_) | CharacterState::LeapShockwave(_) @@ -247,7 +247,7 @@ impl CharacterState { CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) | CharacterState::DashMelee(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::BasicBlock(_) | CharacterState::LeapMelee(_) @@ -377,7 +377,7 @@ impl CharacterState { pub fn is_forced_movement(&self) -> bool { matches!(self, - CharacterState::ComboMelee(s) if s.stage_section == StageSection::Action) + CharacterState::ComboMeleeDeprecated(s) if s.stage_section == StageSection::Action) || matches!(self, CharacterState::ComboMelee2(s) if s.stage_section == StageSection::Action) || matches!(self, CharacterState::DashMelee(s) if s.stage_section == StageSection::Charge) || matches!(self, CharacterState::LeapMelee(s) if s.stage_section == StageSection::Movement) @@ -403,7 +403,7 @@ impl CharacterState { | CharacterState::Wielding(_) | CharacterState::BasicMelee(_) | CharacterState::BasicRanged(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::ChargedRanged(_) | CharacterState::RepeaterRanged(_) @@ -458,7 +458,7 @@ impl CharacterState { CharacterState::Roll(data) => data.behavior(j, output_events), CharacterState::Wielding(data) => data.behavior(j, output_events), CharacterState::Equipping(data) => data.behavior(j, output_events), - CharacterState::ComboMelee(data) => data.behavior(j, output_events), + CharacterState::ComboMeleeDeprecated(data) => data.behavior(j, output_events), CharacterState::ComboMelee2(data) => data.behavior(j, output_events), CharacterState::BasicMelee(data) => data.behavior(j, output_events), CharacterState::BasicRanged(data) => data.behavior(j, output_events), @@ -511,7 +511,9 @@ impl CharacterState { CharacterState::Roll(data) => data.handle_event(j, output_events, action), CharacterState::Wielding(data) => data.handle_event(j, output_events, action), CharacterState::Equipping(data) => data.handle_event(j, output_events, action), - CharacterState::ComboMelee(data) => data.handle_event(j, output_events, action), + CharacterState::ComboMeleeDeprecated(data) => { + data.handle_event(j, output_events, action) + }, CharacterState::ComboMelee2(data) => data.handle_event(j, output_events, action), CharacterState::BasicMelee(data) => data.handle_event(j, output_events, action), CharacterState::BasicRanged(data) => data.handle_event(j, output_events, action), @@ -564,7 +566,7 @@ impl CharacterState { CharacterState::Roll(data) => Some(data.static_data.ability_info), CharacterState::Wielding(_) => None, CharacterState::Equipping(_) => None, - CharacterState::ComboMelee(data) => Some(data.static_data.ability_info), + CharacterState::ComboMeleeDeprecated(data) => Some(data.static_data.ability_info), CharacterState::ComboMelee2(data) => Some(data.static_data.ability_info), CharacterState::BasicMelee(data) => Some(data.static_data.ability_info), CharacterState::BasicRanged(data) => Some(data.static_data.ability_info), @@ -608,7 +610,7 @@ impl CharacterState { CharacterState::Roll(data) => Some(data.stage_section), CharacterState::Equipping(_) => Some(StageSection::Buildup), CharacterState::Wielding(_) => None, - CharacterState::ComboMelee(data) => Some(data.stage_section), + CharacterState::ComboMeleeDeprecated(data) => Some(data.stage_section), CharacterState::ComboMelee2(data) => Some(data.stage_section), CharacterState::BasicMelee(data) => Some(data.stage_section), CharacterState::BasicRanged(data) => Some(data.stage_section), @@ -668,7 +670,7 @@ impl CharacterState { buildup: Some(data.static_data.buildup_duration), ..Default::default() }), - CharacterState::ComboMelee(data) => { + CharacterState::ComboMeleeDeprecated(data) => { let stage_index = data.stage_index(); let stage = data.static_data.stage_data[stage_index]; Some(DurationsInfo { @@ -840,7 +842,7 @@ impl CharacterState { CharacterState::Roll(data) => Some(data.timer), CharacterState::Wielding(_) => None, CharacterState::Equipping(data) => Some(data.timer), - CharacterState::ComboMelee(data) => Some(data.timer), + CharacterState::ComboMeleeDeprecated(data) => Some(data.timer), CharacterState::ComboMelee2(data) => Some(data.timer), CharacterState::BasicMelee(data) => Some(data.timer), CharacterState::BasicRanged(data) => Some(data.timer), @@ -884,7 +886,7 @@ impl CharacterState { CharacterState::Roll(_) => None, CharacterState::Wielding(_) => None, CharacterState::Equipping(_) => None, - CharacterState::ComboMelee(_) => Some(AttackSource::Melee), + CharacterState::ComboMeleeDeprecated(_) => Some(AttackSource::Melee), CharacterState::ComboMelee2(_) => Some(AttackSource::Melee), CharacterState::BasicMelee(_) => Some(AttackSource::Melee), CharacterState::BasicRanged(data) => { diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index 94d7edfe7d..6d29df89b9 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -705,7 +705,7 @@ fn default_main_tool(body: &Body) -> Item { arthropod::Species::Dagonite => Some(Item::new_from_asset_expect( "common.items.npc_weapons.unique.arthropods.dagonite", )), - _ => Some(Item::new_from_asset_expect( + arthropod::Species::Leafbeetle => Some(Item::new_from_asset_expect( "common.items.npc_weapons.unique.arthropods.leafbeetle", )), }, diff --git a/common/src/states/combo_melee.rs b/common/src/states/combo_melee.rs index 63c370afc8..a1a6aef699 100644 --- a/common/src/states/combo_melee.rs +++ b/common/src/states/combo_melee.rs @@ -170,14 +170,14 @@ impl CharacterBehavior for Data { ); // Build up - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)), ..*self }); } else { // Transitions to swing section of stage - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: Duration::default(), stage_section: StageSection::Action, @@ -194,7 +194,7 @@ impl CharacterBehavior for Data { && !self.exhausted { // Swing - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, None), exhausted: true, @@ -304,14 +304,14 @@ impl CharacterBehavior for Data { ); // Swings - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)), ..*self }); } else { // Transitions to recover section of stage - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: Duration::default(), stage_section: StageSection::Recover, @@ -328,7 +328,7 @@ impl CharacterBehavior for Data { None, ); // Recovers - update.character = CharacterState::ComboMelee(Data { + update.character = CharacterState::ComboMeleeDeprecated(Data { static_data: self.static_data.clone(), timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)), ..*self @@ -380,7 +380,7 @@ fn reset_state( data.static_data.ability_info.input, ); - if let CharacterState::ComboMelee(c) = &mut update.character { + if let CharacterState::ComboMeleeDeprecated(c) = &mut update.character { c.stage = (data.stage % data.static_data.num_stages) + 1; } } diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 24a7af4c5a..1741cc19e7 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -2,7 +2,7 @@ use crate::{ comp::{ buff::{BuffChange, BuffKind}, character_state::{AttackFilters, OutputEvents}, - CharacterState, InputKind, StateUpdate, + CharacterState, StateUpdate, }, event::ServerEvent, states::{ @@ -46,8 +46,6 @@ pub struct Data { pub prev_aimed_dir: Option, /// Is sneaking, true if previous state was also considered sneaking pub is_sneaking: bool, - /// Was in state with combo - pub was_combo: Option<(InputKind, u32)>, } impl CharacterBehavior for Data { @@ -126,20 +124,7 @@ impl CharacterBehavior for Data { }); } else { // Done - if let Some((input, stage)) = self.was_combo { - if input_is_pressed(data, input) { - handle_input(data, output_events, &mut update, input); - // If other states are introduced that progress through stages, add them - // here - if let CharacterState::ComboMelee(c) = &mut update.character { - c.stage = stage; - } - } else { - end_ability(data, &mut update); - } - } else { - end_ability(data, &mut update); - } + end_ability(data, &mut update); } }, _ => { diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index dc0b6a0e1d..0f6f6ea836 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1243,16 +1243,11 @@ fn handle_ability( } } if let CharacterState::Roll(roll) = &mut update.character { - if let CharacterState::ComboMelee(c) = data.character { - roll.was_combo = Some((c.static_data.ability_info.input, c.stage)); + if data.character.is_wield() || data.character.was_wielded() { roll.was_wielded = true; - } else { - if data.character.is_wield() || data.character.was_wielded() { - roll.was_wielded = true; - } - if data.character.is_stealthy() { - roll.is_sneaking = true; - } + } + if data.character.is_stealthy() { + roll.is_sneaking = true; } if data.character.is_aimed() { roll.prev_aimed_dir = Some(data.controller.inputs.look_dir); diff --git a/common/systems/src/stats.rs b/common/systems/src/stats.rs index 6c0f10d216..27457b697a 100644 --- a/common/systems/src/stats.rs +++ b/common/systems/src/stats.rs @@ -174,7 +174,7 @@ impl<'a> System<'a> for Sys { | CharacterState::DashMelee(_) | CharacterState::LeapMelee(_) | CharacterState::LeapShockwave(_) - | CharacterState::ComboMelee(_) + | CharacterState::ComboMeleeDeprecated(_) | CharacterState::ComboMelee2(_) | CharacterState::BasicRanged(_) | CharacterState::Music(_) diff --git a/server/agent/src/attack.rs b/server/agent/src/attack.rs index c3e5bf1bc7..b4c00451aa 100644 --- a/server/agent/src/attack.rs +++ b/server/agent/src/attack.rs @@ -3410,7 +3410,7 @@ impl<'a> AgentData<'a> { { // If already in dash, keep dashing if not in recover controller.push_basic_input(InputKind::Ability(0)); - } else if matches!(self.char_state, CharacterState::ComboMelee(c) if matches!(c.stage_section, StageSection::Recover)) + } else if matches!(self.char_state, CharacterState::ComboMelee2(c) if matches!(c.stage_section, StageSection::Recover)) { // If already in combo keep comboing if not in recover controller.push_basic_input(InputKind::Primary); diff --git a/voxygen/anim/src/arthropod/alpha.rs b/voxygen/anim/src/arthropod/combomelee.rs similarity index 93% rename from voxygen/anim/src/arthropod/alpha.rs rename to voxygen/anim/src/arthropod/combomelee.rs index a90f507e0f..d767d4e7fc 100644 --- a/voxygen/anim/src/arthropod/alpha.rs +++ b/voxygen/anim/src/arthropod/combomelee.rs @@ -6,19 +6,19 @@ use super::{ }; use common::states::utils::StageSection; -pub struct AlphaAnimation; +pub struct ComboAnimation; -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); +impl Animation for ComboAnimation { + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32); type Skeleton = ArthropodSkeleton; #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"arthropod_alpha\0"; + const UPDATE_FN: &'static [u8] = b"arthropod_combo\0"; - #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_alpha")] + #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, + (_ability_id, stage_section, _current_strike, global_time, timer): Self::Dependency<'_>, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, @@ -26,9 +26,9 @@ impl Animation for AlphaAnimation { let mut next = (*skeleton).clone(); let (movement1, movement2, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.powi(2), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; diff --git a/voxygen/anim/src/arthropod/mod.rs b/voxygen/anim/src/arthropod/mod.rs index 9bc370a1b8..e44831d840 100644 --- a/voxygen/anim/src/arthropod/mod.rs +++ b/voxygen/anim/src/arthropod/mod.rs @@ -1,4 +1,4 @@ -pub mod alpha; +pub mod combomelee; pub mod dash; pub mod idle; pub mod jump; @@ -11,7 +11,7 @@ pub mod summon; // Reexports pub use self::{ - alpha::AlphaAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, + combomelee::ComboAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, leapshockwave::LeapShockAnimation, run::RunAnimation, shoot::ShootAnimation, stunned::StunnedAnimation, summon::SummonAnimation, }; diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index ebc8f5f84a..070530669a 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -1,6 +1,7 @@ use super::{ super::{vek::*, Animation}, - BipedLargeSkeleton, SkeletonAttr, + biped_large_alpha_axe, biped_large_alpha_hammer, biped_large_alpha_sword, + init_biped_large_alpha, BipedLargeSkeleton, SkeletonAttr, }; use common::{ comp::item::tool::{AbilitySpec, ToolKind}, @@ -45,17 +46,7 @@ impl Animation for AlphaAnimation { ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); - let speed = Vec2::::from(velocity).magnitude(); - let lab: f32 = 0.65 * s_a.tempo; - let speednorm = (speed / 12.0).powf(0.4); - let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; - let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; - let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 1.4).sin()); - - let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 0.4).sin()); let (move1base, move2base, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), Some(StageSection::Action) => (1.0, anim_time, 0.0), @@ -65,85 +56,20 @@ impl Animation for AlphaAnimation { let pullback = 1.0 - move3; let move1 = move1base * pullback; let move2 = move2base * pullback; + let subtract = global_time - timer; let check = subtract - subtract.trunc(); let mirror = (check - 0.5).signum(); - next.second.position = Vec3::new(0.0, 0.0, 0.0); - next.second.orientation = Quaternion::rotation_x(0.0); - next.shoulder_l.position = Vec3::new( - -s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothorir * 1.0, - ); - next.shoulder_l.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + let speed = Vec2::::from(velocity).magnitude(); - next.shoulder_r.position = Vec3::new( - s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothoril * 1.0, - ); - next.shoulder_r.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0); - - next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); - next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); - - next.hand_l.orientation = Quaternion::rotation_x(0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0); + let foothorir = init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); match active_tool_kind { Some(ToolKind::Sword) => { - next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); - next.control_r.position = Vec3::new(0.0, 2.0, -3.0); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.control.position = Vec3::new( - -3.0 + move1 * -4.0 + move2 * 5.0, - 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, - -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, - ); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.5 + move2 * -0.7); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.5 + move2 * 0.7); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(-0.2); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(0.2) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -2.0) - * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); + biped_large_alpha_sword(&mut next, s_a, move1, move2); }, Some(ToolKind::Hammer) => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -12.0 + move2 * 20.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, - (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 8.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.2 + move2 * -0.4); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.2 + move2 * 0.2); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) - * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) - * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); + biped_large_alpha_hammer(&mut next, s_a, move1, move2); }, Some(ToolKind::Axe) => match ability_id { Some("common.abilities.custom.gigas_frost.cleave") => { @@ -257,32 +183,7 @@ impl Animation for AlphaAnimation { next.main.orientation = Quaternion::rotation_y(move1 * 0.4 + move2 * -1.2); }, _ => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -12.0 + move2 * 28.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * -5.0, - (-s_a.grip.0 / 0.8) + move1 * 2.0 + move2 * 8.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.upper_torso.orientation = - Quaternion::rotation_z(move1 * 0.6 + move2 * -0.9); - next.lower_torso.orientation = - Quaternion::rotation_z(move1 * -0.6 + move2 * 0.9); - - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) - * Quaternion::rotation_y(-0.0); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) - * Quaternion::rotation_y(-1.8 + move1 * -0.4 + move2 * 3.5) - * Quaternion::rotation_z(move1 * -1.0 + move2 * -1.5); + biped_large_alpha_axe(&mut next, s_a, move1, move2); }, }, Some(ToolKind::Natural) => match ability_id { @@ -306,7 +207,6 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.6); next.head.orientation = Quaternion::rotation_x(move1 * 0.3); }, - Some("common.abilities.custom.tidalwarrior.pincer") => { if mirror > 0.0 { next.head.orientation = Quaternion::rotation_z(move1 * 0.75); diff --git a/voxygen/anim/src/biped_large/beta.rs b/voxygen/anim/src/biped_large/beta.rs index 75eaa37bfe..34065d6542 100644 --- a/voxygen/anim/src/biped_large/beta.rs +++ b/voxygen/anim/src/biped_large/beta.rs @@ -1,5 +1,6 @@ use super::{ super::{vek::*, Animation}, + biped_large_beta_axe, biped_large_beta_hammer, biped_large_beta_sword, init_biped_large_beta, BipedLargeSkeleton, SkeletonAttr, }; use common::{ @@ -43,17 +44,7 @@ impl Animation for BetaAnimation { ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); - let speed = Vec2::::from(velocity).magnitude(); - let lab: f32 = 0.65 * s_a.tempo; - let speednorm = (speed / 12.0).powf(0.4); - let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; - let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; - let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 1.4).sin()); - - let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) - * ((acc_vel * lab + PI * 0.4).sin()); let (move1base, move2base, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), Some(StageSection::Action) => (1.0, anim_time, 0.0), @@ -64,108 +55,19 @@ impl Animation for BetaAnimation { let move1 = move1base * pullback; let move2 = move2base * pullback; - next.shoulder_l.position = Vec3::new( - -s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothorir * 1.0, - ); - next.shoulder_l.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + let speed = Vec2::::from(velocity).magnitude(); - next.shoulder_r.position = Vec3::new( - s_a.shoulder.0, - s_a.shoulder.1, - s_a.shoulder.2 - foothoril * 1.0, - ); - next.shoulder_r.orientation = - Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); - next.torso.orientation = Quaternion::rotation_z(0.0); - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0); - - next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); - next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); - - next.hand_l.orientation = Quaternion::rotation_x(0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0); + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); match active_tool_kind { Some(ToolKind::Sword) => { - next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); - next.control_r.position = Vec3::new(0.0, 2.0, -3.0); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.control.position = Vec3::new( - -3.0 + move1 * -4.0 + move2 * 5.0, - 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, - -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, - ); - next.upper_torso.orientation = - Quaternion::rotation_z(move1base * 0.5 + move2 * -0.7); - next.lower_torso.orientation = - Quaternion::rotation_z(move1base * -0.5 + move2 * 0.7); - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(-0.2); - next.control_r.orientation = - Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) - * Quaternion::rotation_y(0.2) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -1.5) - * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); + biped_large_beta_sword(&mut next, s_a, move1base, move1, move2); }, Some(ToolKind::Hammer) => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -12.0 + move2 * 20.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, - (-s_a.grip.0 / 0.8) + move1 * 6.0 + move2 * 8.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6 + move2 * -1.5); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6 + move2 * 1.5); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * -1.5 + move2 * -0.3) - * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) - * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); + biped_large_beta_hammer(&mut next, s_a, move1, move2); }, Some(ToolKind::Axe) => { - next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); - next.control_r.position = Vec3::new(1.0, 2.0, -2.0); - - next.control.position = Vec3::new( - 4.0 + move1 * -18.0 + move2 * 20.0, - (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 12.0, - (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 4.0, - ); - next.head.orientation = Quaternion::rotation_x(move1 * -0.25) - * Quaternion::rotation_z(move1 * -0.9 + move2 * 0.6); - next.upper_torso.orientation = Quaternion::rotation_z(move1 * 1.2 + move2 * -1.0); - next.lower_torso.orientation = Quaternion::rotation_z(move1 * -1.2 + move2 * 1.0); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); - next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.orientation = - Quaternion::rotation_x(-1.0 + move1 * 0.0 + move2 * -0.8) - * Quaternion::rotation_y(-1.8 + move1 * 3.0 + move2 * -0.9) - * Quaternion::rotation_z(move1 * -0.2 + move2 * -1.5); + biped_large_beta_axe(&mut next, s_a, move1, move2); }, Some(ToolKind::Natural) => match ability_id { Some("common.abilities.custom.wendigomagic.singlestrike") => { diff --git a/voxygen/anim/src/biped_large/combomelee.rs b/voxygen/anim/src/biped_large/combomelee.rs index f5255e2450..2629238eab 100644 --- a/voxygen/anim/src/biped_large/combomelee.rs +++ b/voxygen/anim/src/biped_large/combomelee.rs @@ -1,5 +1,7 @@ use super::{ super::{vek::*, Animation}, + biped_large_alpha_axe, biped_large_alpha_hammer, biped_large_alpha_sword, biped_large_beta_axe, + biped_large_beta_hammer, biped_large_beta_sword, init_biped_large_alpha, init_biped_large_beta, BipedLargeSkeleton, SkeletonAttr, }; use common::states::utils::{AbilityInfo, StageSection}; @@ -13,6 +15,8 @@ impl Animation for ComboAnimation { Option, usize, Vec2, + Vec3, + f32, ); type Skeleton = BipedLargeSkeleton; @@ -22,7 +26,7 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, _move_dir): Self::Dependency<'_>, + (ability_id, stage_section, _ability_info, current_strike, _move_dir, velocity, acc_vel): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -108,6 +112,114 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some( + "common.abilities.custom.cyclops.doublestrike" + | "common.abilities.hammersimple.doublestrike", + ) => { + let speed = Vec2::::from(velocity).magnitude(); + match strike { + 0 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); + biped_large_alpha_hammer(&mut next, s_a, move1, move2); + }, + 1 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(6)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); + biped_large_beta_hammer(&mut next, s_a, move1, move2); + }, + _ => {}, + } + }, + Some( + "common.abilities.custom.dullahan.melee" + | "common.abilities.swordsimple.doublestrike", + ) => { + let speed = Vec2::::from(velocity).magnitude(); + match strike { + 0 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); + biped_large_alpha_sword(&mut next, s_a, move1, move2); + }, + 1 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(6)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); + biped_large_beta_sword(&mut next, s_a, move1base, move1, move2); + }, + _ => {}, + } + }, + Some("common.abilities.custom.oni.doublestrike") => { + let speed = Vec2::::from(velocity).magnitude(); + match strike { + 0 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_alpha(&mut next, s_a, speed, acc_vel, move1); + biped_large_alpha_axe(&mut next, s_a, move1, move2); + }, + 1 => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(6)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1base * pullback; + let move2 = move2base * pullback; + + init_biped_large_beta(&mut next, s_a, speed, acc_vel, move1); + biped_large_beta_axe(&mut next, s_a, move1, move2); + }, + _ => {}, + } + }, _ => {}, } } diff --git a/voxygen/anim/src/biped_large/mod.rs b/voxygen/anim/src/biped_large/mod.rs index cd4f435069..d851f0e4a6 100644 --- a/voxygen/anim/src/biped_large/mod.rs +++ b/voxygen/anim/src/biped_large/mod.rs @@ -633,3 +633,268 @@ fn mount_point(body: &Body) -> Vec3 { } .into() } + +pub fn init_biped_large_alpha( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + speed: f32, + acc_vel: f32, + move1: f32, +) -> f32 { + let lab: f32 = 0.65 * s_a.tempo; + let speednorm = (speed / 12.0).powf(0.4); + let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; + let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; + let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 1.4).sin()); + + let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 0.4).sin()); + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_x(0.0); + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + + next.shoulder_r.position = Vec3::new( + s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothoril * 1.0, + ); + next.shoulder_r.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); + + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0); + + next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); + next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); + + next.hand_l.orientation = Quaternion::rotation_x(0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0); + + foothorir +} + +pub fn init_biped_large_beta( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + speed: f32, + acc_vel: f32, + move1: f32, +) { + let lab: f32 = 0.65 * s_a.tempo; + let speednorm = (speed / 12.0).powf(0.4); + let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm; + let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm; + let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 1.4).sin()); + + let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt()) + * ((acc_vel * lab + PI * 0.4).sin()); + + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm); + + next.shoulder_r.position = Vec3::new( + s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothoril * 1.0, + ); + next.shoulder_r.orientation = + Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm); + next.torso.orientation = Quaternion::rotation_z(0.0); + + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0); + + next.hand_l.position = Vec3::new(0.0, 0.0, s_a.grip.0); + next.hand_r.position = Vec3::new(0.0, 0.0, s_a.grip.0); + + next.hand_l.orientation = Quaternion::rotation_x(0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0); +} + +pub fn biped_large_alpha_hammer( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -12.0 + move2 * 20.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, + (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 8.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.2 + move2 * -0.4); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.2 + move2 * 0.2); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) + * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) + * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); +} + +pub fn biped_large_beta_hammer( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -12.0 + move2 * 20.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 5.0, + (-s_a.grip.0 / 0.8) + move1 * 6.0 + move2 * 8.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6 + move2 * -1.5); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6 + move2 * 1.5); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * -1.5 + move2 * -0.3) + * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) + * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); +} + +pub fn biped_large_alpha_sword( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); + next.control_r.position = Vec3::new(0.0, 2.0, -3.0); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.control.position = Vec3::new( + -3.0 + move1 * -4.0 + move2 * 5.0, + 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, + -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, + ); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.5 + move2 * -0.7); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.5 + move2 * 0.7); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(-0.2); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(0.2) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -2.0) + * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); +} + +pub fn biped_large_beta_sword( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1base: f32, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); + next.control_r.position = Vec3::new(0.0, 2.0, -3.0); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.control.position = Vec3::new( + -3.0 + move1 * -4.0 + move2 * 5.0, + 5.0 + s_a.grip.0 / 1.2 + move1 * -4.0 + move2 * 8.0, + -4.0 + -s_a.grip.0 / 2.0 + move2 * -5.0, + ); + next.upper_torso.orientation = Quaternion::rotation_z(move1base * 0.5 + move2 * -0.7); + next.lower_torso.orientation = Quaternion::rotation_z(move1base * -0.5 + move2 * 0.7); + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(-0.2); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5) + * Quaternion::rotation_y(0.2) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -1.5) + * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0); +} + +pub fn biped_large_alpha_axe( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -12.0 + move2 * 28.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * -5.0, + (-s_a.grip.0 / 0.8) + move1 * 2.0 + move2 * 8.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.6 + move2 * -0.9); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -0.6 + move2 * 0.9); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3) + * Quaternion::rotation_y(-1.8 + move1 * -0.4 + move2 * 3.5) + * Quaternion::rotation_z(move1 * -1.0 + move2 * -1.5); +} + +pub fn biped_large_beta_axe( + next: &mut BipedLargeSkeleton, + s_a: &SkeletonAttr, + move1: f32, + move2: f32, +) { + next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0); + next.control_r.position = Vec3::new(1.0, 2.0, -2.0); + + next.control.position = Vec3::new( + 4.0 + move1 * -18.0 + move2 * 20.0, + (s_a.grip.0 / 1.0) + move1 * -3.0 + move2 * 12.0, + (-s_a.grip.0 / 0.8) + move1 * -2.0 + move2 * 4.0, + ); + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25) * Quaternion::rotation_z(move1 * -0.9 + move2 * 0.6); + next.upper_torso.orientation = Quaternion::rotation_z(move1 * 1.2 + move2 * -1.0); + next.lower_torso.orientation = Quaternion::rotation_z(move1 * -1.2 + move2 * 1.0); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.0 + move1 * 0.0 + move2 * -0.8) + * Quaternion::rotation_y(-1.8 + move1 * 3.0 + move2 * -0.9) + * Quaternion::rotation_z(move1 * -0.2 + move2 * -1.5); +} diff --git a/voxygen/anim/src/biped_small/alpha.rs b/voxygen/anim/src/biped_small/alpha.rs index 3c1effd0b6..874b75cb0d 100644 --- a/voxygen/anim/src/biped_small/alpha.rs +++ b/voxygen/anim/src/biped_small/alpha.rs @@ -1,6 +1,7 @@ use super::{ super::{vek::*, Animation}, - BipedSmallSkeleton, SkeletonAttr, + biped_small_alpha_axe, biped_small_alpha_dagger, biped_small_alpha_spear, + init_biped_small_alpha, BipedSmallSkeleton, SkeletonAttr, }; use common::{comp::item::ToolKind, states::utils::StageSection}; use std::f32::consts::PI; @@ -49,12 +50,12 @@ impl Animation for AlphaAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); let speed = Vec2::::from(velocity).magnitude(); + let speednorm = speed / 9.4; + let speednormcancel = 1.0 - speednorm; let fast = (anim_time * 10.0).sin(); let fastalt = (anim_time * 10.0 + PI / 2.0).sin(); - let speednorm = speed / 9.4; - let speednormcancel = 1.0 - speednorm; let anim_time = anim_time.min(1.0); let (move1base, move2base, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), @@ -70,105 +71,26 @@ impl Animation for AlphaAnimation { let move2 = move2base * pullback * mirror; let move1abs = move1base * pullback; let move2abs = move2base * pullback; - next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2); - next.hand_r.position = Vec3::new(-s_a.grip.0 * 4.0, 0.0, s_a.grip.2); - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0); - next.hand_l.orientation = Quaternion::rotation_x(0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0); + + init_biped_small_alpha(&mut next, s_a); + match active_tool_kind { Some(ToolKind::Spear) => { - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - next.head.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * 0.3) - * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.6) - * Quaternion::rotation_y(move1abs * 0.3 + move2abs * -0.5); - next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); - next.chest.orientation = Quaternion::rotation_x(move1abs * -0.2 + move2abs * 0.3) - * Quaternion::rotation_z(move1abs * 0.5 + move2abs * -0.6); - - next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1); - next.pants.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * -0.3) - * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.2); - - next.control_l.position = Vec3::new(1.0 - s_a.grip.0 * 2.0, 2.0, -2.0); - next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, 2.0); - - next.control.position = Vec3::new( - -3.0 + move1abs * -3.0 + move2abs * 5.0, - s_a.grip.2 + move1abs * -12.0 + move2abs * 17.0, - -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0 + move2abs * 5.0, + biped_small_alpha_spear( + &mut next, + s_a, + move1abs, + move2abs, + fast, + fastalt, + speednormcancel, ); - - next.control_l.orientation = - Quaternion::rotation_x(PI / 1.5 + move1abs * -1.5 + move2abs * 2.5) - * Quaternion::rotation_y(-0.3); - next.control_r.orientation = Quaternion::rotation_x( - PI / 1.5 + s_a.grip.0 * 0.2 + move1abs * -1.5 + move2abs * 2.5, - ) * Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2); - - next.control.orientation = - Quaternion::rotation_x(-1.35 + move1abs * -0.3 + move2abs * 0.5) - * Quaternion::rotation_z(move1abs * 1.0 + move2abs * -1.0) - * Quaternion::rotation_y(move2abs * 0.0); - - next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1); - next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel) - * Quaternion::rotation_z(fast * 0.15 * speednormcancel); }, Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => { - next.head.orientation = Quaternion::rotation_z(move1abs * 0.3 + move2abs * -0.6); - next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); - next.control_r.position = Vec3::new( - 9.0 + move1abs * -10.0 + s_a.grip.0 * 2.0, - -1.0 + move1abs * 2.0, - move1abs * 3.0 - 2.0, - ); - - next.control.position = Vec3::new( - -5.0 + move1abs * 5.0, - -1.0 + s_a.grip.2, - -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, - ); - - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move2abs * 1.0) - * Quaternion::rotation_y(-0.0) - * Quaternion::rotation_z(-0.0); - next.control_r.orientation = - Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) - * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) - * Quaternion::rotation_z(-0.0); - - next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) - * Quaternion::rotation_y(move1abs * -0.9 + move2abs * 2.0) - * Quaternion::rotation_z(-0.3); + biped_small_alpha_axe(&mut next, s_a, move1abs, move2abs); }, Some(ToolKind::Dagger) => { - next.head.orientation = Quaternion::rotation_x(move1abs * 0.15 + move2abs * -0.15) - * Quaternion::rotation_z(move1abs * 0.15 + move2abs * -0.3); - next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); - next.control_r.position = Vec3::new( - 9.0 + move1abs * -7.0 + s_a.grip.0 * 2.0, - -1.0 + move1abs * 6.0, - -2.0, - ); - - next.control.position = Vec3::new( - -5.0 + move1abs * 5.0 + move2abs * 9.0, - -1.0 + move2abs * -3.0 + s_a.grip.2, - -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, - ); - - next.control_l.orientation = Quaternion::rotation_x(PI / 2.0) - * Quaternion::rotation_y(-0.0) - * Quaternion::rotation_z(-0.0); - next.control_r.orientation = - Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) - * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) - * Quaternion::rotation_z(-0.0); - - next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) - * Quaternion::rotation_y(move1abs * -0.4 + move2abs * 1.0) - * Quaternion::rotation_z(-0.3 + move2abs * -2.2); + biped_small_alpha_dagger(&mut next, s_a, move1abs, move2abs); }, Some(ToolKind::Staff) => match ability_id { Some("common.abilities.custom.dwarves.flamekeeper.flamecrush") => { diff --git a/voxygen/anim/src/biped_small/combomelee.rs b/voxygen/anim/src/biped_small/combomelee.rs index e8c546513b..8a0ff7cbe8 100644 --- a/voxygen/anim/src/biped_small/combomelee.rs +++ b/voxygen/anim/src/biped_small/combomelee.rs @@ -1,18 +1,14 @@ use super::{ super::{vek::*, Animation}, - BipedSmallSkeleton, SkeletonAttr, + biped_small_alpha_axe, biped_small_alpha_dagger, biped_small_alpha_spear, + init_biped_small_alpha, BipedSmallSkeleton, SkeletonAttr, }; -use common::states::utils::{AbilityInfo, StageSection}; +use common::states::utils::StageSection; +use std::f32::consts::PI; pub struct ComboAnimation; impl Animation for ComboAnimation { - type Dependency<'a> = ( - Option<&'a str>, - Option, - Option, - usize, - Vec2, - ); + type Dependency<'a> = (Option<&'a str>, StageSection, usize, Vec3, f32, f32); type Skeleton = BipedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -21,7 +17,7 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, _move_dir): Self::Dependency<'_>, + (ability_id, stage_section, current_strike, velocity, _global_time, _timer): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -32,7 +28,7 @@ impl Animation for ComboAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); let multi_strike_pullback = 1.0 - - if matches!(stage_section, Some(StageSection::Recover)) { + - if matches!(stage_section, StageSection::Recover) { anim_time.powi(4) } else { 0.0 @@ -50,11 +46,11 @@ impl Animation for ComboAnimation { ) => { let (move1, move2) = if strike == current_strike { match stage_section { - Some(StageSection::Buildup) => { + StageSection::Buildup => { (((anim_time.max(0.4) - 0.4) * 1.5).powf(0.5), 0.0) }, - Some(StageSection::Action) => (1.0, (anim_time.min(0.4) * 2.5).powi(2)), - Some(StageSection::Recover) => (1.0, 1.0), + StageSection::Action => (1.0, (anim_time.min(0.4) * 2.5).powi(2)), + StageSection::Recover => (1.0, 1.0), _ => (0.0, 0.0), } } else { @@ -81,6 +77,68 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some( + "common.abilities.axesimple.doublestrike" + | "common.abilities.custom.boreal_warrior.hammer", + ) => { + let anim_time = anim_time.min(1.0); + let (move1base, move2base, move3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1abs = move1base * pullback; + let move2abs = move2base * pullback; + + init_biped_small_alpha(&mut next, s_a); + biped_small_alpha_axe(&mut next, s_a, move1abs, move2abs); + }, + Some("common.abilities.daggersimple.singlestrike") => { + let anim_time = anim_time.min(1.0); + let (move1base, move2base, move3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1abs = move1base * pullback; + let move2abs = move2base * pullback; + + init_biped_small_alpha(&mut next, s_a); + biped_small_alpha_dagger(&mut next, s_a, move1abs, move2abs); + }, + Some("common.abilities.spear.doublestrike") => { + let anim_time = anim_time.min(1.0); + let speed = Vec2::::from(velocity).magnitude(); + let speednorm = speed / 9.4; + let speednormcancel = 1.0 - speednorm; + let fast = (anim_time * 10.0).sin(); + let fastalt = (anim_time * 10.0 + PI / 2.0).sin(); + + let (move1base, move2base, move3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1abs = move1base * pullback; + let move2abs = move2base * pullback; + + init_biped_small_alpha(&mut next, s_a); + biped_small_alpha_spear( + &mut next, + s_a, + move1abs, + move2abs, + fast, + fastalt, + speednormcancel, + ); + }, _ => {}, } } diff --git a/voxygen/anim/src/biped_small/mod.rs b/voxygen/anim/src/biped_small/mod.rs index 893b8ec20c..ead28a2d8f 100644 --- a/voxygen/anim/src/biped_small/mod.rs +++ b/voxygen/anim/src/biped_small/mod.rs @@ -22,6 +22,7 @@ pub use self::{ use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; use common::comp::{self}; use core::convert::TryFrom; +use std::f32::consts::PI; pub type Body = comp::biped_small::Body; @@ -280,3 +281,123 @@ impl<'a> From<&'a Body> for SkeletonAttr { } } } + +pub fn init_biped_small_alpha(next: &mut BipedSmallSkeleton, s_a: &SkeletonAttr) { + next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2); + next.hand_r.position = Vec3::new(-s_a.grip.0 * 4.0, 0.0, s_a.grip.2); + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0); + next.hand_l.orientation = Quaternion::rotation_x(0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0); +} + +pub fn biped_small_alpha_spear( + next: &mut BipedSmallSkeleton, + s_a: &SkeletonAttr, + move1abs: f32, + move2abs: f32, + fast: f32, + fastalt: f32, + speednormcancel: f32, +) { + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * 0.3) + * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.6) + * Quaternion::rotation_y(move1abs * 0.3 + move2abs * -0.5); + next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); + next.chest.orientation = Quaternion::rotation_x(move1abs * -0.2 + move2abs * 0.3) + * Quaternion::rotation_z(move1abs * 0.5 + move2abs * -0.6); + + next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1); + next.pants.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * -0.3) + * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.2); + + next.control_l.position = Vec3::new(1.0 - s_a.grip.0 * 2.0, 2.0, -2.0); + next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, 2.0); + + next.control.position = Vec3::new( + -3.0 + move1abs * -3.0 + move2abs * 5.0, + s_a.grip.2 + move1abs * -12.0 + move2abs * 17.0, + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0 + move2abs * 5.0, + ); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 1.5 + move1abs * -1.5 + move2abs * 2.5) + * Quaternion::rotation_y(-0.3); + next.control_r.orientation = + Quaternion::rotation_x(PI / 1.5 + s_a.grip.0 * 0.2 + move1abs * -1.5 + move2abs * 2.5) + * Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2); + + next.control.orientation = Quaternion::rotation_x(-1.35 + move1abs * -0.3 + move2abs * 0.5) + * Quaternion::rotation_z(move1abs * 1.0 + move2abs * -1.0) + * Quaternion::rotation_y(move2abs * 0.0); + + next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1); + next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel) + * Quaternion::rotation_z(fast * 0.15 * speednormcancel); +} + +pub fn biped_small_alpha_axe( + next: &mut BipedSmallSkeleton, + s_a: &SkeletonAttr, + move1abs: f32, + move2abs: f32, +) { + next.head.orientation = Quaternion::rotation_z(move1abs * 0.3 + move2abs * -0.6); + next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); + next.control_r.position = Vec3::new( + 9.0 + move1abs * -10.0 + s_a.grip.0 * 2.0, + -1.0 + move1abs * 2.0, + move1abs * 3.0 - 2.0, + ); + + next.control.position = Vec3::new( + -5.0 + move1abs * 5.0, + -1.0 + s_a.grip.2, + -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, + ); + + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move2abs * 1.0) + * Quaternion::rotation_y(-0.0) + * Quaternion::rotation_z(-0.0); + next.control_r.orientation = Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) + * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) + * Quaternion::rotation_z(-0.0); + + next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) + * Quaternion::rotation_y(move1abs * -0.9 + move2abs * 2.0) + * Quaternion::rotation_z(-0.3); +} + +pub fn biped_small_alpha_dagger( + next: &mut BipedSmallSkeleton, + s_a: &SkeletonAttr, + move1abs: f32, + move2abs: f32, +) { + next.head.orientation = Quaternion::rotation_x(move1abs * 0.15 + move2abs * -0.15) + * Quaternion::rotation_z(move1abs * 0.15 + move2abs * -0.3); + next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0); + next.control_r.position = Vec3::new( + 9.0 + move1abs * -7.0 + s_a.grip.0 * 2.0, + -1.0 + move1abs * 6.0, + -2.0, + ); + + next.control.position = Vec3::new( + -5.0 + move1abs * 5.0 + move2abs * 9.0, + -1.0 + move2abs * -3.0 + s_a.grip.2, + -1.0 + move1abs * 3.0 + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0, + ); + + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(-0.0) + * Quaternion::rotation_z(-0.0); + next.control_r.orientation = Quaternion::rotation_x(0.5 + move1abs * 1.5 + s_a.grip.0 * 0.2) + * Quaternion::rotation_y(0.2 + s_a.grip.0 * 0.2) + * Quaternion::rotation_z(-0.0); + + next.control.orientation = Quaternion::rotation_x(-0.3 + move2abs * -1.0) + * Quaternion::rotation_y(move1abs * -0.4 + move2abs * 1.0) + * Quaternion::rotation_z(-0.3 + move2abs * -2.2); +} diff --git a/voxygen/anim/src/golem/combomelee.rs b/voxygen/anim/src/golem/combomelee.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/voxygen/anim/src/quadruped_low/alpha.rs b/voxygen/anim/src/quadruped_low/alpha.rs deleted file mode 100644 index 3633c95869..0000000000 --- a/voxygen/anim/src/quadruped_low/alpha.rs +++ /dev/null @@ -1,60 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedLowSkeleton, SkeletonAttr, -}; -use common::states::utils::StageSection; -//use std::ops::Rem; - -pub struct AlphaAnimation; - -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = QuadrupedLowSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"quadruped_low_alpha\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_alpha")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - _s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let twitch3 = (mirror * movement3 * 9.0).sin(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; - - next.head_upper.orientation = Quaternion::rotation_z(twitch3 * -0.7); - - next.head_lower.orientation = - Quaternion::rotation_x(movement1abs * 0.35 + movement2abs * -0.9) - * Quaternion::rotation_y(movement1 * 0.7 + movement2 * -1.0); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); - next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15) - * Quaternion::rotation_z(movement1 * -0.2 + movement2 * 0.6); - - next.tail_front.orientation = Quaternion::rotation_x(0.15) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); - - next.tail_rear.orientation = Quaternion::rotation_x(-0.12) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); - next - } -} diff --git a/voxygen/anim/src/quadruped_low/beta.rs b/voxygen/anim/src/quadruped_low/beta.rs index 70dd80948c..287c252d0b 100644 --- a/voxygen/anim/src/quadruped_low/beta.rs +++ b/voxygen/anim/src/quadruped_low/beta.rs @@ -1,14 +1,11 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedLowSkeleton, SkeletonAttr, -}; +use super::{super::Animation, quadruped_low_beta, QuadrupedLowSkeleton, SkeletonAttr}; use common::states::utils::StageSection; //use std::ops::Rem; pub struct BetaAnimation; impl Animation for BetaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); + type Dependency<'a> = (f32, f32, StageSection, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -20,41 +17,12 @@ impl Animation for BetaAnimation { (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, anim_time: f32, _rate: &mut f32, - _s_a: &SkeletonAttr, + s_a: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let twitch3 = (mirror * movement3 * 9.0).sin(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; + quadruped_low_beta(&mut next, s_a, stage_section, anim_time, global_time, timer); - next.head_upper.orientation = Quaternion::rotation_z(twitch3 * 0.2); - - next.head_lower.orientation = - Quaternion::rotation_x(movement1abs * 0.15 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.15); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.9); - next.chest.orientation = Quaternion::rotation_y(movement1 * 0.08 + movement2 * -0.15) - * Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.3); - - next.tail_front.orientation = Quaternion::rotation_x(0.15) - * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); - - next.tail_rear.orientation = Quaternion::rotation_x(-0.12) - * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); next } } diff --git a/voxygen/anim/src/quadruped_low/combomelee.rs b/voxygen/anim/src/quadruped_low/combomelee.rs index cc874bdea9..81dfd9b709 100644 --- a/voxygen/anim/src/quadruped_low/combomelee.rs +++ b/voxygen/anim/src/quadruped_low/combomelee.rs @@ -1,19 +1,12 @@ use super::{ super::{vek::*, Animation}, - QuadrupedLowSkeleton, SkeletonAttr, + quadruped_low_alpha, quadruped_low_beta, QuadrupedLowSkeleton, SkeletonAttr, }; -use common::states::utils::{AbilityInfo, StageSection}; +use common::states::utils::StageSection; pub struct ComboAnimation; impl Animation for ComboAnimation { - type Dependency<'a> = ( - Option<&'a str>, - Option, - Option, - usize, - f32, - f32, - ); + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -22,16 +15,16 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, global_time, timer): Self::Dependency<'_>, + (ability_id, stage_section, current_strike, global_time, timer): Self::Dependency<'_>, anim_time: f32, rate: &mut f32, - _s_a: &SkeletonAttr, + s_a: &SkeletonAttr, ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); let _multi_strike_pullback = 1.0 - - if matches!(stage_section, Some(StageSection::Recover)) { + - if matches!(stage_section, StageSection::Recover) { anim_time.powi(4) } else { 0.0 @@ -45,9 +38,9 @@ impl Animation for ComboAnimation { | "common.abilities.custom.driggle.bite", ) => { let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; @@ -102,6 +95,71 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some( + "common.abilities.custom.asp.singlestrike" + | "comon.abilities.custom.maneater.singlestrike" + | "common.abilities.custom.quadlowbasic.singlestrike", + ) => { + quadruped_low_alpha( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + Some( + "common.abilities.custom.basilisk.triplestrike" + | "common.abilities.custom.quadlowbasic.triplestrike" + | "common.abilities.custom.quadlowbreathe.triplestrike" + | "common.abilities.custom.quadlowtail.triplestrike", + ) => match strike { + 0 | 2 => { + quadruped_low_alpha( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_low_beta( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, + Some("common.abilities.custom.quadlowquick.quadstrike") => match strike { + 0 | 2 | 3 => { + quadruped_low_alpha( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_low_beta( + &mut next, + s_a, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, _ => {}, } } diff --git a/voxygen/anim/src/quadruped_low/mod.rs b/voxygen/anim/src/quadruped_low/mod.rs index d301aa0655..2c309316b0 100644 --- a/voxygen/anim/src/quadruped_low/mod.rs +++ b/voxygen/anim/src/quadruped_low/mod.rs @@ -1,4 +1,3 @@ -pub mod alpha; pub mod beta; pub mod breathe; pub mod combomelee; @@ -14,14 +13,17 @@ pub mod tailwhip; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, breathe::BreatheAnimation, - combomelee::ComboAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, - run::RunAnimation, shockwave::ShockwaveAnimation, shoot::ShootAnimation, - spritesummon::SpriteSummonAnimation, stunned::StunnedAnimation, tailwhip::TailwhipAnimation, + beta::BetaAnimation, breathe::BreatheAnimation, combomelee::ComboAnimation, + dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation, + shockwave::ShockwaveAnimation, shoot::ShootAnimation, spritesummon::SpriteSummonAnimation, + stunned::StunnedAnimation, tailwhip::TailwhipAnimation, }; use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; -use common::comp::{self}; +use common::{ + comp::{self}, + states::utils::StageSection, +}; use core::convert::TryFrom; pub type Body = comp::quadruped_low::Body; @@ -435,3 +437,83 @@ fn mount_point(body: &Body) -> Vec3 { } .into() } + +pub fn quadruped_low_alpha( + next: &mut QuadrupedLowSkeleton, + _s_a: &SkeletonAttr, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let twitch3 = (mirror * movement3 * 9.0).sin(); + let movement1 = mirror * movement1base * pullback; + let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + next.head_upper.orientation = Quaternion::rotation_z(twitch3 * -0.7); + + next.head_lower.orientation = Quaternion::rotation_x(movement1abs * 0.35 + movement2abs * -0.9) + * Quaternion::rotation_y(movement1 * 0.7 + movement2 * -1.0); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); + next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15) + * Quaternion::rotation_z(movement1 * -0.2 + movement2 * 0.6); + + next.tail_front.orientation = + Quaternion::rotation_x(0.15) * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); + + next.tail_rear.orientation = + Quaternion::rotation_x(-0.12) * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); +} + +pub fn quadruped_low_beta( + next: &mut QuadrupedLowSkeleton, + _s_a: &SkeletonAttr, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let twitch3 = (mirror * movement3 * 9.0).sin(); + let movement1 = mirror * movement1base * pullback; + let movement2 = mirror * movement2base * pullback; + let movement1abs = movement1base * pullback; + let movement2abs = movement2base * pullback; + + next.head_upper.orientation = Quaternion::rotation_z(twitch3 * 0.2); + + next.head_lower.orientation = Quaternion::rotation_x(movement1abs * 0.15 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.15); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.9); + next.chest.orientation = Quaternion::rotation_y(movement1 * 0.08 + movement2 * -0.15) + * Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.3); + + next.tail_front.orientation = + Quaternion::rotation_x(0.15) * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); + + next.tail_rear.orientation = + Quaternion::rotation_x(-0.12) * Quaternion::rotation_z(movement1 * 0.4 + movement2 * 0.2); +} diff --git a/voxygen/anim/src/quadruped_medium/alpha.rs b/voxygen/anim/src/quadruped_medium/alpha.rs deleted file mode 100644 index 32bb388f2a..0000000000 --- a/voxygen/anim/src/quadruped_medium/alpha.rs +++ /dev/null @@ -1,99 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedMediumSkeleton, SkeletonAttr, -}; -use common::states::utils::StageSection; - -pub struct AlphaAnimation; - -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = QuadrupedMediumSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"quadruped_medium_alpha\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_alpha")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - let speed = (Vec2::::from(velocity).magnitude()).min(24.0); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = movement1base * mirror * pullback; - let movement1abs = movement1base * pullback; - let movement2 = movement2base * mirror * pullback; - let movement2abs = movement2base * pullback; - let twitch1 = (movement1 * 10.0).sin() * pullback; - let twitch2 = (movement3 * 5.0).sin() * pullback; - let twitchmovement = twitch1 + twitch2; - - next.head.orientation = Quaternion::rotation_x(movement1abs * -0.3 + movement2abs * 0.6) - * Quaternion::rotation_y(movement1 * 0.35 + movement2 * -0.15) - * Quaternion::rotation_z(movement1 * 0.15 + movement2 * -0.5); - - next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -0.2) - * Quaternion::rotation_y(movement1 * 0.0) - * Quaternion::rotation_z(movement1 * 0.10 + movement1 * -0.15); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 0.4); - - next.tail.orientation = Quaternion::rotation_z( - movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror, - ); - next.torso_front.position = Vec3::new( - 0.0, - s_a.torso_front.0 + movement1abs * -4.0, - s_a.torso_front.1, - ); - next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) - * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); - - next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); - - next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); - if speed < 0.5 { - next.leg_fl.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_fr.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); - - next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); - - next.foot_fl.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_fr.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_bl.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - - next.foot_br.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - }; - next - } -} diff --git a/voxygen/anim/src/quadruped_medium/beta.rs b/voxygen/anim/src/quadruped_medium/beta.rs deleted file mode 100644 index 8d189b8eb8..0000000000 --- a/voxygen/anim/src/quadruped_medium/beta.rs +++ /dev/null @@ -1,99 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - QuadrupedMediumSkeleton, SkeletonAttr, -}; -use common::states::utils::StageSection; - -pub struct BetaAnimation; - -impl Animation for BetaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = QuadrupedMediumSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"quadruped_medium_beta\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_beta")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - let speed = (Vec2::::from(velocity).magnitude()).min(24.0); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.sqrt(), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = movement1base * mirror * pullback; - let movement1abs = movement1base * pullback; - let movement2 = movement2base * mirror * pullback; - let movement2abs = movement2base * pullback; - let twitch1 = (movement1 * 10.0).sin() * pullback; - let twitch2 = (movement2abs * -8.0).sin(); - let twitchmovement = twitch1 + twitch2; - - next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.1) - * Quaternion::rotation_y(movement1 * -0.35 + movement2 * 0.25) - * Quaternion::rotation_z(movement1 * -0.25 + movement2 * 0.5); - - next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.0 + movement2abs * -0.2) - * Quaternion::rotation_y(movement1 * 0.0) - * Quaternion::rotation_z(movement1 * -0.10 + movement1 * 0.15); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + twitch2 * -0.4); - - next.tail.orientation = Quaternion::rotation_z( - movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror, - ); - next.torso_front.position = Vec3::new( - 0.0, - s_a.torso_front.0 + movement1abs * -4.0, - s_a.torso_front.1, - ); - next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) - * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); - - next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) - * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); - - next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); - if speed < 0.5 { - next.leg_fl.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_fr.orientation = - Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) - * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) - * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); - - next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); - - next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); - - next.foot_fl.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_fr.orientation = - Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); - - next.foot_bl.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - - next.foot_br.orientation = - Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); - }; - next - } -} diff --git a/voxygen/anim/src/quadruped_medium/combomelee.rs b/voxygen/anim/src/quadruped_medium/combomelee.rs index c52a3a5304..18e10b452e 100644 --- a/voxygen/anim/src/quadruped_medium/combomelee.rs +++ b/voxygen/anim/src/quadruped_medium/combomelee.rs @@ -1,19 +1,12 @@ use super::{ super::{vek::*, Animation}, - QuadrupedMediumSkeleton, SkeletonAttr, + quadruped_medium_alpha, quadruped_medium_beta, QuadrupedMediumSkeleton, SkeletonAttr, }; -use common::states::utils::{AbilityInfo, StageSection}; +use common::states::utils::StageSection; pub struct ComboAnimation; impl Animation for ComboAnimation { - type Dependency<'a> = ( - Option<&'a str>, - Option, - Option, - usize, - f32, - f32, - ); + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32, f32); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -22,16 +15,18 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_combo")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (ability_id, stage_section, _ability_info, current_strike, global_time, timer): Self::Dependency<'_>, + (ability_id, stage_section, current_strike, speed, global_time, timer): Self::Dependency< + '_, + >, anim_time: f32, rate: &mut f32, - _s_a: &SkeletonAttr, + s_a: &SkeletonAttr, ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); let _multi_strike_pullback = 1.0 - - if matches!(stage_section, Some(StageSection::Recover)) { + - if matches!(stage_section, StageSection::Recover) { anim_time.powi(4) } else { 0.0 @@ -44,9 +39,9 @@ impl Animation for ComboAnimation { | "common.abilities.custom.frostfang.triplestrike", ) => { let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; @@ -101,6 +96,77 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some("common.abilities.custom.quadmedbasic.singlestrike") => match strike { + 0 => { + quadruped_medium_alpha( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, + Some( + "common.abilities.custom.quadmedbasic.triplestrike" + | "common.abilities.custom.quadmedquick.triplestrike", + ) => match strike { + 0 | 2 => { + quadruped_medium_alpha( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_medium_beta( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, + Some( + "common.abilities.custom.quadmedcharge.doublestrike" + | "common.abilities.custom.quadmedjump.doublestrike" + | "common.abilities.custom.roshwalr.doublehusk", + ) => match strike { + 0 => { + quadruped_medium_alpha( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + 1 => { + quadruped_medium_beta( + &mut next, + s_a, + speed, + stage_section, + anim_time, + global_time, + timer, + ); + }, + _ => {}, + }, _ => {}, } } diff --git a/voxygen/anim/src/quadruped_medium/mod.rs b/voxygen/anim/src/quadruped_medium/mod.rs index 2d6f243030..91b53198e4 100644 --- a/voxygen/anim/src/quadruped_medium/mod.rs +++ b/voxygen/anim/src/quadruped_medium/mod.rs @@ -1,5 +1,3 @@ -pub mod alpha; -pub mod beta; pub mod combomelee; pub mod dash; pub mod feed; @@ -13,14 +11,16 @@ pub mod stunned; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, combomelee::ComboAnimation, dash::DashAnimation, - feed::FeedAnimation, hoof::HoofAnimation, idle::IdleAnimation, jump::JumpAnimation, - leapmelee::LeapMeleeAnimation, run::RunAnimation, shockwave::ShockwaveAnimation, - stunned::StunnedAnimation, + combomelee::ComboAnimation, dash::DashAnimation, feed::FeedAnimation, hoof::HoofAnimation, + idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, run::RunAnimation, + shockwave::ShockwaveAnimation, stunned::StunnedAnimation, }; use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; -use common::comp::{self}; +use common::{ + comp::{self}, + states::utils::StageSection, +}; use core::convert::TryFrom; pub type Body = comp::quadruped_medium::Body; @@ -797,3 +797,159 @@ fn mount_point(body: &Body) -> Vec3 { } .into() } + +pub fn quadruped_medium_alpha( + next: &mut QuadrupedMediumSkeleton, + s_a: &SkeletonAttr, + speed: f32, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let speed = (Vec2::::from(speed).magnitude()).min(24.0); + + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.powf(0.25), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powf(0.25), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = movement1base * mirror * pullback; + let movement1abs = movement1base * pullback; + let movement2 = movement2base * mirror * pullback; + let movement2abs = movement2base * pullback; + let twitch1 = (movement1 * 10.0).sin() * pullback; + let twitch2 = (movement3 * 5.0).sin() * pullback; + let twitchmovement = twitch1 + twitch2; + + next.head.orientation = Quaternion::rotation_x(movement1abs * -0.3 + movement2abs * 0.6) + * Quaternion::rotation_y(movement1 * 0.35 + movement2 * -0.15) + * Quaternion::rotation_z(movement1 * 0.15 + movement2 * -0.5); + + next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -0.2) + * Quaternion::rotation_y(movement1 * 0.0) + * Quaternion::rotation_z(movement1 * 0.10 + movement1 * -0.15); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 0.4); + + next.tail.orientation = + Quaternion::rotation_z(movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror); + next.torso_front.position = Vec3::new( + 0.0, + s_a.torso_front.0 + movement1abs * -4.0, + s_a.torso_front.1, + ); + next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) + * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); + + next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) + * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); + + next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); + if speed < 0.5 { + next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); + + next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); + + next.foot_fl.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_fr.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_bl.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + + next.foot_br.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + }; +} + +pub fn quadruped_medium_beta( + next: &mut QuadrupedMediumSkeleton, + s_a: &SkeletonAttr, + speed: f32, + stage_section: StageSection, + anim_time: f32, + global_time: f32, + timer: f32, +) { + let speed = (Vec2::::from(speed).magnitude()).min(24.0); + + let (movement1base, movement2base, movement3) = match stage_section { + StageSection::Buildup => (anim_time.powf(0.25), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.sqrt(), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - movement3; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = movement1base * mirror * pullback; + let movement1abs = movement1base * pullback; + let movement2 = movement2base * mirror * pullback; + let movement2abs = movement2base * pullback; + let twitch1 = (movement1 * 10.0).sin() * pullback; + let twitch2 = (movement2abs * -8.0).sin(); + let twitchmovement = twitch1 + twitch2; + + next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.1) + * Quaternion::rotation_y(movement1 * -0.35 + movement2 * 0.25) + * Quaternion::rotation_z(movement1 * -0.25 + movement2 * 0.5); + + next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.0 + movement2abs * -0.2) + * Quaternion::rotation_y(movement1 * 0.0) + * Quaternion::rotation_z(movement1 * -0.10 + movement1 * 0.15); + + next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + twitch2 * -0.4); + + next.tail.orientation = + Quaternion::rotation_z(movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror); + next.torso_front.position = Vec3::new( + 0.0, + s_a.torso_front.0 + movement1abs * -4.0, + s_a.torso_front.1, + ); + next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25) + * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45); + + next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25) + * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65); + + next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2); + if speed < 0.5 { + next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6) + * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) + * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45); + + next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3); + + next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3); + + next.foot_fl.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_fr.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6); + + next.foot_bl.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + + next.foot_br.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3); + }; +} diff --git a/voxygen/anim/src/quadruped_small/alpha.rs b/voxygen/anim/src/quadruped_small/alpha.rs index fa8f1e431c..69510a0d51 100644 --- a/voxygen/anim/src/quadruped_small/alpha.rs +++ b/voxygen/anim/src/quadruped_small/alpha.rs @@ -8,7 +8,7 @@ use common::states::utils::StageSection; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); + type Dependency<'a> = (f32, StageSection, f32); type Skeleton = QuadrupedSmallSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -17,7 +17,7 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_small_alpha")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, + (global_time, stage_section, timer): Self::Dependency<'_>, anim_time: f32, _rate: &mut f32, _s_a: &SkeletonAttr, @@ -25,9 +25,9 @@ impl Animation for AlphaAnimation { let mut next = (*skeleton).clone(); let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), + StageSection::Buildup => (anim_time.sqrt(), 0.0, 0.0), + StageSection::Action => (1.0, anim_time.powi(4), 0.0), + StageSection::Recover => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; let pullback = 1.0 - movement3; diff --git a/voxygen/anim/src/theropod/alpha.rs b/voxygen/anim/src/theropod/alpha.rs deleted file mode 100644 index ee9ecf8903..0000000000 --- a/voxygen/anim/src/theropod/alpha.rs +++ /dev/null @@ -1,66 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - SkeletonAttr, TheropodSkeleton, -}; -use common::states::utils::StageSection; - -pub struct AlphaAnimation; - -impl Animation for AlphaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = TheropodSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"theropod_alpha\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_alpha")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - _s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; - - next.head.orientation = Quaternion::rotation_x(movement1abs * 0.2) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.2); - next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.3) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.1); - - next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); - - next.chest_front.orientation = Quaternion::rotation_x(movement1abs * -0.2); - next.chest_back.orientation = Quaternion::rotation_x(movement1abs * 0.2); - - next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.1); - - next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.1); - next.foot_l.orientation = Quaternion::rotation_x(movement1abs * -0.3); - next.foot_r.orientation = Quaternion::rotation_x(movement1abs * -0.3); - - next.tail_front.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) - * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); - - next.tail_back.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) - * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); - next - } -} diff --git a/voxygen/anim/src/theropod/beta.rs b/voxygen/anim/src/theropod/beta.rs deleted file mode 100644 index 12f0db1367..0000000000 --- a/voxygen/anim/src/theropod/beta.rs +++ /dev/null @@ -1,65 +0,0 @@ -use super::{ - super::{vek::*, Animation}, - SkeletonAttr, TheropodSkeleton, -}; -use common::states::utils::StageSection; -//use std::ops::Rem; - -pub struct BetaAnimation; - -impl Animation for BetaAnimation { - type Dependency<'a> = (f32, f32, Option, f32); - type Skeleton = TheropodSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"theropod_beta\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_beta")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (_velocity, global_time, stage_section, timer): Self::Dependency<'_>, - anim_time: f32, - _rate: &mut f32, - _s_a: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - let (movement1base, movement2base, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0), - Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time), - _ => (0.0, 0.0, 0.0), - }; - let pullback = 1.0 - movement3; - let subtract = global_time - timer; - let check = subtract - subtract.trunc(); - let mirror = (check - 0.5).signum(); - let movement1 = mirror * movement1base * pullback; - let movement2 = mirror * movement2base * pullback; - let movement1abs = movement1base * pullback; - let movement2abs = movement2base * pullback; - - next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.2) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); - next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.4 + movement2abs * -1.2) - * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); - - next.chest_front.orientation = - Quaternion::rotation_x(movement1abs * 0.6 + movement2abs * -1.5); - next.chest_back.orientation = - Quaternion::rotation_x(movement1abs * -0.6 + movement2abs * 1.5); - - next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.5); - - next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.5); - next.foot_l.orientation = Quaternion::rotation_x(movement1abs * 0.4); - next.foot_r.orientation = Quaternion::rotation_x(movement1abs * 0.4); - - next.tail_front.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); - - next.tail_back.orientation = - Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); - next - } -} diff --git a/voxygen/anim/src/theropod/combomelee.rs b/voxygen/anim/src/theropod/combomelee.rs new file mode 100644 index 0000000000..609091fbe8 --- /dev/null +++ b/voxygen/anim/src/theropod/combomelee.rs @@ -0,0 +1,118 @@ +use super::{ + super::{vek::*, Animation}, + SkeletonAttr, TheropodSkeleton, +}; +use common::states::utils::StageSection; + +pub struct ComboAnimation; + +impl Animation for ComboAnimation { + type Dependency<'a> = (Option<&'a str>, StageSection, usize, f32, f32); + type Skeleton = TheropodSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"theropod_combo\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "theropod_combo")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (_ability_id, stage_section, current_strike, global_time, timer): Self::Dependency<'_>, + anim_time: f32, + _rate: &mut f32, + _s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let multi_strike_pullback = 1.0 + - if matches!(stage_section, StageSection::Recover) { + anim_time.powi(4) + } else { + 0.0 + }; + + for strike in 0..=current_strike { + match strike { + 0 => { + let (movement1base, movement2base) = match stage_section { + StageSection::Buildup => (anim_time.powi(2), 0.0), + StageSection::Action => (1.0, anim_time.powi(4)), + _ => (0.0, 0.0), + }; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = mirror * movement1base * multi_strike_pullback; + let movement2 = mirror * movement2base * multi_strike_pullback; + let movement1abs = movement1base * multi_strike_pullback; + let movement2abs = movement2base * multi_strike_pullback; + + next.head.orientation = Quaternion::rotation_x(movement1abs * 0.2) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.2); + next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.3) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.1); + + next.jaw.orientation = + Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5); + + next.chest_front.orientation = Quaternion::rotation_x(movement1abs * -0.2); + next.chest_back.orientation = Quaternion::rotation_x(movement1abs * 0.2); + + next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.1); + + next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.1); + next.foot_l.orientation = Quaternion::rotation_x(movement1abs * -0.3); + next.foot_r.orientation = Quaternion::rotation_x(movement1abs * -0.3); + + next.tail_front.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) + * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); + + next.tail_back.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3) + * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2); + }, + 1 | 2 => { + let (movement1base, movement2base) = match stage_section { + StageSection::Buildup => (anim_time.powi(2), 0.0), + StageSection::Action => (1.0, anim_time.powi(4)), + _ => (0.0, 0.0), + }; + let subtract = global_time - timer; + let check = subtract - subtract.trunc(); + let mirror = (check - 0.5).signum(); + let movement1 = mirror * movement1base * multi_strike_pullback; + let movement2 = mirror * movement2base * multi_strike_pullback; + let movement1abs = movement1base * multi_strike_pullback; + let movement2abs = movement2base * multi_strike_pullback; + + next.head.orientation = + Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.2) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); + next.neck.orientation = + Quaternion::rotation_x(movement1abs * 0.4 + movement2abs * -1.2) + * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1); + + next.chest_front.orientation = + Quaternion::rotation_x(movement1abs * 0.6 + movement2abs * -1.5); + next.chest_back.orientation = + Quaternion::rotation_x(movement1abs * -0.6 + movement2abs * 1.5); + + next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.5); + + next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.5); + next.foot_l.orientation = Quaternion::rotation_x(movement1abs * 0.4); + next.foot_r.orientation = Quaternion::rotation_x(movement1abs * 0.4); + + next.tail_front.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); + + next.tail_back.orientation = + Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3); + }, + _ => {}, + } + } + + next + } +} diff --git a/voxygen/anim/src/theropod/mod.rs b/voxygen/anim/src/theropod/mod.rs index 51e1e4b130..18d8ebc100 100644 --- a/voxygen/anim/src/theropod/mod.rs +++ b/voxygen/anim/src/theropod/mod.rs @@ -1,5 +1,4 @@ -pub mod alpha; -pub mod beta; +pub mod combomelee; pub mod dash; pub mod idle; pub mod jump; @@ -7,8 +6,8 @@ pub mod run; // Reexports pub use self::{ - alpha::AlphaAnimation, beta::BetaAnimation, dash::DashAnimation, idle::IdleAnimation, - jump::JumpAnimation, run::RunAnimation, + combomelee::ComboAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, + run::RunAnimation, }; use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton}; diff --git a/voxygen/egui/src/character_states.rs b/voxygen/egui/src/character_states.rs index b2dec83c46..81b8761999 100644 --- a/voxygen/egui/src/character_states.rs +++ b/voxygen/egui/src/character_states.rs @@ -1,7 +1,7 @@ use crate::{widgets::two_col_row, SelectedEntityInfo}; use common::{ comp::CharacterState, - states::{charged_melee, combo_melee, dash_melee, leap_melee}, + states::{charged_melee, dash_melee, leap_melee}, }; use egui::{Grid, Ui}; @@ -15,9 +15,6 @@ pub fn draw_char_state_group( ui.label(character_state.to_string()); }); match character_state { - CharacterState::ComboMelee(data) => { - combo_melee_grid(ui, data); - }, CharacterState::DashMelee(data) => dash_melee_grid(ui, data), CharacterState::ChargedMelee(data) => charged_melee_grid(ui, data), // Character states with no associated data to display @@ -47,18 +44,6 @@ fn charged_melee_grid(ui: &mut Ui, data: &charged_melee::Data) { }); } -fn combo_melee_grid(ui: &mut Ui, data: &combo_melee::Data) { - Grid::new("selected_entity_combo_melee_grid") - .spacing([40.0, 4.0]) - .max_col_width(100.0) - .striped(true) - .show(ui, |ui| #[rustfmt::skip] { - two_col_row(ui, "Stage", data.stage.to_string()); - two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis())); - two_col_row(ui, "num_stages", data.static_data.num_stages.to_string()); - }); -} - fn dash_melee_grid(ui: &mut Ui, data: &dash_melee::Data) { Grid::new("selected_entity_dash_melee_grid") .spacing([40.0, 4.0]) diff --git a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs index 6de8f43ecc..62932b61d0 100644 --- a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs @@ -115,128 +115,6 @@ fn maps_basic_melee() { ); } -#[test] -fn matches_ability_stage() { - let loadout = LoadoutBuilder::empty() - .active_mainhand(Some(Item::new_from_asset_expect( - "common.items.weapons.sword.starter", - ))) - .build(); - let inventory = Inventory::with_loadout_humanoid(loadout); - - let result = CombatEventMapper::map_event( - &CharacterState::ComboMelee(states::combo_melee::Data { - static_data: states::combo_melee::StaticData { - num_stages: 1, - stage_data: vec![states::combo_melee::Stage { - stage: 1, - base_damage: 100.0, - base_poise_damage: 100.0, - damage_increase: 10.0, - poise_damage_increase: 10.0, - knockback: 10.0, - range: 4.0, - angle: 30.0, - base_buildup_duration: Duration::from_millis(500), - base_swing_duration: Duration::from_millis(200), - hit_timing: 0.5, - base_recover_duration: Duration::from_millis(400), - forward_movement: 0.5, - damage_kind: DamageKind::Slashing, - damage_effect: None, - }], - initial_energy_gain: 0.0, - max_energy_gain: 100.0, - energy_increase: 20.0, - speed_increase: 0.05, - max_speed_increase: 0.8, - scales_from_combo: 2, - ori_modifier: 1.0, - ability_info: empty_ability_info(), - }, - exhausted: false, - stage: 1, - timer: Duration::default(), - stage_section: states::utils::StageSection::Action, - }), - &PreviousEntityState { - event: SfxEvent::Idle, - time: Instant::now(), - weapon_drawn: true, - }, - &inventory, - ); - - assert_eq!( - result, - SfxEvent::Attack( - CharacterAbilityType::ComboMelee(states::utils::StageSection::Action, 1), - ToolKind::Sword - ) - ); -} - -#[test] -fn ignores_different_ability_stage() { - let loadout = LoadoutBuilder::empty() - .active_mainhand(Some(Item::new_from_asset_expect( - "common.items.weapons.axe.starter_axe", - ))) - .build(); - let inventory = Inventory::with_loadout_humanoid(loadout); - - let result = CombatEventMapper::map_event( - &CharacterState::ComboMelee(states::combo_melee::Data { - static_data: states::combo_melee::StaticData { - num_stages: 1, - stage_data: vec![states::combo_melee::Stage { - stage: 1, - base_damage: 100.0, - base_poise_damage: 100.0, - damage_increase: 100.0, - poise_damage_increase: 10.0, - knockback: 10.0, - range: 4.0, - angle: 30.0, - base_buildup_duration: Duration::from_millis(500), - base_swing_duration: Duration::from_millis(200), - hit_timing: 0.5, - base_recover_duration: Duration::from_millis(400), - forward_movement: 0.5, - damage_kind: DamageKind::Slashing, - damage_effect: None, - }], - initial_energy_gain: 0.0, - max_energy_gain: 100.0, - energy_increase: 20.0, - speed_increase: 0.05, - max_speed_increase: 0.8, - scales_from_combo: 2, - ori_modifier: 1.0, - ability_info: empty_ability_info(), - }, - exhausted: false, - stage: 1, - timer: Duration::default(), - stage_section: states::utils::StageSection::Action, - }), - &PreviousEntityState { - event: SfxEvent::Idle, - time: Instant::now(), - weapon_drawn: true, - }, - &inventory, - ); - - assert_ne!( - result, - SfxEvent::Attack( - CharacterAbilityType::ComboMelee(states::utils::StageSection::Action, 2), - ToolKind::Sword - ) - ); -} - fn empty_ability_info() -> states::utils::AbilityInfo { states::utils::AbilityInfo { tool: None, diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 4fccce9e88..c1b1dc29b2 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -71,13 +71,6 @@ //! ], //! threshold: 1.2, //! ), -//! // A multi-stage attack ability which depends on the weapon -//! Attack(ComboMelee(Swing, 1), Sword): ( -//! files: [ -//! "voxygen.audio.sfx.abilities.swing_sword", -//! ], -//! threshold: 0.5, -//! ), //! ``` mod event_mapper; diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 11858e1f84..3683843c6b 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1835,7 +1835,7 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { + CharacterState::ComboMeleeDeprecated(s) => { let stage_index = (s.stage - 1) as usize; let stage_time = s.timer.as_secs_f32(); let stage_progress = @@ -2313,40 +2313,29 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; + CharacterState::BasicMelee(s) => { let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - { - anim::quadruped_small::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ) - } + + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + stage_time / s.static_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f32() + }, + + _ => 0.0, + }; + anim::quadruped_small::AlphaAnimation::update_skeleton( + &target_base, + (time, s.stage_section, state.state_time), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ) }, CharacterState::ComboMelee2(s) => { let timer = s.timer.as_secs_f32(); @@ -2675,65 +2664,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::quadruped_medium::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - 2 => anim::quadruped_medium::BetaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::quadruped_medium::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::ComboMelee2(s) => { let timer = s.timer.as_secs_f32(); let current_strike = s.completed_strikes % s.static_data.strikes.len(); @@ -2755,9 +2685,9 @@ impl FigureMgr { &target_base, ( ability_id, - Some(s.stage_section), - Some(s.static_data.ability_info), + s.stage_section, current_strike, + rel_vel.magnitude(), time, state.state_time, ), @@ -3028,12 +2958,7 @@ impl FigureMgr { }; anim::quadruped_low::BetaAnimation::update_skeleton( &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), + (rel_vel.magnitude(), time, s.stage_section, state.state_time), stage_progress, &mut state_animation_rate, skeleton_attr, @@ -3141,8 +3066,7 @@ impl FigureMgr { &target_base, ( ability_id, - Some(s.stage_section), - Some(s.static_data.ability_info), + s.stage_section, current_strike, time, state.state_time, @@ -3152,65 +3076,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::quadruped_low::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - 2 => anim::quadruped_low::BetaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::quadruped_low::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::BasicBeam(s) => { let stage_time = s.timer.as_secs_f32(); let stage_progress = match s.stage_section { @@ -3417,27 +3282,20 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; + CharacterState::BasicMelee(s) => { let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + stage_time / s.static_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; anim::bird_medium::AlphaAnimation::update_skeleton( &target_base, ( @@ -3878,10 +3736,11 @@ impl FigureMgr { &target_base, ( ability_id, - Some(s.stage_section), - Some(s.static_data.ability_info), + s.stage_section, current_strike, - move_dir, + rel_vel, + time, + state.state_time, ), progress, &mut state_animation_rate, @@ -4054,65 +3913,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::biped_small::AlphaAnimation::update_skeleton( - &target_base, - ( - ability_id, - active_tool_kind, - rel_vel, - ori * anim::vek::Vec3::::unit_y(), - state.last_ori * anim::vek::Vec3::::unit_y(), - time, - rel_avg_vel, - state.acc_vel, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::biped_small::AlphaAnimation::update_skeleton( - &target_base, - ( - ability_id, - active_tool_kind, - rel_vel, - ori * anim::vek::Vec3::::unit_y(), - state.last_ori * anim::vek::Vec3::::unit_y(), - time, - rel_avg_vel, - state.acc_vel, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::BasicMelee(s) => { let stage_time = s.timer.as_secs_f32(); let stage_progress = match s.stage_section { @@ -4431,52 +4231,36 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::theropod::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, + CharacterState::ComboMelee2(s) => { + let timer = s.timer.as_secs_f32(); + let current_strike = s.completed_strikes % s.static_data.strikes.len(); + let strike_data = s.static_data.strikes[current_strike]; + let progress = match s.stage_section { + StageSection::Buildup => { + timer / strike_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + timer / strike_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + timer / strike_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; + + anim::theropod::ComboAnimation::update_skeleton( + &target_base, + ( + ability_id, + s.stage_section, + current_strike, + time, + state.state_time, ), - _ => anim::theropod::BetaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } + progress, + &mut state_animation_rate, + skeleton_attr, + ) }, CharacterState::DashMelee(s) => { let stage_time = s.timer.as_secs_f32(); @@ -4610,52 +4394,36 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::arthropod::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, + CharacterState::ComboMelee2(s) => { + let timer = s.timer.as_secs_f32(); + let current_strike = s.completed_strikes % s.static_data.strikes.len(); + let strike_data = s.static_data.strikes[current_strike]; + let progress = match s.stage_section { + StageSection::Buildup => { + timer / strike_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + timer / strike_data.swing_duration.as_secs_f32() + }, + StageSection::Recover => { + timer / strike_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; + + anim::arthropod::ComboAnimation::update_skeleton( + &target_base, + ( + ability_id, + s.stage_section, + current_strike, + time, + state.state_time, ), - _ => anim::arthropod::AlphaAnimation::update_skeleton( - &target_base, - ( - rel_vel.magnitude(), - time, - Some(s.stage_section), - state.state_time, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } + progress, + &mut state_animation_rate, + skeleton_attr, + ) }, CharacterState::LeapMelee(s) => { let stage_time = s.timer.as_secs_f32(); @@ -5733,6 +5501,8 @@ impl FigureMgr { Some(s.static_data.ability_info), current_strike, move_dir, + rel_vel, + state.acc_vel, ), progress, &mut state_animation_rate, @@ -5899,75 +5669,6 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - match s.stage { - 1 => anim::biped_large::AlphaAnimation::update_skeleton( - &target_base, - ( - active_tool_kind, - (second_tool_kind, second_tool_spec), - rel_vel, - time, - Some(s.stage_section), - state.acc_vel, - state.state_time, - ability_id, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - 2 => anim::biped_large::BetaAnimation::update_skeleton( - &target_base, - ( - active_tool_kind, - (second_tool_kind, second_tool_spec), - rel_vel, - time, - Some(s.stage_section), - state.acc_vel, - ability_id, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - _ => anim::biped_large::BetaAnimation::update_skeleton( - &target_base, - ( - active_tool_kind, - (second_tool_kind, second_tool_spec), - rel_vel, - time, - Some(s.stage_section), - state.acc_vel, - ability_id, - ), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ), - } - }, CharacterState::RapidMelee(s) => { let stage_time = s.timer.as_secs_f32(); let stage_progress = match s.stage_section { @@ -6288,35 +5989,6 @@ impl FigureMgr { ), }; let target_bones = match &character { - CharacterState::ComboMelee(s) => { - let stage_index = (s.stage - 1) as usize; - let stage_time = s.timer.as_secs_f32(); - let stage_progress = - if let Some(stage) = s.static_data.stage_data.get(stage_index) { - match s.stage_section { - StageSection::Buildup => { - stage_time / stage.base_buildup_duration.as_secs_f32() - }, - StageSection::Action => { - stage_time / stage.base_swing_duration.as_secs_f32() - }, - StageSection::Recover => { - stage_time / stage.base_recover_duration.as_secs_f32() - }, - _ => 0.0, - } - } else { - 0.0 - }; - - anim::golem::AlphaAnimation::update_skeleton( - &target_base, - (Some(s.stage_section), time, state.state_time, ability_id), - stage_progress, - &mut state_animation_rate, - skeleton_attr, - ) - }, CharacterState::BasicRanged(s) => { let stage_time = s.timer.as_secs_f32();