theropods in world, small tweaks

This commit is contained in:
jshipsey 2020-11-21 15:59:25 -05:00 committed by Sam
parent f411ff7e04
commit d10dd83e5f
19 changed files with 268 additions and 192 deletions

View File

@ -5,7 +5,7 @@ ComboMelee(
base_damage: 100, base_damage: 100,
max_damage: 120, max_damage: 120,
damage_increase: 10, damage_increase: 10,
knockback: 10.0, knockback: 2.0,
range: 3.5, range: 3.5,
angle: 30.0, angle: 30.0,
base_buildup_duration: 600, base_buildup_duration: 600,
@ -18,7 +18,7 @@ ComboMelee(
base_damage: 80, base_damage: 80,
max_damage: 110, max_damage: 110,
damage_increase: 15, damage_increase: 15,
knockback: 10.0, knockback: 2.0,
range: 3.5, range: 3.5,
angle: 30.0, angle: 30.0,
base_buildup_duration: 200, base_buildup_duration: 200,
@ -31,7 +31,7 @@ ComboMelee(
base_damage: 130, base_damage: 130,
max_damage: 170, max_damage: 170,
damage_increase: 20, damage_increase: 20,
knockback: 10.0, knockback: 2.0,
range: 3.5, range: 3.5,
angle: 30.0, angle: 30.0,
base_buildup_duration: 200, base_buildup_duration: 200,
@ -44,7 +44,7 @@ ComboMelee(
base_damage: 130, base_damage: 130,
max_damage: 170, max_damage: 170,
damage_increase: 20, damage_increase: 20,
knockback: 10.0, knockback: 8.0,
range: 3.5, range: 3.5,
angle: 30.0, angle: 30.0,
base_buildup_duration: 200, base_buildup_duration: 200,

View File

@ -1,8 +1,8 @@
ChargedMelee( ChargedMelee(
energy_cost: 0, energy_cost: 0,
energy_drain: 0, energy_drain: 0,
initial_damage: 10, initial_damage: 40,
max_damage: 50, max_damage: 70,
initial_knockback: 10.0, initial_knockback: 10.0,
max_knockback: 30.0, max_knockback: 30.0,
range: 6.0, range: 6.0,

View File

@ -3,7 +3,7 @@ BasicMelee(
buildup_duration: 600, buildup_duration: 600,
swing_duration: 500, swing_duration: 500,
recover_duration: 350, recover_duration: 350,
base_damage: 200, base_damage: 70,
knockback: 25.0, knockback: 25.0,
range: 2.0, range: 2.0,
max_angle: 120.0, max_angle: 120.0,

View File

@ -512,6 +512,7 @@ impl Body {
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species { Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
quadruped_small::Species::Dodarock => 30, quadruped_small::Species::Dodarock => 30,
quadruped_small::Species::Hyena => 40, quadruped_small::Species::Hyena => 40,
quadruped_small::Species::Holladon => 40,
quadruped_small::Species::Porcupine => 30, quadruped_small::Species::Porcupine => 30,
_ => 20, _ => 20,
}, },

View File

@ -104,7 +104,10 @@ impl LoadoutBuilder {
_ => {}, _ => {},
}, },
Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species { Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
quadruped_medium::Species::Wolf | quadruped_medium::Species::Grolgar => { quadruped_medium::Species::Wolf
| quadruped_medium::Species::Grolgar
| quadruped_medium::Species::Lion
| quadruped_medium::Species::Bonerattler => {
main_tool = Some(Item::new_from_asset_expect( main_tool = Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.quadmedquick", "common.items.npc_weapons.unique.quadmedquick",
)); ));
@ -113,6 +116,8 @@ impl LoadoutBuilder {
| quadruped_medium::Species::Horse | quadruped_medium::Species::Horse
| quadruped_medium::Species::Zebra | quadruped_medium::Species::Zebra
| quadruped_medium::Species::Kelpie | quadruped_medium::Species::Kelpie
| quadruped_medium::Species::Hirdrasil
| quadruped_medium::Species::Deer
| quadruped_medium::Species::Antelope => { | quadruped_medium::Species::Antelope => {
main_tool = Some(Item::new_from_asset_expect( main_tool = Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.quadmedhoof", "common.items.npc_weapons.unique.quadmedhoof",

View File

@ -1,7 +1,7 @@
use crate::{ use crate::{
comp::{ comp::{
item::{Hands, ItemKind, Tool}, item::{Hands, ItemKind, Tool},
quadruped_low, quadruped_medium, Body, CharacterState, StateUpdate, quadruped_low, quadruped_medium, theropod, Body, CharacterState, StateUpdate,
}, },
event::LocalEvent, event::LocalEvent,
states::*, states::*,
@ -118,8 +118,19 @@ impl Body {
Body::BipedLarge(_) => 12.0, Body::BipedLarge(_) => 12.0,
Body::Object(_) => 5.0, Body::Object(_) => 5.0,
Body::Golem(_) => 8.0, Body::Golem(_) => 8.0,
Body::Theropod(_) => 1.0, Body::Theropod(theropod) => match theropod.species {
Body::QuadrupedLow(_) => 12.0, theropod::Species::Archaeos => 1.5,
theropod::Species::Odonto => 1.5,
_ => 10.0,
},
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
quadruped_low::Species::Monitor => 9.0,
quadruped_low::Species::Asp => 8.0,
quadruped_low::Species::Tortoise => 3.0,
quadruped_low::Species::Rocksnapper => 4.0,
quadruped_low::Species::Maneater => 5.0,
_ => 6.0,
},
} }
} }

View File

@ -93,7 +93,7 @@ impl Animation for SwimAnimation {
let abstilt = tilt.abs(); let abstilt = tilt.abs();
let squash = if abstilt > 0.2 { 0.35 } else { 1.0 }; //condenses the body at strong turns let squash = if abstilt > 0.2 { 0.35 } else { 1.0 }; //condenses the body at strong turns
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 - 1.0 + short * 0.3); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 - 1.0 + short * 0.3);
next.head.orientation = next.head.orientation =
Quaternion::rotation_z(head_look.x * 0.3 + short * -0.2 * intensity + tilt * 3.0) Quaternion::rotation_z(head_look.x * 0.3 + short * -0.2 * intensity + tilt * 3.0)
* Quaternion::rotation_x( * Quaternion::rotation_x(

View File

@ -36,35 +36,38 @@ impl Animation for BreatheAnimation {
let subtract = global_time - timer; let subtract = global_time - timer;
let check = subtract - subtract.trunc(); let check = subtract - subtract.trunc();
let mirror = (check - 0.5).signum() as f32; let mirror = (check - 0.5).signum() as f32;
let twitch2 = mirror*(twitch*20.0).sin()*pullback; let twitch2 = mirror * (twitch * 20.0).sin() * pullback;
let twitch2alt = mirror*(twitch*20.0+PI/2.0).sin()*pullback; let twitch2alt = mirror * (twitch * 20.0 + PI / 2.0).sin() * pullback;
let movement1abs = movement1base * pullback; let movement1abs = movement1base * pullback;
next.head_upper.orientation = Quaternion::rotation_x(movement1abs * 0.3+twitch2alt*0.02); next.head_upper.orientation =
Quaternion::rotation_x(movement1abs * 0.3 + twitch2alt * 0.02);
next.head_lower.orientation = next.head_lower.orientation =
Quaternion::rotation_x(movement1abs * -0.3 ) Quaternion::rotation_x(movement1abs * -0.3) * Quaternion::rotation_y(twitch2 * 0.02);
* Quaternion::rotation_y(twitch2 * 0.02);
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.7 + twitch2 * 0.1); next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.7 + twitch2 * 0.1);
next.chest.orientation = Quaternion::rotation_y(twitch2 * -0.02) next.chest.orientation =
* Quaternion::rotation_z(0.0); Quaternion::rotation_y(twitch2 * -0.02) * Quaternion::rotation_z(0.0);
next.tail_front.orientation = Quaternion::rotation_x(0.15+movement1abs*-0.15+twitch2alt*0.02) next.tail_front.orientation =
* Quaternion::rotation_z(0.0); Quaternion::rotation_x(0.15 + movement1abs * -0.15 + twitch2alt * 0.02)
* Quaternion::rotation_z(0.0);
next.tail_rear.orientation = Quaternion::rotation_x(-0.12+movement1abs*-0.2+twitch2alt*0.08) next.tail_rear.orientation =
* Quaternion::rotation_z(0.0); Quaternion::rotation_x(-0.12 + movement1abs * -0.2 + twitch2alt * 0.08)
if speed < 0.5{ * Quaternion::rotation_z(0.0);
if speed < 0.5 {
next.foot_fl.orientation = Quaternion::rotation_y(twitch2 * 0.02); next.foot_fl.orientation = Quaternion::rotation_y(twitch2 * 0.02);
next.foot_fr.orientation = Quaternion::rotation_y(twitch2 * 0.02); next.foot_fr.orientation = Quaternion::rotation_y(twitch2 * 0.02);
next.foot_bl.orientation = Quaternion::rotation_y(twitch2 * 0.02); next.foot_bl.orientation = Quaternion::rotation_y(twitch2 * 0.02);
next.foot_br.orientation = Quaternion::rotation_y(twitch2 * 0.02); next.foot_br.orientation = Quaternion::rotation_y(twitch2 * 0.02);
} else{}; } else {
};
next next
} }
} }

View File

@ -10,8 +10,9 @@ pub mod tailwhip;
// Reexports // Reexports
pub use self::{ pub use self::{
alpha::AlphaAnimation, beta::BetaAnimation, breathe::BreatheAnimation, dash::DashAnimation, idle::IdleAnimation, alpha::AlphaAnimation, beta::BetaAnimation, breathe::BreatheAnimation, dash::DashAnimation,
jump::JumpAnimation, run::RunAnimation, shoot::ShootAnimation, tailwhip::TailwhipAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation, shoot::ShootAnimation,
tailwhip::TailwhipAnimation,
}; };
use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use super::{make_bone, vek::*, FigureBoneData, Skeleton};

View File

@ -54,13 +54,11 @@ impl Animation for DashAnimation {
let shortalt = let shortalt =
(anim_time as f32 * 16.0 as f32 + PI * 0.25).sin() * chargemovementbase * pullback; (anim_time as f32 * 16.0 as f32 + PI * 0.25).sin() * chargemovementbase * pullback;
next.head.orientation = next.head.orientation = Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.8)
Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.8) * Quaternion::rotation_z(short * -0.06 + twitch1 * 0.2);
* Quaternion::rotation_z(short * -0.06 + twitch1 * 0.2);
next.neck.orientation = next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.5)
Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.5) * Quaternion::rotation_z(short * 0.15 + twitch1 * 0.2);
* Quaternion::rotation_z(short * 0.15 + twitch1 * 0.2);
next.jaw.orientation = Quaternion::rotation_x( next.jaw.orientation = Quaternion::rotation_x(
twitch1fast * 0.2 twitch1fast * 0.2
@ -74,25 +72,28 @@ impl Animation for DashAnimation {
next.tail.orientation = Quaternion::rotation_x( next.tail.orientation = Quaternion::rotation_x(
0.15 + movement1abs * -0.4 + movement2abs * 0.2 + chargemovementbase * 0.2, 0.15 + movement1abs * -0.4 + movement2abs * 0.2 + chargemovementbase * 0.2,
) * Quaternion::rotation_z(shortalt * 0.15); ) * Quaternion::rotation_z(shortalt * 0.15);
if speed < 0.5 if speed < 0.5 {
{ if mirror == 1.0 {
if mirror == 1.0 { next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.6);
next.leg_fl.orientation = Quaternion::rotation_x(movement1abs*0.6);
next.foot_fl.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); next.foot_fl.orientation =
next.leg_bl.orientation = Quaternion::rotation_x(movement1abs*0.6); Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
next.leg_bl.orientation = Quaternion::rotation_x(movement1abs * 0.6);
next.foot_bl.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); next.foot_bl.orientation =
}else{ Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
next.leg_fr.orientation = Quaternion::rotation_x(movement1abs*0.6); } else {
next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.6);
next.foot_fr.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); next.foot_fr.orientation =
Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
next.leg_br.orientation = Quaternion::rotation_x(movement1abs*0.6); next.leg_br.orientation = Quaternion::rotation_x(movement1abs * 0.6);
next.foot_br.orientation = Quaternion::rotation_x(movement1abs*-0.6+twitch1 * 0.3); next.foot_br.orientation =
} Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
} }
}
next next
} }

