From 62eaabfe88fcc54a72ddcec9e56f00559ccf8288 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Fri, 11 Jun 2021 22:00:06 +0300 Subject: [PATCH] Introduce hit_timing for combo_melee bonus: speeding up first swing of sword from 0.15 to 0.1 and reducing poise damage of hammer from 25 to 20 --- assets/common/abilities/axe/doublestrike.ron | 2 ++ .../abilities/axesimple/doublestrike.ron | 2 ++ .../custom/basilisk/singlestrike.ron | 1 + .../custom/basilisk/triplestrike.ron | 3 ++ .../custom/birdlargebreathe/triplestrike.ron | 3 ++ .../custom/birdlargefire/triplestrike.ron | 3 ++ .../abilities/custom/husk/singlestrike.ron | 1 + .../abilities/custom/husk/triplestrike.ron | 3 ++ .../custom/quadlowbasic/singlestrike.ron | 1 + .../custom/quadlowbasic/triplestrike.ron | 3 ++ .../custom/quadlowbreathe/triplestrike.ron | 3 ++ .../custom/quadlowquick/quadstrike.ron | 4 +++ .../custom/quadlowranged/singlestrike.ron | 1 + .../custom/quadlowtail/triplestrike.ron | 3 ++ .../custom/quadmedbasic/singlestrike.ron | 1 + .../custom/quadmedbasic/triplestrike.ron | 3 ++ .../custom/quadmedcharge/doublestrike.ron | 2 ++ .../custom/quadmedjump/doublestrike.ron | 2 ++ .../custom/quadmedquick/triplestrike.ron | 3 ++ .../custom/quadsmallbasic/singlestrike.ron | 1 + .../custom/stonegolemfist/singlestrike.ron | 1 + .../custom/theropodbasic/singlestrike.ron | 1 + .../custom/theropodbasic/triplestrike.ron | 3 ++ .../custom/theropodbird/singlestrike.ron | 1 + .../custom/theropodbird/triplestrike.ron | 3 ++ .../custom/wendigomagic/singlestrike.ron | 1 + .../common/abilities/hammer/singlestrike.ron | 3 +- .../abilities/hammersimple/doublestrike.ron | 2 ++ .../common/abilities/spear/doublestrike.ron | 2 ++ .../common/abilities/sword/triplestrike.ron | 5 ++- .../abilities/swordsimple/doublestrike.ron | 2 ++ common/src/comp/ability.rs | 1 + common/src/states/charged_melee.rs | 2 +- common/src/states/combo_melee.rs | 36 ++++++++++++++++--- .../audio/sfx/event_mapper/combat/tests.rs | 4 +++ 35 files changed, 104 insertions(+), 8 deletions(-) diff --git a/assets/common/abilities/axe/doublestrike.ron b/assets/common/abilities/axe/doublestrike.ron index 545aab3ae9..029bb4cdaf 100644 --- a/assets/common/abilities/axe/doublestrike.ron +++ b/assets/common/abilities/axe/doublestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 50.0, base_buildup_duration: 0.15, base_swing_duration: 0.075, + hit_timing: 0.6, base_recover_duration: 0.35, forward_movement: 0.5, damage_kind: Slashing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.2, base_swing_duration: 0.1, + hit_timing: 0.6, base_recover_duration: 0.35, forward_movement: 0.25, damage_kind: Slashing, diff --git a/assets/common/abilities/axesimple/doublestrike.ron b/assets/common/abilities/axesimple/doublestrike.ron index 2a87b78073..d97b3dbcce 100644 --- a/assets/common/abilities/axesimple/doublestrike.ron +++ b/assets/common/abilities/axesimple/doublestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 50.0, base_buildup_duration: 0.6, base_swing_duration: 0.12, + hit_timing: 0.5, base_recover_duration: 0.6, forward_movement: 3.5, damage_kind: Slashing, @@ -26,6 +27,7 @@ ComboMelee( angle: 15.0, base_buildup_duration: 0.5, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 1.2, forward_movement: 4.5, damage_kind: Slashing, diff --git a/assets/common/abilities/custom/basilisk/singlestrike.ron b/assets/common/abilities/custom/basilisk/singlestrike.ron index 3f21ccc88a..65846146d6 100644 --- a/assets/common/abilities/custom/basilisk/singlestrike.ron +++ b/assets/common/abilities/custom/basilisk/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 60.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 3.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/basilisk/triplestrike.ron b/assets/common/abilities/custom/basilisk/triplestrike.ron index fced56cfda..cd4942d2bb 100644 --- a/assets/common/abilities/custom/basilisk/triplestrike.ron +++ b/assets/common/abilities/custom/basilisk/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 2.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/birdlargebreathe/triplestrike.ron b/assets/common/abilities/custom/birdlargebreathe/triplestrike.ron index eb332435a4..b0a727e645 100644 --- a/assets/common/abilities/custom/birdlargebreathe/triplestrike.ron +++ b/assets/common/abilities/custom/birdlargebreathe/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 2.0, damage_kind: Slashing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Slashing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Slashing, diff --git a/assets/common/abilities/custom/birdlargefire/triplestrike.ron b/assets/common/abilities/custom/birdlargefire/triplestrike.ron index eb332435a4..b0a727e645 100644 --- a/assets/common/abilities/custom/birdlargefire/triplestrike.ron +++ b/assets/common/abilities/custom/birdlargefire/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 2.0, damage_kind: Slashing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Slashing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Slashing, diff --git a/assets/common/abilities/custom/husk/singlestrike.ron b/assets/common/abilities/custom/husk/singlestrike.ron index 5d4aa94c8b..92e1e2d3eb 100644 --- a/assets/common/abilities/custom/husk/singlestrike.ron +++ b/assets/common/abilities/custom/husk/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 60.0, base_buildup_duration: 0.25, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.25, forward_movement: 0.5, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/husk/triplestrike.ron b/assets/common/abilities/custom/husk/triplestrike.ron index d14f182feb..25e985d3d2 100644 --- a/assets/common/abilities/custom/husk/triplestrike.ron +++ b/assets/common/abilities/custom/husk/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.2, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 1.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.22, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 0.0, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.2, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 1.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadlowbasic/singlestrike.ron b/assets/common/abilities/custom/quadlowbasic/singlestrike.ron index 8f60297e99..c0bd5a47fb 100644 --- a/assets/common/abilities/custom/quadlowbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadlowbasic/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 60.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 3.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadlowbasic/triplestrike.ron b/assets/common/abilities/custom/quadlowbasic/triplestrike.ron index 3fae8726f5..f7b49ad5ac 100644 --- a/assets/common/abilities/custom/quadlowbasic/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowbasic/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 2.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron b/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron index 19320571bb..6944d309f3 100644 --- a/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowbreathe/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 2.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadlowquick/quadstrike.ron b/assets/common/abilities/custom/quadlowquick/quadstrike.ron index 2bd6e570f3..3c7f848f43 100644 --- a/assets/common/abilities/custom/quadlowquick/quadstrike.ron +++ b/assets/common/abilities/custom/quadlowquick/quadstrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.6, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.1, forward_movement: 1.5, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.15, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.1, forward_movement: 0.8, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.2, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.1, forward_movement: 0.8, damage_kind: Crushing, @@ -56,6 +59,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.2, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.1, forward_movement: 0.8, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadlowranged/singlestrike.ron b/assets/common/abilities/custom/quadlowranged/singlestrike.ron index 7d36295027..81b81f3cd0 100644 --- a/assets/common/abilities/custom/quadlowranged/singlestrike.ron +++ b/assets/common/abilities/custom/quadlowranged/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 60.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 3.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadlowtail/triplestrike.ron b/assets/common/abilities/custom/quadlowtail/triplestrike.ron index a35efe048e..457328d1c0 100644 --- a/assets/common/abilities/custom/quadlowtail/triplestrike.ron +++ b/assets/common/abilities/custom/quadlowtail/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 2.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.2, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 1.0, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.2, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 1.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadmedbasic/singlestrike.ron b/assets/common/abilities/custom/quadmedbasic/singlestrike.ron index fef9810b42..2dcb7c3eb5 100644 --- a/assets/common/abilities/custom/quadmedbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadmedbasic/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 60.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 1.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadmedbasic/triplestrike.ron b/assets/common/abilities/custom/quadmedbasic/triplestrike.ron index 4b8544b345..1a5577da1d 100644 --- a/assets/common/abilities/custom/quadmedbasic/triplestrike.ron +++ b/assets/common/abilities/custom/quadmedbasic/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.45, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 1.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 0.0, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.07, + hit_timing: 0.5, base_recover_duration: 0.2, forward_movement: 1.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron index 9ec940c20f..83ba1ae46b 100644 --- a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron +++ b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 0.5, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadmedjump/doublestrike.ron b/assets/common/abilities/custom/quadmedjump/doublestrike.ron index 635eb2bfac..d57e0c63df 100644 --- a/assets/common/abilities/custom/quadmedjump/doublestrike.ron +++ b/assets/common/abilities/custom/quadmedjump/doublestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.65, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.4, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.5, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadmedquick/triplestrike.ron b/assets/common/abilities/custom/quadmedquick/triplestrike.ron index cdf07c952d..596df64343 100644 --- a/assets/common/abilities/custom/quadmedquick/triplestrike.ron +++ b/assets/common/abilities/custom/quadmedquick/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 40.0, base_buildup_duration: 0.6, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 0.3, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 40.0, base_buildup_duration: 0.4, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 0.5, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 40.0, base_buildup_duration: 0.4, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 0.5, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron b/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron index 4ce36a7a0f..0448be9345 100644 --- a/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron +++ b/assets/common/abilities/custom/quadsmallbasic/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 50.0, base_buildup_duration: 0.3, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/stonegolemfist/singlestrike.ron b/assets/common/abilities/custom/stonegolemfist/singlestrike.ron index 74d2853a78..0c22b0bdb7 100644 --- a/assets/common/abilities/custom/stonegolemfist/singlestrike.ron +++ b/assets/common/abilities/custom/stonegolemfist/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 60.0, base_buildup_duration: 0.9, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.9, forward_movement: 3.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/theropodbasic/singlestrike.ron b/assets/common/abilities/custom/theropodbasic/singlestrike.ron index 17c2f98b28..08cf1209e4 100644 --- a/assets/common/abilities/custom/theropodbasic/singlestrike.ron +++ b/assets/common/abilities/custom/theropodbasic/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 60.0, base_buildup_duration: 0.5, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 3.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/theropodbasic/triplestrike.ron b/assets/common/abilities/custom/theropodbasic/triplestrike.ron index 5c19bf5d62..c8766e2bbd 100644 --- a/assets/common/abilities/custom/theropodbasic/triplestrike.ron +++ b/assets/common/abilities/custom/theropodbasic/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.9, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.5, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.15, forward_movement: 1.0, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.35, base_swing_duration: 0.125, + hit_timing: 0.5, base_recover_duration: 0.9, forward_movement: 1.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/theropodbird/singlestrike.ron b/assets/common/abilities/custom/theropodbird/singlestrike.ron index db41b51c21..1401500a4b 100644 --- a/assets/common/abilities/custom/theropodbird/singlestrike.ron +++ b/assets/common/abilities/custom/theropodbird/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 15.0, base_buildup_duration: 0.4, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 3.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/theropodbird/triplestrike.ron b/assets/common/abilities/custom/theropodbird/triplestrike.ron index 0ae2472f83..9693aa46d0 100644 --- a/assets/common/abilities/custom/theropodbird/triplestrike.ron +++ b/assets/common/abilities/custom/theropodbird/triplestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 15.0, base_buildup_duration: 0.65, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 1.0, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 15.0, base_buildup_duration: 0.4, base_swing_duration: 0.15, + hit_timing: 0.5, base_recover_duration: 0.15, forward_movement: 1.0, damage_kind: Crushing, @@ -41,6 +43,7 @@ ComboMelee( angle: 15.0, base_buildup_duration: 0.35, base_swing_duration: 0.125, + hit_timing: 0.5, base_recover_duration: 0.9, forward_movement: 1.0, damage_kind: Crushing, diff --git a/assets/common/abilities/custom/wendigomagic/singlestrike.ron b/assets/common/abilities/custom/wendigomagic/singlestrike.ron index c6fe60fade..39185a761d 100644 --- a/assets/common/abilities/custom/wendigomagic/singlestrike.ron +++ b/assets/common/abilities/custom/wendigomagic/singlestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.6, base_swing_duration: 0.2, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 5.0, damage_kind: Crushing, diff --git a/assets/common/abilities/hammer/singlestrike.ron b/assets/common/abilities/hammer/singlestrike.ron index 5a7657c7ea..85da88b26e 100644 --- a/assets/common/abilities/hammer/singlestrike.ron +++ b/assets/common/abilities/hammer/singlestrike.ron @@ -3,13 +3,14 @@ ComboMelee( stage: 1, base_damage: 150, damage_increase: 10, - base_poise_damage: 25, + base_poise_damage: 20, poise_damage_increase: 0, knockback: 5.0, range: 4.5, angle: 50.0, base_buildup_duration: 0.2, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.45, forward_movement: 0.0, damage_kind: Crushing, diff --git a/assets/common/abilities/hammersimple/doublestrike.ron b/assets/common/abilities/hammersimple/doublestrike.ron index 4bc8e7f3b2..13d7423c1e 100644 --- a/assets/common/abilities/hammersimple/doublestrike.ron +++ b/assets/common/abilities/hammersimple/doublestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 50.0, base_buildup_duration: 0.6, base_swing_duration: 0.08, + hit_timing: 0.5, base_recover_duration: 0.6, forward_movement: 3.5, damage_kind: Crushing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.5, base_swing_duration: 0.25, + hit_timing: 0.5, base_recover_duration: 1.2, forward_movement: 2.0, damage_kind: Crushing, diff --git a/assets/common/abilities/spear/doublestrike.ron b/assets/common/abilities/spear/doublestrike.ron index e7e1c92980..075850a90c 100644 --- a/assets/common/abilities/spear/doublestrike.ron +++ b/assets/common/abilities/spear/doublestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 15.0, base_buildup_duration: 0.35, base_swing_duration: 0.075, + hit_timing: 0.5, base_recover_duration: 0.4, forward_movement: 0.7, damage_kind: Piercing, @@ -26,6 +27,7 @@ ComboMelee( angle: 15.0, base_buildup_duration: 0.5, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.5, forward_movement: 0.7, damage_kind: Piercing, diff --git a/assets/common/abilities/sword/triplestrike.ron b/assets/common/abilities/sword/triplestrike.ron index ea05f387d8..b078f9f180 100644 --- a/assets/common/abilities/sword/triplestrike.ron +++ b/assets/common/abilities/sword/triplestrike.ron @@ -9,8 +9,9 @@ ComboMelee( knockback: 1.0, range: 4.0, angle: 30.0, - base_buildup_duration: 0.15, + base_buildup_duration: 0.1, base_swing_duration: 0.075, + hit_timing: 0.5, base_recover_duration: 0.15, forward_movement: 0.5, damage_kind: Slashing, @@ -26,6 +27,7 @@ ComboMelee( angle: 40.0, base_buildup_duration: 0.1, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.3, forward_movement: 0.0, damage_kind: Slashing, @@ -41,6 +43,7 @@ ComboMelee( angle: 10.0, base_buildup_duration: 0.15, base_swing_duration: 0.1, + hit_timing: 0.2, base_recover_duration: 0.35, forward_movement: 1.2, damage_kind: Piercing, diff --git a/assets/common/abilities/swordsimple/doublestrike.ron b/assets/common/abilities/swordsimple/doublestrike.ron index 5aefeb50a6..f8a9b3860e 100644 --- a/assets/common/abilities/swordsimple/doublestrike.ron +++ b/assets/common/abilities/swordsimple/doublestrike.ron @@ -11,6 +11,7 @@ ComboMelee( angle: 50.0, base_buildup_duration: 0.4, base_swing_duration: 0.08, + hit_timing: 0.5, base_recover_duration: 0.5, forward_movement: 2.5, damage_kind: Slashing, @@ -26,6 +27,7 @@ ComboMelee( angle: 30.0, base_buildup_duration: 0.7, base_swing_duration: 0.1, + hit_timing: 0.5, base_recover_duration: 0.7, forward_movement: 2.0, damage_kind: Slashing, diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 8ab75b8928..d0eeb5d074 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1383,6 +1383,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState { ori_modifier: *ori_modifier as f32, ability_info, }, + exhausted: false, stage: 1, timer: Duration::default(), stage_section: StageSection::Buildup, diff --git a/common/src/states/charged_melee.rs b/common/src/states/charged_melee.rs index 7ad6b9cb04..27d5c11896 100644 --- a/common/src/states/charged_melee.rs +++ b/common/src/states/charged_melee.rs @@ -62,7 +62,7 @@ pub struct Data { pub stage_section: StageSection, /// Timer for each stage pub timer: Duration, - /// Whether the attack fired already + /// Whether the attack executed already pub exhausted: bool, /// How much the attack charged by pub charge_amount: f32, diff --git a/common/src/states/combo_melee.rs b/common/src/states/combo_melee.rs index a59315043a..fd547dfd6a 100644 --- a/common/src/states/combo_melee.rs +++ b/common/src/states/combo_melee.rs @@ -33,6 +33,8 @@ pub struct Stage { /// Duration of stage spent in swing (controls animation stuff, and can also /// be used to handle movement separately to buildup) pub base_swing_duration: T, + /// At what fraction of the swing duration to apply the melee "hit" + pub hit_timing: f32, /// Initial recover duration of stage (how long until character exits state) pub base_recover_duration: T, /// How much forward movement there is in the swing portion of the stage @@ -53,6 +55,7 @@ impl Stage { range: self.range, angle: self.angle, base_buildup_duration: Duration::from_secs_f32(self.base_buildup_duration), + hit_timing: self.hit_timing, base_swing_duration: Duration::from_secs_f32(self.base_swing_duration), base_recover_duration: Duration::from_secs_f32(self.base_recover_duration), forward_movement: self.forward_movement, @@ -112,6 +115,8 @@ pub struct Data { /// Struct containing data that does not change over the course of the /// character state pub static_data: StaticData, + /// Whether the attack was executed already + pub exhausted: bool, /// Indicates what stage the combo is in pub stage: u32, /// Timer for each stage @@ -155,8 +160,24 @@ impl CharacterBehavior for Data { stage_section: StageSection::Swing, ..*self }); + } + }, + StageSection::Swing => { + if self.timer.as_secs_f32() + > self.static_data.stage_data[stage_index].hit_timing + * self.static_data.stage_data[stage_index] + .base_swing_duration + .as_secs_f32() + && !self.exhausted + { + // Swing + update.character = CharacterState::ComboMelee(Data { + static_data: self.static_data.clone(), + timer: tick_attack_or_default(data, self.timer, None), + exhausted: true, + ..*self + }); - // Hit attempt let damage = self.static_data.stage_data[stage_index].base_damage + (self .static_data @@ -177,6 +198,7 @@ impl CharacterBehavior for Data { CombatEffect::Poise(poise), ) .with_requirement(CombatRequirement::AnyDamage); + let knockback = AttackEffect::new( Some(GroupTarget::OutOfGroup), CombatEffect::Knockback(Knockback { @@ -185,13 +207,17 @@ impl CharacterBehavior for Data { }), ) .with_requirement(CombatRequirement::AnyDamage); + let energy = self.static_data.max_energy_gain.min( self.static_data.initial_energy_gain + data.combo.counter() as f32 * self.static_data.energy_increase, ); + let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy)) .with_requirement(CombatRequirement::AnyDamage); + let buff = CombatEffect::Buff(CombatBuff::default_physical()); + let damage = AttackDamage::new( Damage { source: DamageSource::Melee, @@ -201,8 +227,10 @@ impl CharacterBehavior for Data { Some(GroupTarget::OutOfGroup), ) .with_effect(buff); + let (crit_chance, crit_mult) = get_crit_data(data, self.static_data.ability_info); + let attack = Attack::default() .with_damage(damage) .with_crit(crit_chance, crit_mult) @@ -228,10 +256,8 @@ impl CharacterBehavior for Data { }) .filter(|(_, tool)| tool == &Some(ToolKind::Pick)), }); - } - }, - StageSection::Swing => { - if self.timer < self.static_data.stage_data[stage_index].base_swing_duration { + } else if self.timer < self.static_data.stage_data[stage_index].base_swing_duration + { handle_orientation(data, &mut update, 0.4 * self.static_data.ori_modifier); // Forward movement diff --git a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs index a024d559ea..73df919023 100644 --- a/voxygen/src/audio/sfx/event_mapper/combat/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/combat/tests.rs @@ -128,6 +128,7 @@ fn matches_ability_stage() { 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, @@ -142,6 +143,7 @@ fn matches_ability_stage() { ori_modifier: 1.0, ability_info: empty_ability_info(), }, + exhausted: false, stage: 1, timer: Duration::default(), stage_section: states::utils::StageSection::Swing, @@ -187,6 +189,7 @@ fn ignores_different_ability_stage() { 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, @@ -201,6 +204,7 @@ fn ignores_different_ability_stage() { ori_modifier: 1.0, ability_info: empty_ability_info(), }, + exhausted: false, stage: 1, timer: Duration::default(), stage_section: states::utils::StageSection::Swing,