From 894710d8c6c5029c3cdc6c7c92ccd9b385afcd7e Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 9 Aug 2022 20:17:02 -0400 Subject: [PATCH] Offensive advance animation --- .../abilities/sword/offensive_advance.ron | 4 +- .../abilities/sword/offensive_combo.ron | 5 ++ .../abilities/sword/offensive_finisher.ron | 4 +- voxygen/anim/src/character/combomelee.rs | 46 +++++++++++++++++++ 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/assets/common/abilities/sword/offensive_advance.ron b/assets/common/abilities/sword/offensive_advance.ron index 58a75b3180..0eb61db7be 100644 --- a/assets/common/abilities/sword/offensive_advance.ron +++ b/assets/common/abilities/sword/offensive_advance.ron @@ -16,8 +16,8 @@ ComboMelee2( hit_timing: 0.6, recover_duration: 0.4, movement: ( - buildup: Some(Forward(2.5)), - swing: Some(Forward(1.0)), + buildup: Some(Forward(1.0)), + swing: Some(Forward(3.0)), recover: None, ), ori_modifier: 0.6, diff --git a/assets/common/abilities/sword/offensive_combo.ron b/assets/common/abilities/sword/offensive_combo.ron index e1b88a5fe7..375c51dc94 100644 --- a/assets/common/abilities/sword/offensive_combo.ron +++ b/assets/common/abilities/sword/offensive_combo.ron @@ -49,6 +49,11 @@ ComboMelee2( swing_duration: 0.3, hit_timing: 0.5, recover_duration: 0.1, + movement: ( + buildup: None, + swing: Some(Forward(0.5)), + recover: None, + ), ori_modifier: 0.6, ), ], diff --git a/assets/common/abilities/sword/offensive_finisher.ron b/assets/common/abilities/sword/offensive_finisher.ron index d411ea1f41..9fe0028a89 100644 --- a/assets/common/abilities/sword/offensive_finisher.ron +++ b/assets/common/abilities/sword/offensive_finisher.ron @@ -1,5 +1,5 @@ FinisherMelee( - energy_cost: 40, + energy_cost: /*40*/0, buildup_duration: 0.4, swing_duration: 0.1, recover_duration: 0.4, @@ -23,7 +23,7 @@ FinisherMelee( target: Attack, kind: Linear, )), - minimum_combo: 10, + minimum_combo: /*10*/0, meta: ( kind: Some(Sword(Offensive)), ), diff --git a/voxygen/anim/src/character/combomelee.rs b/voxygen/anim/src/character/combomelee.rs index c9551b5322..f527f9ad69 100644 --- a/voxygen/anim/src/character/combomelee.rs +++ b/voxygen/anim/src/character/combomelee.rs @@ -205,6 +205,52 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some("common.abilities.sword.offensive_advance") => { + let (move1, move2, move3, move2alt) = if strike == current_strike { + match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0, 0.0), + Some(StageSection::Action) => { + (1.0, anim_time.powi(2), 0.0, anim_time.powf(0.25)) + }, + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4), 1.0), + _ => (0.0, 0.0, 0.0, 0.0), + } + } else { + (1.0, 1.0, 0.0, 1.0) + }; + + next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2); + next.hand_l.orientation = + Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4); + next.hand_r.position = + Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0); + next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5); + next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2); + next.control.orientation = Quaternion::rotation_x(s_a.sc.3) + * Quaternion::rotation_z(move2.signum() * -PI / 2.0); + + next.control.orientation.rotate_x(move1 * 1.6 + move2 * 0.5); + next.chest.orientation = Quaternion::rotation_z(move1 * 1.0); + next.head.orientation = Quaternion::rotation_z(move1 * -0.7); + next.belt.orientation = Quaternion::rotation_z(move1 * -0.2); + next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5); + next.control.position += Vec3::new(0.0, 0.0, move1 * 5.0); + + next.chest.orientation.rotate_z(move2 * -1.9); + next.head.orientation.rotate_z(move2 * 1.4); + next.belt.orientation.rotate_z(move2 * 0.6); + next.shorts.orientation.rotate_z(move2 * 1.2); + next.control.orientation.rotate_z(move2 * -3.5); + next.control.position += Vec3::new(move2 * 9.0, move2 * 4.0, 0.0); + + next.chest.orientation.rotate_z(move3 * 0.7); + next.head.orientation.rotate_z(move3 * -0.4); + next.belt.orientation.rotate_z(move3 * -0.2); + next.shorts.orientation.rotate_z(move3 * -0.5); + next.control.orientation.rotate_z(move3 * 0.4); + next.control.orientation.rotate_x(move3 * 1.4); + next.control.position += Vec3::new(move3 * -9.0, 0.0, 0.0); + }, _ => {}, } }