mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
visual weapon variation, adjust minotaur dash, keyframed golem quake
This commit is contained in:
parent
16a44cd532
commit
51bc74b2a5
@ -6,7 +6,7 @@ DashMelee(
|
||||
scaled_poise_damage: 0,
|
||||
base_knockback: 8.0,
|
||||
scaled_knockback: 7.0,
|
||||
range: 3.0,
|
||||
range: 2.0,
|
||||
angle: 15.0,
|
||||
energy_drain: 0,
|
||||
forward_speed: 3.0,
|
||||
|
@ -2,7 +2,7 @@ Shockwave(
|
||||
energy_cost: 600,
|
||||
buildup_duration: 0.7,
|
||||
swing_duration: 0.1,
|
||||
recover_duration: 0.3,
|
||||
recover_duration: 0.2,
|
||||
damage: 200,
|
||||
poise_damage: 0,
|
||||
knockback: ( strength: 25.0, direction: Away),
|
||||
|
@ -1,14 +1,14 @@
|
||||
Shockwave(
|
||||
energy_cost: 0,
|
||||
buildup_duration: 0.5,
|
||||
swing_duration: 0.2,
|
||||
recover_duration: 0.8,
|
||||
buildup_duration: 1.5,
|
||||
swing_duration: 0.15,
|
||||
recover_duration: 1.8,
|
||||
damage: 500,
|
||||
poise_damage: 0,
|
||||
knockback: (strength: 40.0, direction: TowardsUp),
|
||||
shockwave_angle: 90.0,
|
||||
shockwave_angle: 100.0,
|
||||
shockwave_vertical_angle: 90.0,
|
||||
shockwave_speed: 50.0,
|
||||
shockwave_speed: 65.0,
|
||||
shockwave_duration: 1.0,
|
||||
requires_ground: true,
|
||||
move_efficiency: 0.05,
|
||||
|
@ -1,18 +1,62 @@
|
||||
({
|
||||
"common.items.npc_weapons.spear.wooden_spear": (
|
||||
vox_spec: ("weapon.spear.sahagin", (-1.5, -3.0, -5.0)),
|
||||
"common.items.npc_weapons.biped_small.adlet.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.adlet", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.weapon.spear.adlet": (
|
||||
vox_spec: ("weapon.spear.adlet", (-0.5, -3.0, -5.0)),
|
||||
"common.items.npc_weapons.biped_small.adlet.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.bow.adlet": (
|
||||
vox_spec: ("weapon.bow.adlet", (-0.5, -5.5, -9.5)),
|
||||
"common.items.npc_weapons.biped_small.adlet.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.adlet", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.staff.gnoll": (
|
||||
vox_spec: ("weapon.staff.gnoll", (-2.5, -3.0, -4.0)),
|
||||
"common.items.npc_weapons.biped_small.gnarling.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.adlet", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.gnarling.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.gnarling.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.adlet", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.sahagin", (-0.5, -5.5, -9.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.sahagin", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.haniwa", (-0.5, -4.5, -10.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.haniwa", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.myrmidon", (-0.5, -5.0, -10.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.myrmidon", (-0.5, -2.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
})
|
||||
|
@ -758,69 +758,69 @@
|
||||
vox_spec: ("weapon.axe.minotaur_axe", (-2.5, -9.0, -6.0)),
|
||||
color: None
|
||||
),
|
||||
//BIPEDSMALL
|
||||
"common.items.npc_weapons.biped_small.gnarling.wooden_spear": (
|
||||
vox_spec: ("weapon.spear.sahagin", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.gnarling.adlet_bow": (
|
||||
vox_spec: ("weapon.bow.adlet", (-0.5, -5.5, -9.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.gnarling.gnoll_staff": (
|
||||
vox_spec: ("weapon.staff.gnoll", (-2.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.adlet.wooden_spear": (
|
||||
vox_spec: ("weapon.spear.sahagin", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.adlet.adlet_bow": (
|
||||
vox_spec: ("weapon.bow.adlet", (-0.5, -5.5, -9.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.adlet.gnoll_staff": (
|
||||
vox_spec: ("weapon.staff.gnoll", (-2.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.wooden_spear": (
|
||||
vox_spec: ("weapon.spear.sahagin", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.adlet_bow": (
|
||||
vox_spec: ("weapon.bow.adlet", (-0.5, -5.5, -9.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.gnoll_staff": (
|
||||
vox_spec: ("weapon.staff.gnoll", (-2.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.wooden_spear": (
|
||||
vox_spec: ("weapon.spear.sahagin", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.adlet_bow": (
|
||||
vox_spec: ("weapon.bow.adlet", (-0.5, -5.5, -9.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.gnoll_staff": (
|
||||
vox_spec: ("weapon.staff.gnoll", (-2.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.wooden_spear": (
|
||||
vox_spec: ("weapon.spear.sahagin", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.adlet_bow": (
|
||||
vox_spec: ("weapon.bow.adlet", (-0.5, -5.5, -9.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.gnoll_staff": (
|
||||
vox_spec: ("weapon.staff.gnoll", (-2.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.hammer.yeti_hammer": (
|
||||
vox_spec: ("weapon.hammer.2hhammer_yeti", (-7.5, -7.0, -7.0)),
|
||||
color: None
|
||||
),
|
||||
//BIPEDSMALL
|
||||
"common.items.npc_weapons.biped_small.adlet.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.adlet", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.adlet.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.adlet.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.adlet", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.gnarling.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.adlet", (-1.5, -3.0, -5.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.gnarling.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.gnarling.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.adlet", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.sahagin", (-0.5, -5.5, -9.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.sahagin.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.sahagin", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.haniwa", (-0.5, -4.5, -10.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.haniwa.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.haniwa", (-0.5, -3.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.adlet_bow": (
|
||||
vox_spec: ("weapon.biped_small.bow.myrmidon", (-0.5, -5.0, -10.5)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.gnoll_staff": (
|
||||
vox_spec: ("weapon.biped_small.staff.sahagin", (-0.5, -4.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
"common.items.npc_weapons.biped_small.myrmidon.wooden_spear": (
|
||||
vox_spec: ("weapon.biped_small.spear.myrmidon", (-0.5, -2.0, -4.0)),
|
||||
color: None
|
||||
),
|
||||
})
|
||||
|
BIN
assets/voxygen/voxel/weapon/biped_small/bow/haniwa.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/biped_small/bow/haniwa.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/biped_small/bow/myrmidon.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/biped_small/bow/myrmidon.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/biped_small/bow/sahagin.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/biped_small/bow/sahagin.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/biped_small/spear/haniwa.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/biped_small/spear/haniwa.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/biped_small/spear/myrmidon.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/biped_small/spear/myrmidon.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/biped_small/staff/sahagin.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/biped_small/staff/sahagin.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -147,7 +147,7 @@ impl CharacterBehavior for Data {
|
||||
}
|
||||
},
|
||||
StageSection::Recover => {
|
||||
if self.timer < self.static_data.swing_duration {
|
||||
if self.timer < self.static_data.recover_duration {
|
||||
// Recovers
|
||||
update.character = CharacterState::Shockwave(Data {
|
||||
timer: self
|
||||
|
@ -3,7 +3,7 @@ use crate::{
|
||||
biped_large, biped_small,
|
||||
inventory::slot::EquipSlot,
|
||||
item::{Hands, ItemKind, Tool, ToolKind},
|
||||
quadruped_low, quadruped_medium,
|
||||
quadruped_low, quadruped_medium, quadruped_small,
|
||||
skills::Skill,
|
||||
theropod, Body, CharacterAbility, CharacterState, LoadoutManip, StateUpdate,
|
||||
},
|
||||
@ -38,7 +38,16 @@ impl Body {
|
||||
pub fn base_accel(&self) -> f32 {
|
||||
match self {
|
||||
Body::Humanoid(_) => 100.0,
|
||||
Body::QuadrupedSmall(_) => 125.0,
|
||||
Body::QuadrupedSmall(body) => match body.species {
|
||||
quadruped_small::Species::Turtle => 30.0,
|
||||
quadruped_small::Species::Axolotl => 70.0,
|
||||
quadruped_small::Species::Pig => 70.0,
|
||||
quadruped_small::Species::Sheep => 70.0,
|
||||
quadruped_small::Species::Cat => 70.0,
|
||||
quadruped_small::Species::Truffler => 70.0,
|
||||
quadruped_small::Species::Fungome => 70.0,
|
||||
_ => 125.0,
|
||||
},
|
||||
Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
|
||||
quadruped_medium::Species::Grolgar => 110.0,
|
||||
quadruped_medium::Species::Saber => 180.0,
|
||||
|
@ -111,32 +111,32 @@ impl Animation for DashAnimation {
|
||||
* Quaternion::rotation_z(-move3 * -1.5);
|
||||
},
|
||||
Some(ToolKind::AxeSimple) => {
|
||||
next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move3 * -10.0);
|
||||
next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move3 * 3.0);
|
||||
next.control_r.position = Vec3::new(1.0, 2.0, -2.0);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
4.0 + move1 * -3.0 + move3 * -8.0,
|
||||
(s_a.grip / 1.0) + move1 * -1.0 + move3 * 12.0,
|
||||
(-s_a.grip / 0.8) + move1 * 2.0 + move3 * -6.0,
|
||||
4.0 + move1 * -3.0 + move3 * -5.0,
|
||||
(s_a.grip / 1.0) + move1 * -1.0 + move3 * 1.0 + footrotl * 2.0,
|
||||
(-s_a.grip / 0.8) + move1 * 2.0 + move3 * -3.0,
|
||||
);
|
||||
next.head.orientation = Quaternion::rotation_x(move1 * -0.5 + move3 * 0.5)
|
||||
* Quaternion::rotation_z(move1 * 0.3 + move3 * 0.3);
|
||||
next.upper_torso.orientation = Quaternion::rotation_x(move1 * -0.4 + move3 * 0.9)
|
||||
* Quaternion::rotation_z(move1 * 0.6 + move3 * -1.5);
|
||||
next.lower_torso.orientation = Quaternion::rotation_y(move1 * -0.2 + move3 * -0.1)
|
||||
* Quaternion::rotation_x(move1 * 0.4 + move3 * -0.7)
|
||||
* Quaternion::rotation_x(move1 * 0.4 + move3 * -0.7 + footrotr * 0.1)
|
||||
* Quaternion::rotation_z(move1 * -0.6 + move3 * 1.6);
|
||||
|
||||
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move3 * 0.8)
|
||||
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + move3 * 0.3)
|
||||
* Quaternion::rotation_y(move1 * 0.7);
|
||||
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move3 * 0.8)
|
||||
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move3 * -0.2)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(-1.0 + move1 * -0.2 + move3 * -1.1)
|
||||
* Quaternion::rotation_y(-1.8 + move1 * -0.2 + move3 * 1.5)
|
||||
* Quaternion::rotation_z(move1 * -0.8 + move3 * -1.5);
|
||||
Quaternion::rotation_x(-1.0 + move1 * -0.2 + move3 * -0.2)
|
||||
* Quaternion::rotation_y(-1.8 + move1 * -0.2 + move3 * -0.2)
|
||||
* Quaternion::rotation_z(move1 * -0.8 + move3 * -0.1);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
@ -57,38 +57,31 @@ impl Animation for IdleAnimation {
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + breathe * 0.5) * s_a.scaler / 8.0;
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + breathe * -0.2);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_x(-0.2);
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_x(-0.2);
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + breathe * 0.6);
|
||||
next.hand_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.2);
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + breathe * 0.6);
|
||||
next.hand_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.2);
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * -0.2) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * -0.2) * 1.02;
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -92,22 +92,22 @@ impl Animation for RunAnimation {
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(footrotl * 0.07)
|
||||
* Quaternion::rotation_y(0.15)
|
||||
* Quaternion::rotation_x(footrotl * -0.25);
|
||||
* Quaternion::rotation_x(-0.2 + footrotl * -0.25);
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(footrotr * -0.07)
|
||||
* Quaternion::rotation_y(-0.15 * speednorm)
|
||||
* Quaternion::rotation_x(footrotr * -0.25);
|
||||
* Quaternion::rotation_x(-0.2 + footrotr * -0.25);
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.3 + footrotl * -0.06)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(-0.35 + footrotl * -0.1);
|
||||
* Quaternion::rotation_y(0.1 * speednorm)
|
||||
* Quaternion::rotation_z(-0.35 * speednorm + footrotl * -0.1);
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.3 + footrotr * -0.06)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(0.35 + footrotr * 0.1);
|
||||
* Quaternion::rotation_y(-0.1 * speednorm)
|
||||
* Quaternion::rotation_z(0.35 * speednorm + footrotr * 0.1);
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_x(footrotl * 0.3)
|
||||
|
@ -2,12 +2,13 @@ use super::{
|
||||
super::{vek::*, Animation},
|
||||
GolemSkeleton, SkeletonAttr,
|
||||
};
|
||||
use common::states::utils::StageSection;
|
||||
use std::f32::consts::PI;
|
||||
|
||||
pub struct ShockwaveAnimation;
|
||||
|
||||
impl Animation for ShockwaveAnimation {
|
||||
type Dependency = (f32, f64);
|
||||
type Dependency = (Option<StageSection>, f32, f64);
|
||||
type Skeleton = GolemSkeleton;
|
||||
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
@ -17,86 +18,61 @@ impl Animation for ShockwaveAnimation {
|
||||
|
||||
fn update_skeleton_inner(
|
||||
skeleton: &Self::Skeleton,
|
||||
(velocity, _global_time): Self::Dependency,
|
||||
(stage_section, velocity, _global_time): Self::Dependency,
|
||||
anim_time: f64,
|
||||
_rate: &mut f32,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
let lab = 1.0;
|
||||
let breathe = (anim_time as f32 * lab as f32 + 1.5 * PI).sin();
|
||||
let twist = anim_time as f32 * lab as f32 * 2.5;
|
||||
let (move1base, move2base, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0),
|
||||
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(2.0)),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
|
||||
let pullback = 1.0 - move3;
|
||||
let move1 = move1base * pullback;
|
||||
let move2 = move2base * pullback;
|
||||
|
||||
let slower = (((1.0)
|
||||
/ (0.00001
|
||||
+ 0.9999 * ((anim_time as f32 * lab as f32 * 2.0 - 0.5 * PI).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 2.0 - 0.5 * PI).sin())
|
||||
+ 1.0;
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z((-twist * 2.0).max(-PI)) * Quaternion::rotation_x(0.0);
|
||||
next.head.orientation = Quaternion::rotation_z(move1 * -PI);
|
||||
|
||||
next.upper_torso.position = Vec3::new(
|
||||
0.0,
|
||||
s_a.upper_torso.0,
|
||||
s_a.upper_torso.1 + slower * -3.0 + breathe * 1.0,
|
||||
) * s_a.scaler
|
||||
/ 8.0;
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z((twist * 2.0).min(PI)) * Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + move2 * -5.0) * s_a.scaler / 8.0;
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(move1 * -PI);
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + slower * 1.0);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z((-twist * 2.0).max(-PI)) * Quaternion::rotation_x(0.0);
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + move2 * 2.0);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(move1 * PI);
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-s_a.shoulder.0 - 2.0,
|
||||
s_a.shoulder.1,
|
||||
s_a.shoulder.2 - slower * 1.0,
|
||||
s_a.shoulder.2 + move2 * -1.0,
|
||||
);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_y(0.6 + slower * -0.3);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_y(move1 * 1.0 + move2 * -1.2);
|
||||
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
s_a.shoulder.0 + 2.0,
|
||||
s_a.shoulder.1,
|
||||
s_a.shoulder.2 - slower * 1.0,
|
||||
s_a.shoulder.2 + move2 * -1.0,
|
||||
);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_y(-0.6 + slower * 0.3);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_y(move1 * -1.0 + move2 * 1.2);
|
||||
|
||||
next.hand_l.position = Vec3::new(
|
||||
-s_a.hand.0 - 1.0,
|
||||
s_a.hand.1,
|
||||
s_a.hand.2 - slower * 0.5 + breathe * -1.0,
|
||||
);
|
||||
next.hand_l.orientation = Quaternion::rotation_y(-0.6 + slower * 0.3);
|
||||
next.hand_l.orientation = Quaternion::rotation_y(move1 * -1.0 + move2 * 1.2);
|
||||
|
||||
next.hand_r.position = Vec3::new(
|
||||
s_a.hand.0 + 1.0,
|
||||
s_a.hand.1,
|
||||
s_a.hand.2 - slower * 0.5 + breathe * -1.0,
|
||||
);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_y(0.6 + slower * -0.3);
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_y(move1 * 1.0 + move2 * -1.2);
|
||||
if velocity < 0.5 {
|
||||
next.leg_l.position =
|
||||
Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + slower * -0.5) * 1.02;
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + move2 * 2.0) * 1.02;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + slower * -0.5) * 1.02;
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + move2 * 2.0) * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0,
|
||||
s_a.foot.1,
|
||||
s_a.foot.2 + slower * 2.5 + breathe * -1.0,
|
||||
);
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2 + move2);
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0,
|
||||
s_a.foot.1,
|
||||
s_a.foot.2 + slower * 2.5 + breathe * -1.0,
|
||||
);
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2 + move2);
|
||||
} else {
|
||||
}
|
||||
next
|
||||
|
@ -281,7 +281,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Rat, _) => (1.0),
|
||||
(Axolotl, _) => (1.2),
|
||||
(Gecko, _) => (1.1),
|
||||
(Turtle, _) => (0.9),
|
||||
(Turtle, _) => (3.0),
|
||||
(Squirrel, _) => (1.15),
|
||||
(Porcupine, _) => (1.2),
|
||||
(Beaver, _) => (1.2),
|
||||
@ -357,7 +357,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Frog, _) => (0.7),
|
||||
(Axolotl, _) => (0.8),
|
||||
(Gecko, _) => (0.8),
|
||||
(Turtle, _) => (0.7),
|
||||
(Turtle, _) => (0.5),
|
||||
(Fungome, _) => (0.7),
|
||||
(Hare, _) => (1.2),
|
||||
_ => (1.0),
|
||||
|
@ -3795,11 +3795,24 @@ impl FigureMgr {
|
||||
skeleton_attr,
|
||||
)
|
||||
},
|
||||
CharacterState::Shockwave(_) => {
|
||||
CharacterState::Shockwave(s) => {
|
||||
let stage_time = s.timer.as_secs_f64();
|
||||
let stage_progress = match s.stage_section {
|
||||
StageSection::Buildup => {
|
||||
stage_time / s.static_data.buildup_duration.as_secs_f64()
|
||||
},
|
||||
StageSection::Swing => {
|
||||
stage_time / s.static_data.swing_duration.as_secs_f64()
|
||||
},
|
||||
StageSection::Recover => {
|
||||
stage_time / s.static_data.recover_duration.as_secs_f64()
|
||||
},
|
||||
_ => 0.0,
|
||||
};
|
||||
anim::golem::ShockwaveAnimation::update_skeleton(
|
||||
&target_base,
|
||||
(vel.0.magnitude(), time),
|
||||
state.state_time,
|
||||
(Some(s.stage_section), vel.0.magnitude(), time),
|
||||
stage_progress,
|
||||
&mut state_animation_rate,
|
||||
skeleton_attr,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user