Sahagin, Adlet npcs

This commit is contained in:
Snowram 2020-12-27 16:01:02 +01:00 committed by jshipsey
parent 7cf723bb9d
commit f48fea57f4
26 changed files with 272 additions and 31 deletions

View File

@ -892,6 +892,14 @@
gnome: (
keyword: "gnome",
generic: "Gnome"
),
sahagin: (
keyword: "sahagin",
generic: "Sahagin"
),
adlet: (
keyword: "adlet",
generic: "Adlet"
)
)
),

View File

@ -43,4 +43,92 @@
central: ("armor.empty"),
),
),
(Sahagin, Male): (
head: (
offset: (-2.5, 0.0, -4.5),
central: ("npc.sahagin.male.head"),
),
chest: (
offset: (-4.5, -8.0, -8.0),
central: ("npc.sahagin.male.chest"),
),
shorts: (
offset: (-2.5, -3.5, -2.0),
central: ("npc.sahagin.male.shorts"),
),
tail: (
offset: (-1.5, -13.0, -5.0),
central: ("npc.sahagin.male.tail"),
),
main: (
offset: (-0.5, -7.5, -5.0),
central: ("weapon.spear.sahagin"),
),
),
(Sahagin, Female): (
head: (
offset: (-2.5, 0.0, -4.5),
central: ("npc.sahagin.male.head"),
),
chest: (
offset: (-4.5, -8.0, -8.0),
central: ("npc.sahagin.male.chest"),
),
shorts: (
offset: (-2.5, -3.5, -2.0),
central: ("npc.sahagin.male.shorts"),
),
tail: (
offset: (-1.5, -13.0, -5.0),
central: ("npc.sahagin.male.tail"),
),
main: (
offset: (-0.5, -7.5, -5.0),
central: ("weapon.spear.sahagin"),
),
),
(Adlet, Male): (
head: (
offset: (-7.0, -4.5, -6.0),
central: ("npc.adlet.male.head"),
),
chest: (
offset: (-5.0, -3.5, -2.0),
central: ("npc.adlet.male.chest"),
),
shorts: (
offset: (-5.0, -4.5, -3.0),
central: ("npc.adlet.male.shorts"),
),
tail: (
offset: (-1.0, -5.0, -1.0),
central: ("npc.adlet.male.tail"),
),
main: (
offset: (-0.5, -7.5, -5.0),
central: ("weapon.spear.adlet"),
),
),
(Adlet, Female): (
head: (
offset: (-7.0, -4.5, -6.0),
central: ("npc.adlet.male.head"),
),
chest: (
offset: (-5.0, -3.5, -2.0),
central: ("npc.adlet.male.chest"),
),
shorts: (
offset: (-5.0, -4.5, -3.0),
central: ("npc.adlet.male.shorts"),
),
tail: (
offset: (-1.0, -5.0, -1.0),
central: ("npc.adlet.male.tail"),
),
main: (
offset: (-0.5, -7.5, -5.0),
central: ("weapon.spear.adlet"),
),
),
})

View File

@ -35,4 +35,76 @@
lateral: ("npc.gnome.male.foot_r"),
),
),
(Sahagin, Male): (
hand_l: (
offset: (0.0, -2.5, -11.0),
lateral: ("npc.sahagin.male.hand_l"),
),
hand_r: (
offset: (-7.0, -2.5, -11.0),
lateral: ("npc.sahagin.male.hand_r"),
),
foot_l: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_l"),
),
foot_r: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_r"),
),
),
(Sahagin, Female): (
hand_l: (
offset: (0.0, -2.5, -11.0),
lateral: ("npc.sahagin.male.hand_l"),
),
hand_r: (
offset: (-7.0, -2.5, -11.0),
lateral: ("npc.sahagin.male.hand_r"),
),
foot_l: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_l"),
),
foot_r: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_r"),
),
),
(Adlet, Male): (
hand_l: (
offset: (-2.0, -2.0, -6.0),
lateral: ("npc.adlet.male.hand_l"),
),
hand_r: (
offset: (-2.0, -2.0, -6.0),
lateral: ("npc.adlet.male.hand_r"),
),
foot_l: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_l"),
),
foot_r: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_r"),
),
),
(Adlet, Female): (
hand_l: (
offset: (-2.0, -2.0, -6.0),
lateral: ("npc.adlet.male.hand_l"),
),
hand_r: (
offset: (-2.0, -2.0, -6.0),
lateral: ("npc.adlet.male.hand_r"),
),
foot_l: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_l"),
),
foot_r: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_r"),
),
),
})

