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

View File

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

View File

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

View File

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

View File

@ -104,7 +104,10 @@ impl LoadoutBuilder {
_ => {},
},
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(
"common.items.npc_weapons.unique.quadmedquick",
));
@ -113,6 +116,8 @@ impl LoadoutBuilder {
| quadruped_medium::Species::Horse
| quadruped_medium::Species::Zebra
| quadruped_medium::Species::Kelpie
| quadruped_medium::Species::Hirdrasil
| quadruped_medium::Species::Deer
| quadruped_medium::Species::Antelope => {
main_tool = Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.quadmedhoof",

View File

@ -1,7 +1,7 @@
use crate::{
comp::{
item::{Hands, ItemKind, Tool},
quadruped_low, quadruped_medium, Body, CharacterState, StateUpdate,
quadruped_low, quadruped_medium, theropod, Body, CharacterState, StateUpdate,
},
event::LocalEvent,
states::*,
@ -118,8 +118,19 @@ impl Body {
Body::BipedLarge(_) => 12.0,
Body::Object(_) => 5.0,
Body::Golem(_) => 8.0,
Body::Theropod(_) => 1.0,
Body::QuadrupedLow(_) => 12.0,
Body::Theropod(theropod) => match theropod.species {
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 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 =
Quaternion::rotation_z(head_look.x * 0.3 + short * -0.2 * intensity + tilt * 3.0)
* Quaternion::rotation_x(

View File

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

View File

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

View File

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

View File

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

View File

@ -39,13 +39,13 @@ impl Animation for AlphaAnimation {
let movement1abs = movement1base * 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)
* 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);
next

View File

@ -5,7 +5,10 @@ pub mod jump;
pub mod run;
// 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 common::comp::{self};

View File

@ -1,6 +1,6 @@
use super::{
super::{vek::*, Animation},
TheropodSkeleton, SkeletonAttr,
SkeletonAttr, TheropodSkeleton,
};
use common::states::utils::StageSection;
//use std::ops::Rem;
@ -39,28 +39,29 @@ impl Animation for AlphaAnimation {
let movement1abs = movement1base * pullback;
let movement2abs = movement2base * pullback;
next.head.orientation = Quaternion::rotation_x(movement1abs*0.2)*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.head.orientation = Quaternion::rotation_x(movement1abs * 0.2)
* 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.chest_back.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.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.foot_l.orientation = Quaternion::rotation_x(movement1abs *-0.3);
next.foot_r.orientation = Quaternion::rotation_x(movement1abs *-0.3);
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.tail_back.orientation =
Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3)
* Quaternion::rotation_z(movement1 * -0.1 + movement2 * -0.2);
next
}
}

View File

@ -1,6 +1,6 @@
use super::{
super::{vek::*, Animation},
TheropodSkeleton, SkeletonAttr,
SkeletonAttr, TheropodSkeleton,
};
use common::states::utils::StageSection;
//use std::ops::Rem;
@ -39,26 +39,27 @@ impl Animation for BetaAnimation {
let movement1abs = movement1base * 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.neck.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)
* 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.chest_back.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.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.foot_l.orientation = Quaternion::rotation_x(movement1abs *0.4);
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.tail_back.orientation =
Quaternion::rotation_x(0.1 + movement1abs * -0.1 + movement2abs * -0.3);
next
}
}

View File

@ -5,7 +5,10 @@ pub mod jump;
pub mod run;
// 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 common::comp::{self};

View File

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

View File

@ -240,7 +240,7 @@ pub fn apply_caves_supplement<'a>(
wpos2d.y 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 => {
is_hostile = false;
let species = match dynamic_rng.gen_range(0, 4) {
@ -253,7 +253,7 @@ pub fn apply_caves_supplement<'a>(
},
1 => {
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,
_ => comp::quadruped_medium::Species::Bonerattler,
};
@ -261,15 +261,27 @@ pub fn apply_caves_supplement<'a>(
},
2 => {
is_hostile = true;
let species = match dynamic_rng.gen_range(0, 4) {
1 => comp::quadruped_low::Species::Rocksnapper,
let species = match dynamic_rng.gen_range(0, 3) {
0 => comp::quadruped_low::Species::Rocksnapper,
1 => comp::quadruped_low::Species::Lavadrake,
_ => comp::quadruped_low::Species::Salamander,
};
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;
let species = match dynamic_rng.gen_range(0, 8) {
let species = match dynamic_rng.gen_range(0, 4) {
0 => comp::biped_large::Species::Ogre,
1 => comp::biped_large::Species::Cyclops,
2 => comp::biped_large::Species::Wendigo,

View File

@ -1,6 +1,9 @@
use crate::{column::ColumnSample, sim::SimChunk, IndexRef, CONFIG};
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},
terrain::Block,
vol::{BaseVol, ReadVol, RectSizedVol, WriteVol},
@ -38,13 +41,16 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
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(
rng,
&quadruped_medium::Species::Frostfang,
)
.into(),
1 => quadruped_medium::Body::random_with(
1 => {
theropod::Body::random_with(rng, &theropod::Species::Snowraptor).into()
},
2 => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Roshwalr,
)
@ -140,12 +146,15 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
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(
rng,
&quadruped_medium::Species::Tarasque,
)
.into(),
1 => {
theropod::Body::random_with(rng, &theropod::Species::Woodraptor).into()
},
_ => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Saber,
@ -406,7 +415,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 3) {
.with_body(match rng.gen_range(0, 4) {
0 => {
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Maneater)
.into()
@ -416,6 +425,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
&quadruped_medium::Species::Tiger,
)
.into(),
2 => theropod::Body::random_with(rng, &theropod::Species::Odonto).into(),
_ => quadruped_low::Body::random_with(
rng,
&quadruped_low::Species::Rocksnapper,
@ -572,16 +582,40 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
* 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
Entry {
make_entity: |pos, rng| {
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(
rng,
&quadruped_medium::Species::Bonerattler,
)
.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(
rng,
&quadruped_low::Species::Sandshark,
@ -603,7 +637,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
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(
rng,
&quadruped_small::Species::Holladon,