View File

@ -10,8 +10,9 @@ pub mod run;
// Reexports // Reexports
pub use self::{ pub use self::{
alpha::AlphaAnimation, beta::BetaAnimation, dash::DashAnimation, feed::FeedAnimation, hoof::HoofAnimation, alpha::AlphaAnimation, beta::BetaAnimation, dash::DashAnimation, feed::FeedAnimation,
idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, run::RunAnimation, hoof::HoofAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation,
run::RunAnimation,
}; };
use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use super::{make_bone, vek::*, FigureBoneData, Skeleton};

View File

@ -39,13 +39,13 @@ impl Animation for AlphaAnimation {
let movement1abs = movement1base * pullback; let movement1abs = movement1base * pullback;
let movement2abs = movement2base * pullback; let movement2abs = movement2base * pullback;
next.head.orientation = Quaternion::rotation_x(movement1abs*-0.7+movement2abs*2.0)*Quaternion::rotation_y(movement1*-0.6+movement2*1.2); next.head.orientation = Quaternion::rotation_x(movement1abs * -0.7 + movement2abs * 2.0)
* Quaternion::rotation_y(movement1 * -0.6 + movement2 * 1.2);
next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15) next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15)
* Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.6); * Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.6);
next.tail.orientation = Quaternion::rotation_x(movement1abs*0.5+movement2abs*-1.0) next.tail.orientation = Quaternion::rotation_x(movement1abs * 0.5 + movement2abs * -1.0)
* Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2); * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2);
next next

