This commit is contained in:
jshipsey 2020-10-16 00:17:20 -04:00 committed by Robin Gilh
parent c9985e14cb
commit 66b1fe67dc
8 changed files with 82 additions and 85 deletions

View File

@ -262,6 +262,8 @@ impl Tool {
max_angle: 30.0,
charge_duration: Duration::from_millis(1200),
swing_duration: Duration::from_millis(400),
recover_duration: Duration::from_millis(100),
},
LeapMelee {
energy_cost: 700,
buildup_duration: Duration::from_millis(100),

View File

@ -60,7 +60,6 @@ impl<'a> System<'a> for Sys {
ReadStorage<'a, Invite>,
Read<'a, TimeOfDay>,
ReadStorage<'a, LightEmitter>,
ReadStorage<'a, Energy>,
);
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
@ -90,7 +89,6 @@ impl<'a> System<'a> for Sys {
invites,
time_of_day,
light_emitter,
energies,
): Self::SystemData,
) {
let start_time = std::time::Instant::now();
@ -111,7 +109,6 @@ impl<'a> System<'a> for Sys {
mount_state,
group,
light_emitter,
energy,
) in (
&entities,
&energies,
@ -128,7 +125,6 @@ impl<'a> System<'a> for Sys {
mount_states.maybe(),
groups.maybe(),
light_emitter.maybe(),
&energies,
)
.join()
{

View File

@ -42,12 +42,12 @@ impl Animation for BeamAnimation {
next.head.position = Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1);
next.l_hand.position = Vec3::new(0.0, 0.0, -4.0);
next.l_hand.orientation = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
next.l_hand.scale = Vec3::one() * 1.05;
next.r_hand.position = Vec3::new(0.0, 0.0, 2.0);
next.r_hand.orientation = Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
next.r_hand.scale = Vec3::one() * 1.05;
next.hand_l.position = Vec3::new(0.0, 0.0, -4.0);
next.hand_l.orientation = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
next.hand_l.scale = Vec3::one() * 1.05;
next.hand_r.position = Vec3::new(0.0, 0.0, 2.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
next.hand_r.scale = Vec3::one() * 1.05;
next.main.position = Vec3::new(0.0, 0.0, 13.2);
next.main.orientation = Quaternion::rotation_y(PI);
@ -81,7 +81,7 @@ impl Animation for BeamAnimation {
next.head.orientation =
Quaternion::rotation_x(0.0) * Quaternion::rotation_z(0.0);
next.l_hand.position = Vec3::new(
next.hand_l.position = Vec3::new(
0.0 + movement * -1.0,
0.0 + movement * -5.0,
-4.0 + movement * 19.0,
@ -90,20 +90,20 @@ impl Animation for BeamAnimation {
if velocity < 0.5 {
next.head.orientation = Quaternion::rotation_z(movement * -0.5);
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 + movement * -3.0,
skeleton_attr.foot.2,
);
next.l_foot.orientation = Quaternion::rotation_x(movement * -0.5)
next.foot_l.orientation = Quaternion::rotation_x(movement * -0.5)
* Quaternion::rotation_z(movement * 0.5);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 + movement * 4.0,
skeleton_attr.foot.2,
);
next.r_foot.orientation = Quaternion::rotation_z(movement * 0.5);
next.foot_r.orientation = Quaternion::rotation_z(movement * 0.5);
next.chest.orientation = Quaternion::rotation_x(movement * -0.2)
* Quaternion::rotation_z(movement * 0.5);
next.belt.orientation = Quaternion::rotation_x(movement * 0.1)
@ -119,31 +119,31 @@ impl Animation for BeamAnimation {
* Quaternion::rotation_y(-1.25 + fast * 0.07)
* Quaternion::rotation_z(-1.7 + slowmid * 0.3);
next.l_hand.position = Vec3::new(
next.hand_l.position = Vec3::new(
-1.0 + slow * 3.5,
-5.0 + slow * -2.0 + fast * -1.5,
15.0 + slowalt * 3.5,
);
next.l_hand.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(1.57)
* Quaternion::rotation_y(-1.1 + slowmid * -0.3)
* Quaternion::rotation_z(-2.8);
if velocity < 0.5 {
next.head.orientation = Quaternion::rotation_z(-0.5 + fast * 0.05);
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 - 3.0,
skeleton_attr.foot.2,
);
next.l_foot.orientation =
next.foot_l.orientation =
Quaternion::rotation_x(-0.5) * Quaternion::rotation_z(0.5);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 + 4.0,
skeleton_attr.foot.2,
);
next.r_foot.orientation = Quaternion::rotation_z(0.5);
next.foot_r.orientation = Quaternion::rotation_z(0.5);
next.chest.orientation = Quaternion::rotation_x(-0.2 + slow * 0.05)
* Quaternion::rotation_z(0.5);
next.belt.orientation =
@ -164,33 +164,33 @@ impl Animation for BeamAnimation {
Quaternion::rotation_x(-1.5 + movement * 1.2)
* Quaternion::rotation_y(-1.25 + movement * 1.4)
* Quaternion::rotation_z(-1.7 + movement * 1.7);
next.l_hand.position = Vec3::new(
next.hand_l.position = Vec3::new(
-1.0 + movement,
-5.0 + movement * 5.0,
15.0 + movement * -19.0,
);
next.l_hand.orientation =
next.hand_l.orientation =
Quaternion::rotation_x(1.57 + movement * -0.3)
* Quaternion::rotation_y(-1.1 + movement * 1.1)
* Quaternion::rotation_z(-2.8 + movement * 2.8);
if velocity < 0.5 {
next.head.orientation = Quaternion::rotation_z(movement * 0.5);
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 - 3.0 + movement * 3.0,
skeleton_attr.foot.2,
);
next.l_foot.orientation =
next.foot_l.orientation =
Quaternion::rotation_x(-0.5 + movement * 0.5)
* Quaternion::rotation_z(0.5 + movement * -0.5);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 + 4.0 + movement * -4.0,
skeleton_attr.foot.2,
);
next.r_foot.orientation =
next.foot_r.orientation =
Quaternion::rotation_z(0.5 + movement * -0.5);
next.chest.orientation =
Quaternion::rotation_x(-0.2 + movement * 0.2)

View File

@ -148,16 +148,16 @@ impl Animation for ChargeAnimation {
next.control.scale = Vec3::one();
},
Some(ToolKind::Hammer(_)) => {
next.l_hand.position = Vec3::new(-8.0, -2.0 + stop * -1.0, 13.0);
next.l_hand.orientation = Quaternion::rotation_x(2.1)
next.hand_l.position = Vec3::new(-8.0, -2.0 + stop * -1.0, 13.0);
next.hand_l.orientation = Quaternion::rotation_x(2.1)
* Quaternion::rotation_y(0.7)
* Quaternion::rotation_z(-0.3);
next.l_hand.scale = Vec3::one() * 1.05;
next.r_hand.position = Vec3::new(-11.0, 2.0, 6.0);
next.r_hand.orientation = Quaternion::rotation_x(1.8)
next.hand_l.scale = Vec3::one() * 1.05;
next.hand_r.position = Vec3::new(-11.0, 2.0, 6.0);
next.hand_r.orientation = Quaternion::rotation_x(1.8)
* Quaternion::rotation_y(2.3)
* Quaternion::rotation_z(0.3);
next.r_hand.scale = Vec3::one() * 1.05;
next.hand_r.scale = Vec3::one() * 1.05;
next.main.position = Vec3::new(-12.0, 1.0, 4.0);
next.main.orientation = Quaternion::rotation_x(0.3)
* Quaternion::rotation_y(0.3)

View File

@ -65,12 +65,12 @@ impl Animation for ChargeswingAnimation {
.sqrt())
* ((anim_time as f32 * 8.0 * lab as f32 + PI * 0.4).sin());
if let Some(ToolKind::Hammer(_)) = active_tool_kind {
next.l_hand.position = Vec3::new(-12.0, 0.0, 0.0);
next.l_hand.orientation = Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0);
next.l_hand.scale = Vec3::one() * 1.08;
next.r_hand.position = Vec3::new(2.0, 0.0, 0.0);
next.r_hand.orientation = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
next.r_hand.scale = Vec3::one() * 1.06;
next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0);
next.hand_l.scale = Vec3::one() * 1.08;
next.hand_r.position = Vec3::new(2.0, 0.0, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
next.hand_r.scale = Vec3::one() * 1.06;
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(1.57);
@ -115,43 +115,43 @@ impl Animation for ChargeswingAnimation {
next.shorts.orientation = Quaternion::rotation_z(short * 0.15);
if speed > 0.5 {
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 + foothoril * -2.5 - 3.5,
skeleton_attr.foot.2 + ((footvertl * -1.2).max(-1.0)),
);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 + foothorir * -2.5 + 6.0,
skeleton_attr.foot.2 + ((footvertr * -1.2).max(-1.0)),
);
next.l_foot.orientation =
next.foot_l.orientation =
Quaternion::rotation_x(-0.4 + footrotl * -0.2)
* Quaternion::rotation_z((movement * 0.5).min(0.5));
next.l_foot.scale = Vec3::one();
next.foot_l.scale = Vec3::one();
next.r_foot.orientation =
next.foot_r.orientation =
Quaternion::rotation_x(-0.4 + footrotr * -0.2)
* Quaternion::rotation_z((movement * 0.5).min(0.5));
} else {
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 - 5.0,
skeleton_attr.foot.2,
);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 + 7.0,
skeleton_attr.foot.2,
);
next.l_foot.orientation =
next.foot_l.orientation =
Quaternion::rotation_x(-0.2) * Quaternion::rotation_z(0.5);
next.r_foot.orientation =
next.foot_r.orientation =
Quaternion::rotation_x(0.2) * Quaternion::rotation_z(0.5);
};
},
@ -163,7 +163,7 @@ impl Animation for ChargeswingAnimation {
* Quaternion::rotation_y(-1.6)
* Quaternion::rotation_z(0.3 - movement * 2.5);
next.head.orientation = Quaternion::rotation_z(0.8);
next.l_hand.position = Vec3::new(-3.0, 0.0, 0.0);
next.hand_l.position = Vec3::new(-3.0, 0.0, 0.0);
},
StageSection::Recover => {
next.chest.orientation = Quaternion::rotation_z(-0.5 + movement * 0.5);
@ -172,7 +172,7 @@ impl Animation for ChargeswingAnimation {
* Quaternion::rotation_y(-1.6 + movement * 1.6)
* Quaternion::rotation_z(-2.2 + movement * 2.2);
next.head.orientation = Quaternion::rotation_z(0.8 + movement * -0.8);
next.l_hand.position = Vec3::new(-3.0 + movement * -9.0, 0.0, 0.0);
next.hand_l.position = Vec3::new(-3.0 + movement * -9.0, 0.0, 0.0);
},
_ => {},
}

View File

@ -41,16 +41,16 @@ impl Animation for RepeaterAnimation {
let fire = (anim_time as f32 * 18.0 * lab as f32).sin();
if let Some(ToolKind::Bow(_)) = active_tool_kind {
next.l_hand.position = Vec3::new(2.0, 1.5, 0.0);
next.l_hand.orientation = Quaternion::rotation_x(1.20)
next.hand_l.position = Vec3::new(2.0, 1.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.l_hand.scale = Vec3::one() * 1.05;
next.r_hand.position = Vec3::new(5.9, 4.5, -5.0);
next.r_hand.orientation = Quaternion::rotation_x(1.20)
next.hand_l.scale = Vec3::one() * 1.05;
next.hand_r.position = Vec3::new(5.9, 4.5, -5.0);
next.hand_r.orientation = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.r_hand.scale = Vec3::one() * 1.05;
next.hand_r.scale = Vec3::one() * 1.05;
next.main.position = Vec3::new(3.0, 2.0, -13.0);
next.main.orientation = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.3)
@ -68,20 +68,20 @@ impl Animation for RepeaterAnimation {
if let Some(stage_section) = stage_section {
match stage_section {
StageSection::Movement => {
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0 + movement * -0.75 - 0.75,
skeleton_attr.foot.1 + movement * 4.0 + 4.0,
skeleton_attr.foot.2 + movement * 2.5 + 2.5,
);
next.l_foot.orientation = Quaternion::rotation_x(movement * 0.6 + 0.6)
next.foot_l.orientation = Quaternion::rotation_x(movement * 0.6 + 0.6)
* Quaternion::rotation_z(movement * 0.3 + 0.3);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0 + movement * 0.75 + 0.75,
skeleton_attr.foot.1 + movement * 4.0 + 4.0,
skeleton_attr.foot.2 + movement * 2.5 + 2.5,
);
next.r_foot.orientation = Quaternion::rotation_x(movement * 0.6 + 0.6)
next.foot_r.orientation = Quaternion::rotation_x(movement * 0.6 + 0.6)
* Quaternion::rotation_z(movement * -0.3 - 0.3);
next.shorts.position = Vec3::new(
0.0,
@ -107,20 +107,20 @@ impl Animation for RepeaterAnimation {
},
StageSection::Buildup => {
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0 - 1.5,
skeleton_attr.foot.1 + 8.0,
skeleton_attr.foot.2 + 5.0,
);
next.l_foot.orientation = Quaternion::rotation_x(1.2 + movement * -0.2)
next.foot_l.orientation = Quaternion::rotation_x(1.2 + movement * -0.2)
* Quaternion::rotation_z(0.6);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0 + 1.5,
skeleton_attr.foot.1 + 8.0,
skeleton_attr.foot.2 + 5.0,
);
next.r_foot.orientation = Quaternion::rotation_x(1.2 + movement * -0.2)
next.foot_r.orientation = Quaternion::rotation_x(1.2 + movement * -0.2)
* Quaternion::rotation_z(-0.6);
next.shorts.position = Vec3::new(
0.0,
@ -139,20 +139,20 @@ impl Animation for RepeaterAnimation {
},
StageSection::Shoot => {
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0 - 1.5,
skeleton_attr.foot.1 + 8.0,
skeleton_attr.foot.2 + 5.0,
);
next.l_foot.orientation =
next.foot_l.orientation =
Quaternion::rotation_x(1.0) * Quaternion::rotation_z(0.6);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0 + 1.5,
skeleton_attr.foot.1 + 8.0,
skeleton_attr.foot.2 + 5.0,
);
next.r_foot.orientation =
next.foot_r.orientation =
Quaternion::rotation_x(1.0) * Quaternion::rotation_z(-0.6);
next.shorts.position = Vec3::new(
0.0,
@ -169,9 +169,9 @@ impl Animation for RepeaterAnimation {
next.head.orientation = Quaternion::rotation_y(0.2);
next.torso.orientation = Quaternion::rotation_x(0.2 + movement * 0.15);
next.l_hand.position =
next.hand_l.position =
Vec3::new(2.0 + fire * -6.0 - 3.0, 1.5 + fire * -6.0 - 3.0, 0.0);
next.l_hand.orientation = Quaternion::rotation_x(1.20)
next.hand_l.orientation = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.hold.scale = Vec3::one() * 0.0;

View File

@ -42,12 +42,12 @@ impl Animation for ShockwaveAnimation {
next.head.position = Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1);
next.l_hand.position = Vec3::new(0.0, 0.0, -4.0);
next.l_hand.orientation = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
next.l_hand.scale = Vec3::one() * 1.05;
next.r_hand.position = Vec3::new(0.0, 0.0, 2.0);
next.r_hand.orientation = Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
next.r_hand.scale = Vec3::one() * 1.05;
next.hand_l.position = Vec3::new(0.0, 0.0, -4.0);
next.hand_l.orientation = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
next.hand_l.scale = Vec3::one() * 1.05;
next.hand_r.position = Vec3::new(0.0, 0.0, 2.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
next.hand_r.scale = Vec3::one() * 1.05;
next.main.position = Vec3::new(0.0, 0.0, 13.2);
next.main.orientation = Quaternion::rotation_y(PI);
@ -88,20 +88,20 @@ impl Animation for ShockwaveAnimation {
next.shorts.orientation = Quaternion::rotation_z(twist);
if velocity < 0.5 {
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 + movement * -7.0,
skeleton_attr.foot.2,
);
next.l_foot.orientation = Quaternion::rotation_x(movement * -0.8)
next.foot_l.orientation = Quaternion::rotation_x(movement * -0.8)
* Quaternion::rotation_z(movement * 0.3);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 + movement * 5.0,
skeleton_attr.foot.2,
);
next.r_foot.orientation = Quaternion::rotation_y(movement * -0.3)
next.foot_r.orientation = Quaternion::rotation_y(movement * -0.3)
* Quaternion::rotation_z(movement * 0.4);
} else {
};
@ -129,21 +129,21 @@ impl Animation for ShockwaveAnimation {
next.shorts.orientation = Quaternion::rotation_x(movement * 0.3)
* Quaternion::rotation_z(0.8 + movement * -0.8);
if velocity < 0.5 {
next.l_foot.position = Vec3::new(
next.foot_l.position = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 - 7.0 + movement * 7.0,
skeleton_attr.foot.2,
);
next.l_foot.orientation =
next.foot_l.orientation =
Quaternion::rotation_x(-0.8 + movement * 0.8)
* Quaternion::rotation_z(0.3 + movement * -0.3);
next.r_foot.position = Vec3::new(
next.foot_r.position = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 + 5.0 + movement * -5.0,
skeleton_attr.foot.2,
);
next.r_foot.orientation =
next.foot_r.orientation =
Quaternion::rotation_y(-0.3 + movement * 0.3)
* Quaternion::rotation_z(0.4 + movement * -0.4);
} else {

View File

@ -238,7 +238,6 @@ impl Animation for WieldAnimation {
next.control.scale = Vec3::one();
},
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
<<<<<<< HEAD
if speed > 0.5 && velocity.z == 0.0 {
next.hand_r.position = Vec3::new(
4.0 + skeleton_attr.hand.0 + foothoril * 1.3,