Animation for reaching combo

This commit is contained in:
Sam 2022-09-04 10:45:45 -04:00
parent 77f891dc99
commit 035f9135d6
2 changed files with 69 additions and 36 deletions

View File

@ -2,7 +2,7 @@ ComboMelee2(
strikes: [
(
melee_constructor: (
kind: Slash(
kind: Stab(
damage: 10,
poise: 0,
knockback: 0,
@ -19,7 +19,7 @@ ComboMelee2(
),
(
melee_constructor: (
kind: Slash(
kind: Stab(
damage: 14,
poise: 0,
knockback: 0,
@ -34,40 +34,6 @@ ComboMelee2(
recover_duration: 0.3,
ori_modifier: 0.6,
),
(
melee_constructor: (
kind: Slash(
damage: 9,
poise: 0,
knockback: 0,
energy_regen: 10,
),
range: 3.0,
angle: 45.0,
),
buildup_duration: 0.2,
swing_duration: 0.05,
hit_timing: 0.5,
recover_duration: 0.1,
ori_modifier: 0.6,
),
(
melee_constructor: (
kind: Slash(
damage: 12,
poise: 0,
knockback: 0,
energy_regen: 10,
),
range: 3.0,
angle: 45.0,
),
buildup_duration: 0.2,
swing_duration: 0.05,
hit_timing: 0.5,
recover_duration: 0.4,
ori_modifier: 0.6,
),
],
is_stance: true,
energy_cost_per_strike: 15,

View File

@ -958,6 +958,73 @@ impl Animation for ComboAnimation {
next.control.position += Vec3::new(move2 * 10.0, move2 * 2.0, 0.0);
}
},
Some("common.abilities.sword.reaching_combo") => {
let (move1, move2, move3) = if strike == current_strike {
match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time.powi(2), 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
}
} else {
(1.0, 1.0, 0.0)
};
if move2 > 0.0 {
next.main_weapon_trail = true;
} else {
next.main_weapon_trail = false;
}
match strike {
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);
next.chest.orientation = Quaternion::rotation_z(move1 * -0.6);
next.head.orientation = Quaternion::rotation_z(move1 * 0.3);
next.shorts.orientation = Quaternion::rotation_z(move1 * 0.4);
next.belt.orientation = Quaternion::rotation_z(move1 * 0.2);
next.control.orientation.rotate_x(move1 * -1.05);
next.control.orientation.rotate_z(move1 * 0.6);
next.control.position += Vec3::new(move1 * 12.0, move1 * -2.0, 0.0);
next.chest.orientation.rotate_z(move2 * 0.6);
next.head.orientation.rotate_z(move2 * -0.2);
next.shorts.orientation.rotate_z(move2 * -0.4);
next.belt.orientation.rotate_z(move2 * -0.2);
next.control.orientation.rotate_z(move2 * -0.6);
next.control.position +=
Vec3::new(move2 * -2.0, move2 * 12.0, move2 * 5.0);
},
1 => {
next.chest.orientation.rotate_z(move1 * 0.5);
next.head.orientation.rotate_z(move1 * -0.3);
next.shorts.orientation.rotate_z(move1 * -0.3);
next.belt.orientation.rotate_z(move1 * -0.1);
next.control.orientation.rotate_z(move1 * -0.5);
next.control.position +=
Vec3::new(move1 * -7.0, move1 * -12.0, move1 * -4.0);
next.chest.orientation.rotate_z(move2 * -1.0);
next.head.orientation.rotate_z(move2 * 0.4);
next.shorts.orientation.rotate_z(move2 * 0.6);
next.belt.orientation.rotate_z(move2 * 0.2);
next.control.orientation.rotate_z(move2 * 1.0);
next.control.position += Vec3::new(0.0, move2 * 11.0, move2 * 3.0);
},
_ => {},
}
},
_ => {},
}
}