View File

@ -5,7 +5,10 @@ pub mod jump;
pub mod run; pub mod run;
// Reexports // Reexports
pub use self::{alpha::AlphaAnimation, feed::FeedAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; pub use self::{
alpha::AlphaAnimation, feed::FeedAnimation, idle::IdleAnimation, jump::JumpAnimation,
run::RunAnimation,
};
use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use super::{make_bone, vek::*, FigureBoneData, Skeleton};
use common::comp::{self}; use common::comp::{self};

View File

@ -1,6 +1,6 @@
use super::{ use super::{
super::{vek::*, Animation}, super::{vek::*, Animation},
TheropodSkeleton, SkeletonAttr, SkeletonAttr, TheropodSkeleton,
}; };
use common::states::utils::StageSection; use common::states::utils::StageSection;
//use std::ops::Rem; //use std::ops::Rem;
@ -39,28 +39,29 @@ impl Animation for AlphaAnimation {
let movement1abs = movement1base * pullback; let movement1abs = movement1base * pullback;
let movement2abs = movement2base * pullback; let movement2abs = movement2base * pullback;
next.head.orientation = Quaternion::rotation_x(movement1abs*0.2)*Quaternion::rotation_y(movement1*0.1+movement2*0.2); next.head.orientation = Quaternion::rotation_x(movement1abs * 0.2)
next.neck.orientation = Quaternion::rotation_x(movement1abs*-0.3)*Quaternion::rotation_y(movement1*0.1+movement2*0.1); * Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.2);
next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.3)
* Quaternion::rotation_y(movement1 * 0.1 + movement2 * 0.1);
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5);
next.chest_front.orientation = Quaternion::rotation_x(movement1abs * -0.2);
next.chest_back.orientation = Quaternion::rotation_x(movement1abs * 0.2);
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 +movement2abs*0.5); next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.1);
next.chest_front.orientation = Quaternion::rotation_x(movement1abs * -0.2) next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.1);
; next.foot_l.orientation = Quaternion::rotation_x(movement1abs * -0.3);
next.chest_back.orientation = Quaternion::rotation_x(movement1abs * 0.2); next.foot_r.orientation = Quaternion::rotation_x(movement1abs * -0.3);
next.leg_l.orientation = Quaternion::rotation_x(movement1abs *-0.1); next.tail_front.orientation =
Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3)
* Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2);
next.leg_r.orientation = Quaternion::rotation_x(movement1abs *-0.1); next.tail_back.orientation =
next.foot_l.orientation = Quaternion::rotation_x(movement1abs *-0.3); Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3)
next.foot_r.orientation = Quaternion::rotation_x(movement1abs *-0.3); * Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2);
next.tail_front.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3)
* Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2);
next.tail_back.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3)
* Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2);
next next
} }
} }

