Agent tactic refactoring

Lower theropods spawns

clippy, changelog

review response
This commit is contained in:
jiminycrick 2020-11-23 11:27:18 -08:00 committed by Sam
parent 1cf0aff5ef
commit aad9734055
29 changed files with 1205 additions and 610 deletions

View File

@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Variable dungeon difficulty
- Aurora Borealis (localised entirely within the kitchen)
- Block-based voxel lighting
- Animals now have customized attacks and AI
### Changed

View File

@ -4,7 +4,7 @@ ComboMelee(
stage: 1,
base_damage: 100,
max_damage: 100,
damage_increase: 10,
damage_increase: 0,
knockback: 5.0,
range: 3.5,
angle: 60.0,
@ -15,9 +15,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 120,
max_damage: 140,
damage_increase: 10,
max_damage: 120,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 80,
max_damage: 110,
damage_increase: 15,
max_damage: 80,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 130,
max_damage: 170,
damage_increase: 20,
max_damage: 130,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -13,5 +13,5 @@ DashMelee(
swing_duration: 100,
recover_duration: 800,
infinite_charge: true,
is_interruptible: true,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 100,
max_damage: 120,
damage_increase: 10,
max_damage: 100,
damage_increase: 0,
knockback: 10.0,
range: 4.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 80,
max_damage: 110,
damage_increase: 15,
max_damage: 80,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 130,
max_damage: 170,
damage_increase: 20,
max_damage: 130,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -13,5 +13,5 @@ DashMelee(
swing_duration: 100,
recover_duration: 500,
infinite_charge: true,
is_interruptible: true,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 100,
max_damage: 120,
damage_increase: 10,
max_damage: 100,
damage_increase: 0,
knockback: 2.0,
range: 3.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 130,
max_damage: 170,
damage_increase: 15,
max_damage: 130,
damage_increase: 0,
knockback: 2.0,
range: 3.5,
angle: 30.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 130,
max_damage: 170,
damage_increase: 20,
max_damage: 130,
damage_increase: 0,
knockback: 2.0,
range: 3.5,
angle: 30.0,
@ -42,8 +42,8 @@ ComboMelee(
(
stage: 4,
base_damage: 130,
max_damage: 170,
damage_increase: 20,
max_damage: 130,
damage_increase: 0,
knockback: 8.0,
range: 3.5,
angle: 30.0,
@ -54,9 +54,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -13,6 +13,6 @@ BasicRanged(
..Default::default()
}),*/
projectile_gravity: Some(Gravity(5.0)),
projectile_speed: 60.0,
projectile_speed: 70.0,
can_continue: true,
)

View File

@ -4,7 +4,7 @@ ComboMelee(
stage: 1,
base_damage: 60,
max_damage: 60,
damage_increase: 10,
damage_increase: 0,
knockback: 5.0,
range: 3.5,
angle: 60.0,
@ -15,9 +15,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 100,
max_damage: 120,
damage_increase: 10,
max_damage: 100,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 120,
max_damage: 140,
damage_increase: 15,
max_damage: 120,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 130,
max_damage: 170,
damage_increase: 20,
max_damage: 130,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -4,7 +4,7 @@ ComboMelee(
stage: 1,
base_damage: 120,
max_damage: 120,
damage_increase: 10,
damage_increase: 0,
knockback: 5.0,
range: 3.5,
angle: 60.0,
@ -15,9 +15,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 120,
max_damage: 140,
damage_increase: 10,
max_damage: 120,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 120,
max_damage: 140,
damage_increase: 15,
max_damage: 120,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 120,
max_damage: 140,
damage_increase: 20,
max_damage: 120,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -1,7 +1,7 @@
DashMelee(
energy_cost: 0,
base_damage: 150,
max_damage: 150,
max_damage: 190,
base_knockback: 8.0,
max_knockback: 25.0,
range: 4.0,
@ -13,5 +13,5 @@ DashMelee(
swing_duration: 100,
recover_duration: 1100,
infinite_charge: true,
is_interruptible: true,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 100,
max_damage: 120,
damage_increase: 10,
max_damage: 100,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 80,
max_damage: 110,
damage_increase: 15,
max_damage: 80,
damage_increase: 0,
knockback: 10.0,
range: 3.5,
angle: 30.0,
@ -28,9 +28,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 100,
max_damage: 120,
damage_increase: 10,
max_damage: 100,
damage_increase: 0,
knockback: 8.0,
range: 3.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 80,
max_damage: 110,
damage_increase: 15,
max_damage: 80,
damage_increase: 0,
knockback: 8.0,
range: 3.5,
angle: 30.0,
@ -28,9 +28,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -1,7 +1,7 @@
DashMelee(
energy_cost: 0,
base_damage: 130,
max_damage: 130,
max_damage: 150,
base_knockback: 8.0,
max_knockback: 15.0,
range: 2.0,
@ -13,5 +13,5 @@ DashMelee(
swing_duration: 100,
recover_duration: 500,
infinite_charge: true,
is_interruptible: true,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 150,
max_damage: 170,
damage_increase: 10,
max_damage: 150,
damage_increase: 0,
knockback: 5.0,
range: 3.5,
angle: 60.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 150,
max_damage: 170,
damage_increase: 15,
max_damage: 150,
damage_increase: 0,
knockback: 5.0,
range: 3.5,
angle: 60.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 150,
max_damage: 170,
damage_increase: 20,
max_damage: 150,
damage_increase: 0,
knockback: 5.0,
range: 3.5,
angle: 60.0,
@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -4,7 +4,7 @@ ComboMelee(
stage: 1,
base_damage: 30,
max_damage: 30,
damage_increase: 10,
damage_increase: 0,
knockback: 5.0,
range: 3.5,
angle: 60.0,
@ -15,9 +15,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -4,7 +4,7 @@ ComboMelee(
stage: 1,
base_damage: 150,
max_damage: 150,
damage_increase: 10,
damage_increase: 0,
knockback: 5.0,
range: 7.5,
angle: 60.0,
@ -15,9 +15,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 170,
max_damage: 190,
damage_increase: 10,
max_damage: 170,
damage_increase: 0,
knockback: 10.0,
range: 7.5,
angle: 30.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 190,
max_damage: 210,
damage_increase: 15,
max_damage: 190,
damage_increase: 0,
knockback: 10.0,
range: 5.5,
angle: 30.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 230,
max_damage: 250,
damage_increase: 20,
max_damage: 230,
damage_increase: 0,
knockback: 10.0,
range: 5.5,
angle: 30.0,
@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -4,7 +4,7 @@ ComboMelee(
stage: 1,
base_damage: 150,
max_damage: 150,
damage_increase: 10,
damage_increase: 0,
knockback: 5.0,
range: 5.5,
angle: 5.0,
@ -15,9 +15,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -3,8 +3,8 @@ ComboMelee(
(
stage: 1,
base_damage: 170,
max_damage: 190,
damage_increase: 10,
max_damage: 170,
damage_increase: 0,
knockback: 10.0,
range: 4.5,
angle: 5.0,
@ -16,8 +16,8 @@ ComboMelee(
(
stage: 2,
base_damage: 190,
max_damage: 210,
damage_increase: 15,
max_damage: 190,
damage_increase: 0,
knockback: 10.0,
range: 4.0,
angle: 10.0,
@ -29,8 +29,8 @@ ComboMelee(
(
stage: 3,
base_damage: 230,
max_damage: 250,
damage_increase: 20,
max_damage: 230,
damage_increase: 0,
knockback: 10.0,
range: 4.0,
angle: 10.0,
@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
max_energy_gain: 0,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 1.0,
is_interruptible: false,
)

View File

@ -168,13 +168,11 @@ impl LoadoutBuilder {
));
},
},
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
_ => {
Body::QuadrupedSmall(_) => {
main_tool = Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.quadsmallbasic",
));
},
},
Body::Theropod(theropod) => match theropod.species {
theropod::Species::Sandraptor
| theropod::Species::Snowraptor

View File

@ -212,7 +212,7 @@ pub fn handle_forced_movement(
// Multiply decreasing amount linearly over time (with average of 1)
* 2.0 * progress
// Apply inputted movement directions with some efficiency
+ (data.inputs.look_dir.try_normalized().unwrap_or_default()/* + update.vel.0.xy()*/)
+ (data.inputs.look_dir.try_normalized().unwrap_or_default())
.try_normalized()
.unwrap_or_default()
// Multiply by forward leap strength

File diff suppressed because it is too large Load Diff

View File

@ -25,12 +25,19 @@ impl Animation for DashAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let (movement1base, chargemovementbase, movement2base, movement3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.5), 0.0, 0.0, 0.0),
Some(StageSection::Charge) => (1.0, 1.0, 0.0, 0.0),
Some(StageSection::Swing) => (1.0, 1.0, (anim_time as f32).powf(4.0), 0.0),
Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time as f32),
_ => (0.0, 0.0, 0.0, 0.0),
let (movement1base, chargemovementbase, movement2base, movement3, legtell) =
match stage_section {
Some(StageSection::Buildup) => (
(anim_time as f32).powf(0.5),
0.0,
0.0,
0.0,
(anim_time as f32),
),
Some(StageSection::Charge) => (1.0, 1.0, 0.0, 0.0, 0.0),
Some(StageSection::Swing) => (1.0, 1.0, (anim_time as f32).powf(4.0), 0.0, 1.0),
Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time as f32, 1.0),
_ => (0.0, 0.0, 0.0, 0.0, 0.0),
};
let pullback = 1.0 - movement3;
let subtract = global_time - timer;
@ -43,6 +50,8 @@ impl Animation for DashAnimation {
//let movement2 = mirror * movement2base * pullback;
let movement1abs = movement1base * pullback;
let movement2abs = movement2base * pullback;
let legtwitch = (legtell * 6.0).sin() * pullback;
let legswing = legtell * pullback;
let short = (((1.0)
/ (0.72
+ 0.28 * ((anim_time as f32 * 16.0 as f32 + PI * 0.25).sin()).powf(2.0 as f32)))
@ -71,35 +80,43 @@ 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 let Some(stage_section) = stage_section {
match stage_section {
StageSection::Buildup => {
if mirror == 1.0 {
next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8);
if legtell > 0.0 {
if mirror.is_sign_positive() {
next.leg_fl.orientation = Quaternion::rotation_x(legswing * 1.1);
next.foot_fl.orientation =
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
next.leg_bl.orientation = Quaternion::rotation_x(movement1abs * 0.8);
Quaternion::rotation_x(legswing * -1.1 + legtwitch * 0.5);
next.leg_bl.orientation = Quaternion::rotation_x(legswing * 1.1);
next.foot_bl.orientation =
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
Quaternion::rotation_x(legswing * -1.1 + legtwitch * 0.5);
next.leg_fr.orientation = Quaternion::rotation_x(0.0);
next.foot_fr.orientation = Quaternion::rotation_x(0.0);
next.leg_br.orientation = Quaternion::rotation_x(0.0);
next.foot_br.orientation = Quaternion::rotation_x(0.0);
} else {
next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8);
next.leg_fl.orientation = Quaternion::rotation_x(0.0);
next.foot_fl.orientation = Quaternion::rotation_x(0.0);
next.leg_bl.orientation = Quaternion::rotation_x(0.0);
next.foot_bl.orientation = Quaternion::rotation_x(0.0);
next.leg_fr.orientation = Quaternion::rotation_x(legswing * 1.1);
next.foot_fr.orientation =
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
Quaternion::rotation_x(legswing * -1.1 + legtwitch * 0.5);
next.leg_br.orientation = Quaternion::rotation_x(movement1abs * 0.8);
next.leg_br.orientation = Quaternion::rotation_x(legswing * 1.1);
next.foot_br.orientation =
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
Quaternion::rotation_x(legswing * -1.1 + legtwitch * 0.5);
}
},
_ => {},
}
}
};
next
}
}

View File

@ -1439,8 +1439,8 @@ impl FigureMgr {
},
_ => 0.0,
};
match s.stage {
_ => anim::quadruped_small::AlphaAnimation::update_skeleton(
{
anim::quadruped_small::AlphaAnimation::update_skeleton(
&target_base,
(
vel.0.magnitude(),
@ -1451,7 +1451,7 @@ impl FigureMgr {
stage_progress,
&mut state_animation_rate,
skeleton_attr,
),
)
}
},
CharacterState::Sit { .. } => {

View File

@ -37,11 +37,11 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
}
let scatter: &[Entry<R>] = &[
// Tundra pack ennemies
// Tundra snow pack ennemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 4) {
.with_body(match rng.gen_range(0, 3) {
0 => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Frostfang,
@ -50,11 +50,31 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
1 => {
theropod::Body::random_with(rng, &theropod::Species::Snowraptor).into()
},
2 => quadruped_medium::Body::random_with(
_ => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Roshwalr,
)
.into(),
})
.with_alignment(Alignment::Enemy)
},
group_size: 1..4,
is_underwater: false,
get_density: |c, col| {
close(c.temp, CONFIG.snow_temp, 0.3)
* BASE_DENSITY
* col.snow_cover as i32 as f32
* 1.0
},
},
// Tundra solitary ennemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 2) {
0 => {
theropod::Body::random_with(rng, &theropod::Species::Snowraptor).into()
},
_ => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Grolgar,
@ -63,11 +83,24 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
})
.with_alignment(Alignment::Enemy)
},
group_size: 1..4,
group_size: 1..2,
is_underwater: false,
get_density: |c, _col| close(c.temp, CONFIG.snow_temp, 0.3) * BASE_DENSITY * 1.0,
},
// Tundra rare solitary ennemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(
theropod::Body::random_with(rng, &theropod::Species::Snowraptor).into(),
)
.with_alignment(Alignment::Enemy)
},
group_size: 1..2,
is_underwater: false,
get_density: |c, _col| close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * 0.5,
},
// Tundra rare solitary ennemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
@ -142,7 +175,23 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
is_underwater: false,
get_density: |c, _col| close(c.temp, CONFIG.snow_temp + 0.2, 0.6) * BASE_DENSITY * 5.0,
},
// Temperate pack ennemies
// Tundra rock solitary ennemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Rocksnapper)
.into(),
)
.with_alignment(Alignment::Enemy)
},
group_size: 1..2,
is_underwater: false,
get_density: |c, col| {
close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * col.rock * 1.0
},
},
// Temperate solitary ennemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
@ -165,7 +214,9 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
},
group_size: 1..2,
is_underwater: false,
get_density: |c, _col| close(c.temp, CONFIG.temperate_temp, 0.35) * BASE_DENSITY * 1.0,
get_density: |c, col| {
close(c.temp, CONFIG.temperate_temp, 0.35) * col.tree_density * BASE_DENSITY * 1.0
},
},
// Temperate pack wild
Entry {
@ -237,7 +288,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 15) {
.with_body(match rng.gen_range(0, 13) {
0 => quadruped_small::Body {
species: quadruped_small::Species::Fox,
body_type: quadruped_small::BodyType::Male,
@ -255,47 +306,40 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
.into(),
4 => quadruped_small::Body::random_with(
rng,
&quadruped_small::Species::Porcupine,
&quadruped_small::Species::Skunk,
)
.into(),
5 => quadruped_small::Body::random_with(
rng,
&quadruped_small::Species::Skunk,
)
.into(),
6 => quadruped_small::Body::random_with(
rng,
&quadruped_small::Species::Raccoon,
)
.into(),
7 => bird_medium::Body::random_with(rng, &bird_medium::Species::Cockatrice)
.into(),
8 => quadruped_medium::Body::random_with(
6 => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Catoblepas,
)
.into(),
9 => quadruped_small::Body::random_with(
7 => quadruped_small::Body::random_with(
rng,
&quadruped_small::Species::Turtle,
)
.into(),
10 => quadruped_medium::Body::random_with(
8 => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Hirdrasil,
)
.into(),
11 => quadruped_medium::Body::random_with(
9 => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Kelpie,
)
.into(),
12 => quadruped_small::Body::random_with(
10 => quadruped_small::Body::random_with(
rng,
&quadruped_small::Species::Truffler,
)
.into(),
13 => quadruped_medium::Body::random_with(
11 => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Donkey,
)
@ -321,15 +365,13 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 4) {
.with_body(match rng.gen_range(0, 3) {
0 => {
biped_large::Body::random_with(rng, &biped_large::Species::Ogre).into()
},
1 => {
biped_large::Body::random_with(rng, &biped_large::Species::Troll).into()
},
2 => biped_large::Body::random_with(rng, &biped_large::Species::Dullahan)
.into(),
_ => biped_large::Body::random_with(rng, &biped_large::Species::Cyclops)
.into(),
})
@ -337,7 +379,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
},
group_size: 1..2,
is_underwater: false,
get_density: |c, _col| close(c.temp, CONFIG.temperate_temp, 0.8) * BASE_DENSITY * 0.1,
get_density: |c, _col| close(c.temp, CONFIG.temperate_temp, 0.8) * BASE_DENSITY * 0.08,
},
// Temperate river wildlife
Entry {
@ -365,7 +407,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
get_density: |_c, col| {
close(col.temp, CONFIG.temperate_temp, 0.6)
* if col.water_dist.map(|d| d < 10.0).unwrap_or(false) {
0.003
0.001
} else {
0.0
}
@ -415,22 +457,16 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 4) {
.with_body(match rng.gen_range(0, 2) {
0 => {
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Maneater)
.into()
},
1 => quadruped_medium::Body::random_with(
_ => quadruped_medium::Body::random_with(
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,
)
.into(),
})
.with_alignment(Alignment::Enemy)
},
@ -440,20 +476,50 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.jungle_hum, 0.3)
* BASE_DENSITY
* 4.0
* 3.0
},
},
// Jungle rare solitary wild
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 4) {
0 => theropod::Body::random_with(rng, &theropod::Species::Odonto).into(),
1 => {
biped_large::Body::random_with(rng, &biped_large::Species::Mightysaurok)
.into()
},
2 => {
biped_large::Body::random_with(rng, &biped_large::Species::Occultsaurok)
.into()
},
_ => biped_large::Body::random_with(rng, &biped_large::Species::Slysaurok)
.into(),
})
.with_alignment(Alignment::Enemy)
},
group_size: 1..2,
is_underwater: false,
get_density: |c, _col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.jungle_hum, 0.3)
* BASE_DENSITY
* 1.0
},
},
// Jungle solitary wild
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 => bird_medium::Body::random_with(rng, &bird_medium::Species::Parrot)
.into(),
1 => {
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Monitor)
.into()
},
2 => bird_medium::Body::random_with(rng, &bird_medium::Species::Cockatrice)
.into(),
_ => {
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Tortoise)
.into()
@ -474,19 +540,10 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 2) {
// WE GROW 'EM BIG 'ERE
0 => quadruped_low::Body::random_with(
rng,
&quadruped_low::Species::Crocodile,
)
.with_body(
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Alligator)
.into(),
_ => quadruped_low::Body::random_with(
rng,
&quadruped_low::Species::Alligator,
)
.into(),
})
.with_alignment(Alignment::Enemy)
},
group_size: 1..3,
@ -494,7 +551,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
get_density: |_c, col| {
close(col.temp, CONFIG.tropical_temp + 0.2, 0.5)
* if col.water_dist.map(|d| d < 10.0).unwrap_or(false) {
0.0002
0.0001
} else {
0.0
}
@ -564,58 +621,42 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(
quadruped_medium::Body::random_with(
.with_body(match rng.gen_range(0, 2) {
0 => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Zebra,
)
.into(),
_ => quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Antelope,
)
.into(),
)
})
.with_alignment(Alignment::Wild)
},
group_size: 3..8,
group_size: 3..7,
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 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
* 0.8
},
},
// Desert solitary enemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 5) {
.with_body(match rng.gen_range(0, 2) {
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(),
1 => {
theropod::Body::random_with(rng, &theropod::Species::Sandraptor).into()
},
_ => quadruped_low::Body::random_with(
rng,
&quadruped_low::Species::Sandshark,
@ -633,6 +674,50 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
* 1.5
},
},
// Desert rare solitary enemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(match rng.gen_range(0, 2) {
0 => quadruped_low::Body::random_with(
rng,
&quadruped_low::Species::Lavadrake,
)
.into(),
_ => theropod::Body::random_with(rng, &theropod::Species::Archaeos).into(),
})
.with_alignment(Alignment::Enemy)
},
group_size: 1..2,
is_underwater: false,
get_density: |c, _col| {
close(c.temp, CONFIG.desert_temp + 0.2, 0.3)
* close(c.humidity, CONFIG.desert_hum, 0.5)
* BASE_DENSITY
* 0.2
},
},
// Desert river solitary wild
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(
quadruped_low::Body::random_with(rng, &quadruped_low::Species::Crocodile)
.into(),
)
.with_alignment(Alignment::Enemy)
},
group_size: 1..3,
is_underwater: false,
get_density: |_c, col| {
close(col.temp, CONFIG.desert_temp + 0.2, 0.3)
* if col.water_dist.map(|d| d < 10.0).unwrap_or(false) {
0.0001
} else {
0.0
}
},
},
// Desert solitary wild
Entry {
make_entity: |pos, rng| {
@ -657,6 +742,11 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
body_type: quadruped_low::BodyType::Male,
}
.into(),
4 => quadruped_small::Body::random_with(
rng,
&quadruped_small::Species::Porcupine,
)
.into(),
_ => quadruped_small::Body::random_with(
rng,
&quadruped_small::Species::Gecko,