BIN
assets/voxygen/voxel/npc/adlet/male/chest.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/adlet/male/foot_l.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/adlet/male/foot_r.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/adlet/male/hand_l.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/adlet/male/hand_r.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/adlet/male/head.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/adlet/male/shorts.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/adlet/male/tail.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/chest.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/foot_l.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/foot_r.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/hand_l.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/hand_r.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/head.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/shorts.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/npc/sahagin/male/tail.vox (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/spear/adlet.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/spear/sahagin.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -268,7 +268,7 @@ impl Body {
_ => 4.6,
},
Body::Golem(_) => 5.0,
Body::BipedSmall(_) => 1.5,
Body::BipedSmall(_) => 1.4,
Body::Object(object) => match object {
object::Body::Crossbow => 1.7,
_ => 1.0,

View File

@ -35,6 +35,8 @@ make_case_elim!(
#[repr(u32)]
pub enum Species {
Gnome = 0,
Sahagin = 1,
Adlet = 2,
}
);
@ -44,6 +46,8 @@ make_case_elim!(
#[derive(Clone, Debug, Deserialize)]
pub struct AllSpecies<SpeciesMeta> {
pub gnome: SpeciesMeta,
pub sahagin: SpeciesMeta,
pub adlet: SpeciesMeta,
}
impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies<SpeciesMeta> {
@ -53,11 +57,17 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies<SpeciesMeta>
fn index(&self, &index: &'a Species) -> &Self::Output {
match index {
Species::Gnome => &self.gnome,
Species::Sahagin => &self.sahagin,
Species::Adlet => &self.adlet,
}
}
}
pub const ALL_SPECIES: [Species; 1] = [Species::Gnome];
pub const ALL_SPECIES: [Species; 3] = [
Species::Gnome,
Species::Sahagin,
Species::Adlet,
];
impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies<SpeciesMeta> {
type IntoIter = std::iter::Copied<std::slice::Iter<'static, Self::Item>>;

View File

@ -93,21 +93,33 @@ impl<'a> From<&'a Body> for SkeletonAttr {
Self {
head: match (body.species, body.body_type) {
(Gnome, _) => (-1.0, 9.0),
(Sahagin, _) => (7.0, -3.5),
(Adlet, _) => (0.0, 7.0),
},
chest: match (body.species, body.body_type) {
(Gnome, _) => (0.0, 9.0),
(Sahagin, _) => (0.0, 15.0),
(Adlet, _) => (0.0, 11.0),
},
shorts: match (body.species, body.body_type) {
(Gnome, _) => (0.0, -3.0),
(Sahagin, _) => (0.5, -7.0),
(Adlet, _) => (0.0, -3.0),
},
tail: match (body.species, body.body_type) {
(Gnome, _) => (0.0, 0.0),
(Sahagin, _) => (-2.5, -2.0),
(Adlet, _) => (-4.5, -2.0),
},
hand: match (body.species, body.body_type) {
(Gnome, _) => (6.0, 0.5, -1.0),
(Sahagin, _) => (9.5, 3.5, -2.0),
(Adlet, _) => (6.0, -0.5, 0.0),
},
foot: match (body.species, body.body_type) {
(Gnome, _) => (3.0, 0.0, 4.0),
(Sahagin, _) => (3.0, 1.0, 8.0),
(Adlet, _) => (3.0, 0.5, 7.0),
},
}
}

View File

@ -32,32 +32,32 @@ impl Animation for RunAnimation {
let lab = 1.0;
let footrotl = (((1.0)
/ (0.5 + (0.5) * ((acc_vel * 1.6 * lab as f32 + PI * 1.4).sin()).powi(2)))
let footrotl = (((5.0)
/ (0.5 + (5.5) * ((acc_vel * 1.4 * lab as f32 + PI * 1.4).sin()).powi(2)))
.sqrt())
* ((acc_vel * 1.6 * lab as f32 + PI * 1.4).sin());
* ((acc_vel * 1.4 * lab as f32 + PI * 1.4).sin());
let footrotr = (((1.0)
/ (0.5 + (0.5) * ((acc_vel * 1.6 * lab as f32 + PI * 0.4).sin()).powi(2)))
let footrotr = (((5.0)
/ (0.5 + (5.5) * ((acc_vel * 1.4 * lab as f32 + PI * 0.4).sin()).powi(2)))
.sqrt())
* ((acc_vel * 1.6 * lab as f32 + PI * 0.4).sin());
* ((acc_vel * 1.4 * lab as f32 + PI * 0.4).sin());
let shortalter = (acc_vel * lab as f32 * 1.6 + PI / -2.0).sin();
let shortalter = (acc_vel * lab as f32 * 1.4 + PI / -2.0).sin();
let foothoril = (acc_vel * 1.6 * lab as f32 + PI * 1.45).sin();
let foothorir = (acc_vel * 1.6 * lab as f32 + PI * (0.45)).sin();
let footstrafel = (acc_vel * 1.6 * lab as f32 + PI * 1.45).sin();
let footstrafer = (acc_vel * 1.6 * lab as f32 + PI * (0.95)).sin();
let foothoril = (acc_vel * 1.4 * lab as f32 + PI * 1.45).sin();
let foothorir = (acc_vel * 1.4 * lab as f32 + PI * (0.45)).sin();
let footstrafel = (acc_vel * 1.4 * lab as f32 + PI * 1.45).sin();
let footstrafer = (acc_vel * 1.4 * lab as f32 + PI * (0.95)).sin();
let footvertl = (acc_vel * 1.6 * lab as f32).sin();
let footvertr = (acc_vel * 1.6 * lab as f32 + PI).sin();
let footvertsl = (acc_vel * 1.6 * lab as f32).sin();
let footvertsr = (acc_vel * 1.6 * lab as f32 + PI * 0.5).sin();
let footvertl = (acc_vel * 1.4 * lab as f32).sin();
let footvertr = (acc_vel * 1.4 * lab as f32 + PI).sin();
let footvertsl = (acc_vel * 1.4 * lab as f32).sin();
let footvertsr = (acc_vel * 1.4 * lab as f32 + PI * 0.5).sin();
let shortalt = (acc_vel * lab as f32 * 1.6 + PI / 2.0).sin();
let shortalt = (acc_vel * lab as f32 * 1.4 + PI / 2.0).sin();
let short = (((5.0) / (1.5 + 3.5 * ((acc_vel * lab as f32 * 1.6).sin()).powi(2))).sqrt())
* ((acc_vel * lab as f32 * 1.6).sin());
let short = (((5.0) / (1.5 + 3.5 * ((acc_vel * lab as f32 * 1.4).sin()).powi(2))).sqrt())
* ((acc_vel * lab as f32 * 1.4).sin());
let direction = velocity.y * -0.098 * orientation.y + velocity.x * -0.098 * orientation.x;
let side =
@ -115,18 +115,18 @@ impl Animation for RunAnimation {
* Quaternion::rotation_y(tilt * 0.7);
next.hand_l.position = Vec3::new(
-s_a.hand.0 + foothorir * -1.3 * speednorm,
1.0 * speednorm + s_a.hand.1 + foothorir * -3.5 * speednorm,
1.5 * speednorm + s_a.hand.2 - foothorir * 2.5 * speednorm,
-s_a.hand.0 + footrotr * -1.3 * speednorm,
1.0 * speednorm + s_a.hand.1 + footrotr * -3.5 * speednorm,
1.5 * speednorm + s_a.hand.2 - footrotr * 2.5 * speednorm,
);
next.hand_l.orientation =
Quaternion::rotation_x(0.4 * speednorm + (footrotr * -1.2) * speednorm)
* Quaternion::rotation_y(footrotr * 0.4 * speednorm);
next.hand_r.position = Vec3::new(
s_a.hand.0 + foothoril * 1.3 * speednorm,
1.0 * speednorm + s_a.hand.1 + foothoril * -3.5 * speednorm,
1.5 * speednorm + s_a.hand.2 - foothoril * 2.5 * speednorm,
s_a.hand.0 + footrotl * 1.3 * speednorm,
1.0 * speednorm + s_a.hand.1 + footrotl * -3.5 * speednorm,
1.5 * speednorm + s_a.hand.2 - footrotl * 2.5 * speednorm,
);
next.hand_r.orientation =
Quaternion::rotation_x(0.4 * speednorm + (footrotl * -1.2) * speednorm)
@ -136,7 +136,7 @@ impl Animation for RunAnimation {
next.foot_l.position = Vec3::new(
-s_a.foot.0 + footstrafel * sideabs * 3.0 + tilt * -2.0,
s_a.foot.1
+ (1.0 - sideabs) * (-1.0 * speednorm + foothoril * -7.5 * speednorm)
+ (1.0 - sideabs) * (-1.0 * speednorm + footrotl * -7.5 * speednorm)
+ (direction * 5.0).max(0.0),
s_a.foot.2
+ (1.0 - sideabs) * (2.0 * speednorm + ((footvertl * -2.1 * speednorm).max(-1.0)))
@ -151,7 +151,7 @@ impl Animation for RunAnimation {
next.foot_r.position = Vec3::new(
s_a.foot.0 + footstrafer * sideabs * 3.0 + tilt * -2.0,
s_a.foot.1
+ (1.0 - sideabs) * (-1.0 * speednorm + foothorir * -7.5 * speednorm)
+ (1.0 - sideabs) * (-1.0 * speednorm + footrotr * -7.5 * speednorm)
+ (direction * 5.0).max(0.0),
s_a.foot.2
+ (1.0 - sideabs) * (2.0 * speednorm + ((footvertr * -2.1 * speednorm).max(-1.0)))