View File

@ -1,6 +1,6 @@
use super::{ use super::{
super::{vek::*, Animation}, super::{vek::*, Animation},
TheropodSkeleton, SkeletonAttr, SkeletonAttr, TheropodSkeleton,
}; };
use common::states::utils::StageSection; use common::states::utils::StageSection;
//use std::ops::Rem; //use std::ops::Rem;
@ -39,26 +39,27 @@ impl Animation for BetaAnimation {
let movement1abs = movement1base * pullback; let movement1abs = movement1base * pullback;
let movement2abs = movement2base * pullback; let movement2abs = movement2base * pullback;
next.head.orientation = Quaternion::rotation_x(movement1abs*-0.4+movement2abs*1.2)*Quaternion::rotation_y(movement1*0.1+movement2*-0.1); next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.2)
next.neck.orientation = Quaternion::rotation_x(movement1abs*0.4+movement2abs*-1.2)*Quaternion::rotation_y(movement1*0.1+movement2*-0.1); * Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1);
next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.4 + movement2abs * -1.2)
* Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1);
next.chest_front.orientation =
Quaternion::rotation_x(movement1abs * 0.6 + movement2abs * -1.5);
next.chest_back.orientation =
Quaternion::rotation_x(movement1abs * -0.6 + movement2abs * 1.5);
next.leg_l.orientation = Quaternion::rotation_x(movement1abs * -0.5);
next.chest_front.orientation = Quaternion::rotation_x(movement1abs * 0.6+movement2abs*-1.5) next.leg_r.orientation = Quaternion::rotation_x(movement1abs * -0.5);
; next.foot_l.orientation = Quaternion::rotation_x(movement1abs * 0.4);
next.chest_back.orientation = Quaternion::rotation_x(movement1abs * -0.6+movement2abs*1.5); next.foot_r.orientation = Quaternion::rotation_x(movement1abs * 0.4);
next.leg_l.orientation = Quaternion::rotation_x(movement1abs *-0.5); next.tail_front.orientation =
Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3);
next.leg_r.orientation = Quaternion::rotation_x(movement1abs *-0.5); next.tail_back.orientation =
next.foot_l.orientation = Quaternion::rotation_x(movement1abs *0.4); Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3);
next.foot_r.orientation = Quaternion::rotation_x(movement1abs *0.4);
next.tail_front.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3)
;
next.tail_back.orientation = Quaternion::rotation_x(0.1+movement1abs*-0.1+movement2abs*-0.3)
;
next next
} }
} }

