From 204fa50de9573dc576115e53e7dbf8cd83acbc7a Mon Sep 17 00:00:00 2001 From: Snowram Date: Sun, 9 Aug 2020 02:36:55 +0200 Subject: [PATCH] Add werewolf npc --- assets/common/npc_names.json | 4 ++ .../voxel/biped_large_central_manifest.ron | 65 +++++++++++++++-- .../voxel/biped_large_lateral_manifest.ron | 70 ++++++++++++++++++- .../voxel/npc/werewolf/male/foot_l.vox | 3 + .../voxel/npc/werewolf/male/foot_r.vox | 3 + .../voxel/npc/werewolf/male/hand_l.vox | 3 + .../voxel/npc/werewolf/male/hand_r.vox | 3 + .../voxygen/voxel/npc/werewolf/male/head.vox | 3 + .../voxygen/voxel/npc/werewolf/male/jaw.vox | 3 + .../voxygen/voxel/npc/werewolf/male/leg_l.vox | 3 + .../voxygen/voxel/npc/werewolf/male/leg_r.vox | 3 + .../voxel/npc/werewolf/male/shoulder_l.vox | 3 + .../voxel/npc/werewolf/male/shoulder_r.vox | 3 + .../voxygen/voxel/npc/werewolf/male/tail.vox | 3 + .../voxel/npc/werewolf/male/torso_lower.vox | 3 + .../voxel/npc/werewolf/male/torso_upper.vox | 3 + common/src/comp/body/biped_large.rs | 6 +- voxygen/src/anim/src/biped_large/idle.rs | 36 +++++++--- voxygen/src/anim/src/biped_large/mod.rs | 9 +++ voxygen/src/anim/src/biped_large/run.rs | 11 +-- 20 files changed, 218 insertions(+), 22 deletions(-) create mode 100644 assets/voxygen/voxel/npc/werewolf/male/foot_l.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/foot_r.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/hand_l.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/hand_r.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/head.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/jaw.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/shoulder_l.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/shoulder_r.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/tail.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/torso_lower.vox create mode 100644 assets/voxygen/voxel/npc/werewolf/male/torso_upper.vox diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index 657d073103..fe3f432d3c 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -573,6 +573,10 @@ "dullahan": { "keyword": "dullahan", "generic": "Dullahan" + }, + "werewolf": { + "keyword": "werewolf", + "generic": "Werewolf" } } }, diff --git a/assets/voxygen/voxel/biped_large_central_manifest.ron b/assets/voxygen/voxel/biped_large_central_manifest.ron index 1be2239118..b970f0daed 100644 --- a/assets/voxygen/voxel/biped_large_central_manifest.ron +++ b/assets/voxygen/voxel/biped_large_central_manifest.ron @@ -239,8 +239,6 @@ central: ("npc.troll.female.hammer"), ) ), - - (Dullahan, Male): ( head: ( offset: (-8.0, -5.0, -6.0), @@ -271,7 +269,6 @@ central: ("npc.cyclops.male.hammer"), ) ), - (Dullahan, Female): ( head: ( offset: (-8.0, -5.0, -6.0), @@ -302,4 +299,64 @@ central: ("npc.cyclops.male.hammer"), ) ), -}) + (Werewolf, Male): ( + head: ( + offset: (-5.0, -7.5, -6.5), + center: ("npc.werewolf.male.head"), + ), + torso_upper: ( + offset: (-8.0, -12.5, -10.5), + center: ("npc.werewolf.male.torso_upper"), + ), + torso_lower: ( + offset: (-6.0, -5.5, -4.0), + center: ("npc.werewolf.male.torso_lower"), + ), + jaw: ( + offset: (-2.0, 0.0, -2.0), + center: ("npc.werewolf.male.jaw"), + ), + tail: ( + offset: (-4.0, -27.0, -6.0), + center: ("npc.werewolf.male.tail"), + ), + second: ( + offset: (0.0, 0.0, 0.0), + center: ("armor.empty"), + ), + main: ( + offset: (-1.5, -9.0, -10.0), + center: ("armor.empty"), + ) + ), + (Werewolf, Female): ( + head: ( + offset: (-5.0, -7.5, -6.5), + center: ("npc.werewolf.male.head"), + ), + torso_upper: ( + offset: (-8.0, -12.5, -10.5), + center: ("npc.werewolf.male.torso_upper"), + ), + torso_lower: ( + offset: (-6.0, -5.5, -4.0), + center: ("npc.werewolf.male.torso_lower"), + ), + jaw: ( + offset: (-2.0, 0.0, -2.0), + center: ("npc.werewolf.male.jaw"), + ), + tail: ( + offset: (-4.0, -27.0, -6.0), + center: ("npc.werewolf.male.tail"), + ), + second: ( + offset: (0.0, 0.0, 0.0), + center: ("armor.empty"), + ), + main: ( + offset: (-1.5, -9.0, -10.0), + center: ("armor.empty"), + ) + ), +}) \ No newline at end of file diff --git a/assets/voxygen/voxel/biped_large_lateral_manifest.ron b/assets/voxygen/voxel/biped_large_lateral_manifest.ron index 92ed8119cd..d077d97521 100644 --- a/assets/voxygen/voxel/biped_large_lateral_manifest.ron +++ b/assets/voxygen/voxel/biped_large_lateral_manifest.ron @@ -339,4 +339,72 @@ lateral: ("npc.dullahan.male.foot_r"), ), ), -}) + (Werewolf, Male): ( + shoulder_l: ( + offset: (-4.0, -4.5, -5.0), + lateral: ("npc.werewolf.male.shoulder_l"), + ), + shoulder_r: ( + offset: (-4.0, -4.5, -5.0), + lateral: ("npc.werewolf.male.shoulder_r"), + ), + hand_l: ( + offset: (-3.0, -3.0, -13.0), + lateral: ("npc.werewolf.male.hand_l"), + ), + hand_r: ( + offset: (-3.0, -3.0, -13.0), + lateral: ("npc.werewolf.male.hand_r"), + ), + leg_l: ( + offset: (-2.5, -4.0, -3.5), + lateral: ("npc.werewolf.male.leg_l"), + ), + leg_r: ( + offset: (-2.5, -4.0, -3.5), + lateral: ("npc.werewolf.male.leg_r"), + ), + foot_l: ( + offset: (-3.5, -6.0, -5.5), + lateral: ("npc.werewolf.male.foot_l"), + ), + foot_r: ( + offset: (-3.5, -6.0, -5.5), + lateral: ("npc.werewolf.male.foot_r"), + ), + ), + (Werewolf, Female): ( + shoulder_l: ( + offset: (-4.0, -4.5, -5.0), + lateral: ("npc.werewolf.male.shoulder_l"), + ), + shoulder_r: ( + offset: (-4.0, -4.5, -5.0), + lateral: ("npc.werewolf.male.shoulder_r"), + ), + hand_l: ( + offset: (-3.0, -3.0, -13.0), + lateral: ("npc.werewolf.male.hand_l"), + ), + hand_r: ( + offset: (-3.0, -3.0, -13.0), + lateral: ("npc.werewolf.male.hand_r"), + ), + leg_l: ( + offset: (-2.5, -4.0, -3.5), + lateral: ("npc.werewolf.male.leg_l"), + ), + leg_r: ( + offset: (-2.5, -4.0, -3.5), + lateral: ("npc.werewolf.male.leg_r"), + ), + foot_l: ( + offset: (-3.5, -6.0, -5.5), + lateral: ("npc.werewolf.male.foot_l"), + ), + foot_r: ( + offset: (-3.5, -6.0, -5.5), + lateral: ("npc.werewolf.male.foot_r"), + ), + ), +}) \ No newline at end of file diff --git a/assets/voxygen/voxel/npc/werewolf/male/foot_l.vox b/assets/voxygen/voxel/npc/werewolf/male/foot_l.vox new file mode 100644 index 0000000000..2df63ceda4 --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/foot_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08f3f7267f6ab8b4cc066156fd61d970ca1a965559528e7953dbb6263393fa48 +size 2064 diff --git a/assets/voxygen/voxel/npc/werewolf/male/foot_r.vox b/assets/voxygen/voxel/npc/werewolf/male/foot_r.vox new file mode 100644 index 0000000000..2502c8a676 --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/foot_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa95af478fb3747f8030d6ebc854e3a509daa35683b661bcb657b4e2ad4812ec +size 2064 diff --git a/assets/voxygen/voxel/npc/werewolf/male/hand_l.vox b/assets/voxygen/voxel/npc/werewolf/male/hand_l.vox new file mode 100644 index 0000000000..bc0b461651 --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/hand_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:118a7cbb4e7a2966aa34b928e3b20db1fab7f28e2a6c2d689a619de3aadcb3cb +size 1904 diff --git a/assets/voxygen/voxel/npc/werewolf/male/hand_r.vox b/assets/voxygen/voxel/npc/werewolf/male/hand_r.vox new file mode 100644 index 0000000000..a0d052f3ed --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/hand_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efbb641d41bc8110eb7b8276312d477c13bb87570df4d6eb429c278442165eba +size 1904 diff --git a/assets/voxygen/voxel/npc/werewolf/male/head.vox b/assets/voxygen/voxel/npc/werewolf/male/head.vox new file mode 100644 index 0000000000..281899787f --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa85a80b433ef459045f23bf68a5c8a6685c22cad6d2eddedf7cadb3493ceaec +size 3360 diff --git a/assets/voxygen/voxel/npc/werewolf/male/jaw.vox b/assets/voxygen/voxel/npc/werewolf/male/jaw.vox new file mode 100644 index 0000000000..6abd71ad47 --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/jaw.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ed3698485b3ccc2368a470a2cc17b07fa817772249e32b24029b2e597a0e536 +size 1360 diff --git a/assets/voxygen/voxel/npc/werewolf/male/leg_l.vox b/assets/voxygen/voxel/npc/werewolf/male/leg_l.vox new file mode 100644 index 0000000000..b2b5de0aff --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d424193746a2d8625356c47fb007ff43980195e1f4bec0776d5a93239149a43b +size 1676 diff --git a/assets/voxygen/voxel/npc/werewolf/male/leg_r.vox b/assets/voxygen/voxel/npc/werewolf/male/leg_r.vox new file mode 100644 index 0000000000..9c166a39c7 --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12ee09bc2f1b584a46466709ec40f14d718b1bbd5a47995c49577bae8e317932 +size 1676 diff --git a/assets/voxygen/voxel/npc/werewolf/male/shoulder_l.vox b/assets/voxygen/voxel/npc/werewolf/male/shoulder_l.vox new file mode 100644 index 0000000000..421bcd772f --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/shoulder_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31923527a9a434ae5647a745501236966335f75836a13f9a4882e25d8ae5092b +size 2180 diff --git a/assets/voxygen/voxel/npc/werewolf/male/shoulder_r.vox b/assets/voxygen/voxel/npc/werewolf/male/shoulder_r.vox new file mode 100644 index 0000000000..6cc002874e --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/shoulder_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9de9c02949d9e6b5c22b7b4b4e2546d18dc1b61274b17b6bea23cba2e7985269 +size 2180 diff --git a/assets/voxygen/voxel/npc/werewolf/male/tail.vox b/assets/voxygen/voxel/npc/werewolf/male/tail.vox new file mode 100644 index 0000000000..c0ca5faa27 --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/tail.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c040d4271dd880d72bf3817c3904d24040238c9ccc03c5a79df3e28bffa55dbf +size 3168 diff --git a/assets/voxygen/voxel/npc/werewolf/male/torso_lower.vox b/assets/voxygen/voxel/npc/werewolf/male/torso_lower.vox new file mode 100644 index 0000000000..1fca357510 --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/torso_lower.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d5e0059db5904e899e36267bda1d49d59ce06e4d349dcd2e2eacae261bfd3f1 +size 2808 diff --git a/assets/voxygen/voxel/npc/werewolf/male/torso_upper.vox b/assets/voxygen/voxel/npc/werewolf/male/torso_upper.vox new file mode 100644 index 0000000000..145600ccaf --- /dev/null +++ b/assets/voxygen/voxel/npc/werewolf/male/torso_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0a33e9d7785e97858bacdd0759b55733f6d2c5162a9ce1e5e08cfb8c63041f4 +size 12224 diff --git a/common/src/comp/body/biped_large.rs b/common/src/comp/body/biped_large.rs index 9e007caee9..d7d91803ec 100644 --- a/common/src/comp/body/biped_large.rs +++ b/common/src/comp/body/biped_large.rs @@ -39,6 +39,7 @@ make_case_elim!( Wendigo = 2, Troll = 3, Dullahan = 4, + Werewolf = 5, } ); @@ -52,6 +53,7 @@ pub struct AllSpecies { pub wendigo: SpeciesMeta, pub troll: SpeciesMeta, pub dullahan: SpeciesMeta, + pub werewolf: SpeciesMeta, } impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { @@ -65,16 +67,18 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies Species::Wendigo => &self.wendigo, Species::Troll => &self.troll, Species::Dullahan => &self.dullahan, + Species::Werewolf => &self.werewolf, } } } -pub const ALL_SPECIES: [Species; 5] = [ +pub const ALL_SPECIES: [Species; 6] = [ Species::Ogre, Species::Cyclops, Species::Wendigo, Species::Troll, Species::Dullahan, + Species::Werewolf, ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { diff --git a/voxygen/src/anim/src/biped_large/idle.rs b/voxygen/src/anim/src/biped_large/idle.rs index dffe3d56ae..c06c237236 100644 --- a/voxygen/src/anim/src/biped_large/idle.rs +++ b/voxygen/src/anim/src/biped_large/idle.rs @@ -26,6 +26,9 @@ impl Animation for IdleAnimation { let lab = 1.0; let torso = (anim_time as f32 * lab as f32 + 1.5 * PI).sin(); + let slower = (anim_time as f32 * 1.0 + PI).sin(); + let slow = (anim_time as f32 * 3.5 + PI).sin(); + let look = Vec2::new( ((global_time + anim_time) as f32 / 8.0) .floor() @@ -38,8 +41,18 @@ impl Animation for IdleAnimation { .sin() * 0.25, ); - - let wave_slow = (anim_time as f32 * 0.8).sin(); + let tailmove = Vec2::new( + ((global_time + anim_time) as f32 / 2.0) + .floor() + .mul(7331.0) + .sin() + * 0.25, + ((global_time + anim_time) as f32 / 2.0) + .floor() + .mul(1337.0) + .sin() + * 0.125, + ); next.head.position = Vec3::new( 0.0, @@ -65,17 +78,18 @@ impl Animation for IdleAnimation { ); next.lower_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.lower_torso.scale = Vec3::one() * 1.02; - - next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(wave_slow * 0.09); - next.jaw.scale = Vec3::one(); - - next.tail.position = Vec3::new( + + next.jaw.position = Vec3::new( 0.0, - skeleton_attr.tail.0, - skeleton_attr.tail.1 + torso * 0.0, + skeleton_attr.jaw.0 - slower * 0.12, + skeleton_attr.jaw.1 + slow * 0.2, ); - next.tail.orientation = Quaternion::rotation_z(0.0); + next.jaw.orientation = Quaternion::rotation_x(slow * 0.05); + next.jaw.scale = Vec3::one() * 1.02; + + next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); + next.tail.orientation = + Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0); next.tail.scale = Vec3::one(); next.control.position = Vec3::new(0.0, 0.0, 0.0); diff --git a/voxygen/src/anim/src/biped_large/mod.rs b/voxygen/src/anim/src/biped_large/mod.rs index 48706272a4..6ea0b0c2b7 100644 --- a/voxygen/src/anim/src/biped_large/mod.rs +++ b/voxygen/src/anim/src/biped_large/mod.rs @@ -129,6 +129,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (3.0, 13.5), (Troll, _) => (6.0, 10.0), (Dullahan, _) => (3.0, 6.0), + (Werewolf, _) => (19.0, 1.0), }, jaw: match (body.species, body.body_type) { (Ogre, _) => (0.0, 0.0), @@ -136,6 +137,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (0.0, 0.0), (Troll, _) => (2.0, -4.0), (Dullahan, _) => (0.0, 0.0), + (Werewolf, _) => (-2.5, -4.5), }, upper_torso: match (body.species, body.body_type) { (Ogre, Male) => (0.0, 28.0), @@ -144,6 +146,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (-1.0, 29.0), (Troll, _) => (-1.0, 27.5), (Dullahan, _) => (0.0, 29.0), + (Werewolf, _) => (3.0, 30.5), }, lower_torso: match (body.species, body.body_type) { (Ogre, Male) => (1.0, -7.0), @@ -152,6 +155,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (-1.5, -6.0), (Troll, _) => (1.0, -10.5), (Dullahan, _) => (0.0, -6.5), + (Werewolf, _) => (1.0, -14.5), }, tail: match (body.species, body.body_type) { (Ogre, _) => (0.0, 0.0), @@ -159,6 +163,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (0.0, 0.0), (Troll, _) => (0.0, 0.0), (Dullahan, _) => (0.0, 0.0), + (Werewolf, _) => (-5.5, 2.0), }, shoulder: match (body.species, body.body_type) { (Ogre, Male) => (12.0, 0.5, 0.0), @@ -167,6 +172,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (9.0, 0.5, -0.5), (Troll, _) => (11.0, 0.5, -1.5), (Dullahan, _) => (14.0, 0.5, 4.5), + (Werewolf, _) => (9.0, 4.0, -6.5), }, hand: match (body.species, body.body_type) { (Ogre, Male) => (14.5, 0.0, -2.0), @@ -175,6 +181,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (12.0, 0.0, -0.5), (Troll, _) => (11.5, 0.0, -1.5), (Dullahan, _) => (14.5, 0.0, -2.5), + (Werewolf, _) => (10.0, 2.5, -11.0), }, leg: match (body.species, body.body_type) { (Ogre, Male) => (0.0, 0.0, -4.0), @@ -183,6 +190,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (2.0, 2.0, -2.5), (Troll, _) => (5.0, 0.0, -6.0), (Dullahan, _) => (0.0, 0.0, -5.0), + (Werewolf, _) => (4.5, 0.5, -3.0), }, foot: match (body.species, body.body_type) { (Ogre, Male) => (4.0, 2.5, 8.0), @@ -191,6 +199,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Wendigo, _) => (5.0, 0.5, 6.0), (Troll, _) => (6.0, 0.5, 4.0), (Dullahan, _) => (4.0, 2.5, 8.0), + (Werewolf, _) => (5.5, 6.5, 6.0), }, } } diff --git a/voxygen/src/anim/src/biped_large/run.rs b/voxygen/src/anim/src/biped_large/run.rs index ede6b30ebb..c443c98aad 100644 --- a/voxygen/src/anim/src/biped_large/run.rs +++ b/voxygen/src/anim/src/biped_large/run.rs @@ -2,7 +2,7 @@ use super::{ super::{vek::*, Animation}, BipedLargeSkeleton, SkeletonAttr, }; -use std::f32::consts::PI; +use std::{f32::consts::PI, ops::Mul}; pub struct RunAnimation; @@ -82,11 +82,12 @@ impl Animation for RunAnimation { next.lower_torso.scale = Vec3::one() * 1.02; next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); - next.jaw.orientation = Quaternion::rotation_z(0.0); - next.jaw.scale = Vec3::one(); + next.jaw.orientation = Quaternion::rotation_x(0.0); + next.jaw.scale = Vec3::one() * 1.02; - next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1 * 0.0); - next.tail.orientation = Quaternion::rotation_z(0.0); + next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); + next.tail.orientation = + Quaternion::rotation_x(shortalt * 0.3); next.tail.scale = Vec3::one(); next.second.position = Vec3::new(0.0, 0.0, 0.0);