View File

@ -5,7 +5,10 @@ pub mod jump;
pub mod run; pub mod run;
// Reexports // Reexports
pub use self::{alpha::AlphaAnimation, beta::BetaAnimation, idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; pub use self::{
alpha::AlphaAnimation, beta::BetaAnimation, idle::IdleAnimation, jump::JumpAnimation,
run::RunAnimation,
};
use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use super::{make_bone, vek::*, FigureBoneData, Skeleton};
use common::comp::{self}; use common::comp::{self};

View File

@ -1415,46 +1415,45 @@ impl FigureMgr {
), ),
}; };
let target_bones = match &character { let target_bones = match &character {
CharacterState::ComboMelee(s) => {
CharacterState::ComboMelee(s) => { let stage_index = (s.stage - 1) as usize;
let stage_index = (s.stage - 1) as usize; let stage_time = s.timer.as_secs_f64();
let stage_time = s.timer.as_secs_f64(); let stage_progress = match s.stage_section {
let stage_progress = match s.stage_section { StageSection::Buildup => {
StageSection::Buildup => { stage_time
stage_time / s.static_data.stage_data[stage_index]
/ s.static_data.stage_data[stage_index] .base_buildup_duration
.base_buildup_duration .as_secs_f64()
.as_secs_f64() },
}, StageSection::Swing => {
StageSection::Swing => { stage_time
stage_time / s.static_data.stage_data[stage_index]
/ s.static_data.stage_data[stage_index] .base_swing_duration
.base_swing_duration .as_secs_f64()
.as_secs_f64() },
}, StageSection::Recover => {
StageSection::Recover => { stage_time
stage_time / s.static_data.stage_data[stage_index]
/ s.static_data.stage_data[stage_index] .base_recover_duration
.base_recover_duration .as_secs_f64()
.as_secs_f64() },
}, _ => 0.0,
_ => 0.0, };
}; match s.stage {
match s.stage { _ => anim::quadruped_small::AlphaAnimation::update_skeleton(
_ => anim::quadruped_small::AlphaAnimation::update_skeleton( &target_base,
&target_base, (
( vel.0.magnitude(),
vel.0.magnitude(), time,
time, Some(s.stage_section),
Some(s.stage_section), state.state_time,
state.state_time, ),
stage_progress,
&mut state_animation_rate,
skeleton_attr,
), ),
stage_progress, }
&mut state_animation_rate, },
skeleton_attr,
),
}
},
CharacterState::Sit { .. } => { CharacterState::Sit { .. } => {
anim::quadruped_small::FeedAnimation::update_skeleton( anim::quadruped_small::FeedAnimation::update_skeleton(
&target_base, &target_base,
@ -2376,7 +2375,7 @@ impl FigureMgr {
&mut state_animation_rate, &mut state_animation_rate,
skeleton_attr, skeleton_attr,
), ),
_=> anim::theropod::IdleAnimation::update_skeleton( _ => anim::theropod::IdleAnimation::update_skeleton(
&TheropodSkeleton::default(), &TheropodSkeleton::default(),
time, time,
state.state_time, state.state_time,
@ -2384,58 +2383,58 @@ impl FigureMgr {
skeleton_attr, skeleton_attr,
), ),
}; };
let target_bones = match &character { let target_bones = match &character {
CharacterState::ComboMelee(s) => { CharacterState::ComboMelee(s) => {
let stage_index = (s.stage - 1) as usize; let stage_index = (s.stage - 1) as usize;
let stage_time = s.timer.as_secs_f64(); let stage_time = s.timer.as_secs_f64();
let stage_progress = match s.stage_section { let stage_progress = match s.stage_section {
StageSection::Buildup => { StageSection::Buildup => {
stage_time stage_time
/ s.static_data.stage_data[stage_index] / s.static_data.stage_data[stage_index]
.base_buildup_duration .base_buildup_duration
.as_secs_f64() .as_secs_f64()
}, },
StageSection::Swing => { StageSection::Swing => {
stage_time stage_time
/ s.static_data.stage_data[stage_index] / s.static_data.stage_data[stage_index]
.base_swing_duration .base_swing_duration
.as_secs_f64() .as_secs_f64()
}, },
StageSection::Recover => { StageSection::Recover => {
stage_time stage_time
/ s.static_data.stage_data[stage_index] / s.static_data.stage_data[stage_index]
.base_recover_duration .base_recover_duration
.as_secs_f64() .as_secs_f64()
}, },
_ => 0.0, _ => 0.0,
}; };
match s.stage { match s.stage {
1 => anim::theropod::AlphaAnimation::update_skeleton( 1 => anim::theropod::AlphaAnimation::update_skeleton(
&target_base, &target_base,
( (
vel.0.magnitude(), vel.0.magnitude(),
time, time,
Some(s.stage_section), Some(s.stage_section),
state.state_time, state.state_time,
),
stage_progress,
&mut state_animation_rate,
skeleton_attr,
), ),
_ => anim::theropod::BetaAnimation::update_skeleton( stage_progress,
&target_base, &mut state_animation_rate,
( skeleton_attr,
vel.0.magnitude(), ),
time, _ => anim::theropod::BetaAnimation::update_skeleton(
Some(s.stage_section), &target_base,
state.state_time, (
), vel.0.magnitude(),
stage_progress, time,
&mut state_animation_rate, Some(s.stage_section),
skeleton_attr, state.state_time,
), ),
} stage_progress,
}, &mut state_animation_rate,
skeleton_attr,
),
}
},
// TODO! // TODO!
_ => target_base, _ => target_base,
}; };

View File

@ -240,7 +240,7 @@ pub fn apply_caves_supplement<'a>(
wpos2d.y as f32, wpos2d.y as f32,
cave_base as f32, cave_base as f32,
)) ))
.with_body(match dynamic_rng.gen_range(0, 6) { .with_body(match dynamic_rng.gen_range(0, 5) {
0 => { 0 => {
is_hostile = false; is_hostile = false;
let species = match dynamic_rng.gen_range(0, 4) { let species = match dynamic_rng.gen_range(0, 4) {
@ -253,7 +253,7 @@ pub fn apply_caves_supplement<'a>(
}, },
1 => { 1 => {
is_hostile = true; is_hostile = true;
let species = match dynamic_rng.gen_range(0, 5) { let species = match dynamic_rng.gen_range(0, 2) {
0 => comp::quadruped_medium::Species::Tarasque, 0 => comp::quadruped_medium::Species::Tarasque,
_ => comp::quadruped_medium::Species::Bonerattler, _ => comp::quadruped_medium::Species::Bonerattler,
}; };
@ -261,15 +261,27 @@ pub fn apply_caves_supplement<'a>(
}, },
2 => { 2 => {
is_hostile = true; is_hostile = true;
let species = match dynamic_rng.gen_range(0, 4) { let species = match dynamic_rng.gen_range(0, 3) {
1 => comp::quadruped_low::Species::Rocksnapper, 0 => comp::quadruped_low::Species::Rocksnapper,
1 => comp::quadruped_low::Species::Lavadrake,
_ => comp::quadruped_low::Species::Salamander, _ => comp::quadruped_low::Species::Salamander,
}; };
comp::quadruped_low::Body::random_with(dynamic_rng, &species).into() comp::quadruped_low::Body::random_with(dynamic_rng, &species).into()
}, },
3 => {
is_hostile = true;
let species = match dynamic_rng.gen_range(0, 5) {
0 => comp::theropod::Species::Sandraptor,
1 => comp::theropod::Species::Snowraptor,
2 => comp::theropod::Species::Woodraptor,
3 => comp::theropod::Species::Odonto,
_ => comp::theropod::Species::Archaeos,
};
comp::theropod::Body::random_with(dynamic_rng, &species).into()
},
_ => { _ => {
is_hostile = true; is_hostile = true;
let species = match dynamic_rng.gen_range(0, 8) { let species = match dynamic_rng.gen_range(0, 4) {
0 => comp::biped_large::Species::Ogre, 0 => comp::biped_large::Species::Ogre,
1 => comp::biped_large::Species::Cyclops, 1 => comp::biped_large::Species::Cyclops,
2 => comp::biped_large::Species::Wendigo, 2 => comp::biped_large::Species::Wendigo,

View File

@ -1,6 +1,9 @@
use crate::{column::ColumnSample, sim::SimChunk, IndexRef, CONFIG}; use crate::{column::ColumnSample, sim::SimChunk, IndexRef, CONFIG};
use common::{ use common::{
comp::{biped_large, bird_medium, quadruped_low, quadruped_medium, quadruped_small, Alignment}, comp::{
biped_large, bird_medium, quadruped_low, quadruped_medium, quadruped_small, theropod,
Alignment,
},
generation::{ChunkSupplement, EntityInfo}, generation::{ChunkSupplement, EntityInfo},
terrain::Block, terrain::Block,
vol::{BaseVol, ReadVol, RectSizedVol, WriteVol}, vol::{BaseVol, ReadVol, RectSizedVol, WriteVol},
@ -38,13 +41,16 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 3) { .with_body(match rng.gen_range(0, 4) {
0 => quadruped_medium::Body::random_with( 0 => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Frostfang, &quadruped_medium::Species::Frostfang,
) )
.into(), .into(),
1 => quadruped_medium::Body::random_with( 1 => {
theropod::Body::random_with(rng, &theropod::Species::Snowraptor).into()
},
2 => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Roshwalr, &quadruped_medium::Species::Roshwalr,
) )
@ -140,12 +146,15 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 2) { .with_body(match rng.gen_range(0, 3) {
0 => quadruped_medium::Body::random_with( 0 => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Tarasque, &quadruped_medium::Species::Tarasque,
) )
.into(), .into(),
1 => {
theropod::Body::random_with(rng, &theropod::Species::Woodraptor).into()
},
_ => quadruped_medium::Body::random_with( _ => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Saber, &quadruped_medium::Species::Saber,
@ -406,7 +415,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 3) { .with_body(match rng.gen_range(0, 4) {
0 => { 0 => {
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Maneater) quadruped_low::Body::random_with(rng, &quadruped_low::Species::Maneater)
.into() .into()
@ -416,6 +425,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
&quadruped_medium::Species::Tiger, &quadruped_medium::Species::Tiger,
) )
.into(), .into(),
2 => theropod::Body::random_with(rng, &theropod::Species::Odonto).into(),
_ => quadruped_low::Body::random_with( _ => quadruped_low::Body::random_with(
rng, rng,
&quadruped_low::Species::Rocksnapper, &quadruped_low::Species::Rocksnapper,
@ -572,16 +582,40 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
* 1.0 * 1.0
}, },
}, },
// Desert pack enemy
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(
theropod::Body::random_with(rng, &theropod::Species::Sandraptor).into(),
)
.with_alignment(Alignment::Enemy)
},
group_size: 3..5,
is_underwater: false,
get_density: |c, _col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.desert_hum, 0.4)
* BASE_DENSITY
* 1.0
},
},
// Desert solitary enemies // Desert solitary enemies
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 2) { .with_body(match rng.gen_range(0, 5) {
0 => quadruped_medium::Body::random_with( 0 => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Bonerattler, &quadruped_medium::Species::Bonerattler,
) )
.into(), .into(),
2 => theropod::Body::random_with(rng, &theropod::Species::Archaeos).into(),
3 => quadruped_low::Body::random_with(
rng,
&quadruped_low::Species::Lavadrake,
)
.into(),
_ => quadruped_low::Body::random_with( _ => quadruped_low::Body::random_with(
rng, rng,
&quadruped_low::Species::Sandshark, &quadruped_low::Species::Sandshark,
@ -603,7 +637,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 5) { .with_body(match rng.gen_range(0, 6) {
0 => quadruped_small::Body::random_with( 0 => quadruped_small::Body::random_with(
rng, rng,
&quadruped_small::Species::Holladon, &quadruped_small::Species::Holladon,