Merge None-loot in EntityConfig to LootKind

This commit is contained in:
juliancoffee 2021-07-10 21:44:53 +03:00
parent 7401d74aa6
commit 6403ee0634
68 changed files with 104 additions and 108 deletions

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("sheep"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.fallback")),
loot: LootTable("common.loot_tables.fallback"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("humanoid"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.fallback")),
loot: LootTable("common.loot_tables.fallback"),
main_tool: Some(Choice([
(1.0, Some(Item("common.items.weapons.tool.broom"))),

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("goose"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.fallback")),
loot: LootTable("common.loot_tables.fallback"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("harvester"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-0.boss")),
loot: LootTable("common.loot_tables.dungeon.tier-0.boss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("gnarling"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-0.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-0.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.gnarling.adlet_bow")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("deadwood"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-0.miniboss")),
loot: LootTable("common.loot_tables.dungeon.tier-0.miniboss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("gnarling"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-0.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-0.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.gnarling.wooden_spear")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("gnarling"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-0.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-0.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.gnarling.gnoll_staff")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("yeti"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-1.boss")),
loot: LootTable("common.loot_tables.dungeon.tier-1.boss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("adlet"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-1.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-1.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.adlet.adlet_bow")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("rat"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.creature.quad_small.generic")),
loot: LootTable("common.loot_tables.creature.quad_small.generic"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("adlet"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-1.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-1.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.adlet.wooden_spear")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("adlet"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-1.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-1.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.adlet.gnoll_staff")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("tidalwarrior"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-2.boss")),
loot: LootTable("common.loot_tables.dungeon.tier-2.boss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("sahagin"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-2.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-2.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.sahagin.adlet_bow")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("hakulaq"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.creature.quad_low.fanged")),
loot: LootTable("common.loot_tables.creature.quad_low.fanged"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("sahagin"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-2.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-2.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.sahagin.wooden_spear")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("sahagin"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-2.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-2.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.sahagin.gnoll_staff")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("bonerattler"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.creature.quad_medium.carapace")),
loot: LootTable("common.loot_tables.creature.quad_medium.carapace"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("claygolem"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-3.boss")),
loot: LootTable("common.loot_tables.dungeon.tier-3.boss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("haniwa"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-3.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-3.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.haniwa.adlet_bow")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: Exact(Object(HaniwaSentry)),
alignment: Alignment(Enemy),
loot: Some(Item("common.items.crafting_ing.stones")),
loot: Item("common.items.crafting_ing.stones"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("haniwa"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-3.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-3.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.haniwa.wooden_spear")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("haniwa"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-3.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-3.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.haniwa.gnoll_staff")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("minotaur"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-4.boss")),
loot: LootTable("common.loot_tables.dungeon.tier-4.boss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("myrmidon"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-4.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-4.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.myrmidon.adlet_bow")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("dullahan"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-4.miniboss")),
loot: LootTable("common.loot_tables.dungeon.tier-4.miniboss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("myrmidon"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-4.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-4.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.myrmidon.wooden_spear")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("myrmidon"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-4.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-4.enemy"),
main_tool: Some(Item("common.items.npc_weapons.biped_small.myrmidon.gnoll_staff")),
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("humanoid"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.miniboss")),
loot: LootTable("common.loot_tables.dungeon.tier-5.miniboss"),
main_tool: Some(Choice([
(1.0, Some(Item("common.items.weapons.axe.malachite_axe-0"))),

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("mindflayer"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.boss")),
loot: LootTable("common.loot_tables.dungeon.tier-5.boss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("humanoid"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-5.enemy"),
main_tool: Some(Choice([
(1.0, Some(Item("common.items.weapons.axe_1h.orichalcum-0"))),

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("darkhound"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.minion")),
loot: LootTable("common.loot_tables.dungeon.tier-5.minion"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("husk"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.minion")),
loot: LootTable("common.loot_tables.dungeon.tier-5.minion"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("husk_brute"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.miniboss")),
loot: LootTable("common.loot_tables.dungeon.tier-5.miniboss"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: Exact(Object(Crossbow)),
alignment: Alignment(Enemy),
loot: Some(Item("common.items.crafting_ing.twigs")),
loot: Item("common.items.crafting_ing.twigs"),
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("cultist_warlock"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-5.enemy"),
main_tool: Some(Choice([
(1.5, Some(Item("common.items.npc_weapons.staff.bipedlarge-cultist"))),

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("cultist_warlord"),
alignment: Alignment(Enemy),
loot: Some(LootTable("common.loot_tables.dungeon.tier-5.enemy")),
loot: LootTable("common.loot_tables.dungeon.tier-5.enemy"),
main_tool: Some(Choice([
(1.5, Some(Item("common.items.npc_weapons.sword.bipedlarge-cultist"))),

View File

@ -27,7 +27,8 @@ EntityConfig (
/// Loot
/// Can be Item (with asset_specifier for item)
/// or LootTable (with asset_specifier for loot table)
loot: Some(LootTable("common.loot_tables.humanoids")),
/// or Uninit (means it should be specified something in the code)
loot: LootTable("common.loot_tables.humanoids"),
/// Meta Info (level, alignment, agency, etc)
// meta: {},

View File

@ -3,7 +3,7 @@ EntityConfig (
body: Exact(Object(TrainingDummy)),
alignment: Alignment(Passive),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("humanoid"),
alignment: Alignment(Npc),
loot: None,
loot: Uninit,
main_tool: Some(Item("common.items.weapons.sword.iron-4")),
second_tool: None,

View File

@ -4,7 +4,7 @@ EntityConfig (
alignment: Alignment(Npc),
// considering giving some gold/gems/materials?
loot: None,
loot: Uninit,
main_tool: Some(Item("common.items.weapons.bow.eldwood-0")),
second_tool: None,

View File

@ -4,7 +4,7 @@ EntityConfig (
body: RandomWith("humanoid"),
alignment: Alignment(Npc),
loot: None,
loot: Uninit,
main_tool: Some(Choice([
(1.0, Some(Item("common.items.weapons.tool.broom"))),

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("dreadhorn"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("frostfang"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("grolgar"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("mammoth"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("troll_mountain"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("rocksnapper"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -6,7 +6,7 @@ EntityConfig (
))),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("snowleopard"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("raptor_snow"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("wendigo"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("wolf"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("yale"),
alignment: Alignment(Enemy),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("alpaca"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: Exact(QuadrupedSmall(Body(species: Fox, body_type: Female))),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: Exact(QuadrupedSmall(Body(species: Hare, body_type: Female))),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("eagle"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("highland"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("llama"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("moose"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("mouflon"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("owl"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("tuskram"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -3,7 +3,7 @@ EntityConfig (
body: RandomWith("yak"),
alignment: Alignment(Wild),
loot: None,
loot: Uninit,
main_tool: None,
second_tool: None,

View File

@ -24,6 +24,7 @@ enum BodyBuilder {
enum LootKind {
Item(String),
LootTable(String),
Uninit,
}
#[derive(Debug, Deserialize, Clone)]
@ -37,9 +38,11 @@ struct EntityConfig {
name: Option<String>,
body: BodyBuilder,
alignment: AlignmentMark,
loot: Option<LootKind>,
loot: LootKind,
// TODO: replace with `hands` field to support one 2h weapon/ pair 1h weapons
main_tool: Option<ItemSpec>,
second_tool: Option<ItemSpec>,
// Meta fields
loadout_asset: Option<String>,
skillset_asset: Option<String>,
}
@ -141,17 +144,16 @@ impl EntityInfo {
self = self.with_alignment(alignment);
}
if let Some(loot) = loot {
match loot {
LootKind::Item(asset) => {
self = self.with_loot_drop(Item::new_from_asset_expect(&asset));
},
LootKind::LootTable(asset) => {
let table = Lottery::<LootSpec<String>>::load_expect(&asset);
let drop = table.read().choose().to_item();
self = self.with_loot_drop(drop);
},
}
match loot {
LootKind::Item(asset) => {
self = self.with_loot_drop(Item::new_from_asset_expect(&asset));
},
LootKind::LootTable(asset) => {
let table = Lottery::<LootSpec<String>>::load_expect(&asset);
let drop = table.read().choose().to_item();
self = self.with_loot_drop(drop);
},
LootKind::Uninit => {},
}
let rng = &mut rand::thread_rng();
@ -360,17 +362,16 @@ mod tests {
BodyBuilder::Exact { .. } | BodyBuilder::Uninit => {},
}
if let Some(loot) = loot {
match loot {
LootKind::Item(asset) => {
std::mem::drop(Item::new_from_asset_expect(&asset));
},
LootKind::LootTable(asset) => {
// we need to just load it check if it exists,
// because all loot tables are tested in Lottery module
let _ = Lottery::<LootSpec<String>>::load_expect(&asset);
},
}
match loot {
LootKind::Item(asset) => {
std::mem::drop(Item::new_from_asset_expect(&asset));
},
LootKind::LootTable(asset) => {
// we need to just load it check if it exists,
// because all loot tables are tested in Lottery module
let _ = Lottery::<LootSpec<String>>::load_expect(&asset);
},
LootKind::Uninit => {},
}
if let Some(loadout_asset) = loadout_asset {

View File

@ -1,19 +1,15 @@
use crate::{column::ColumnSample, sim::SimChunk, IndexRef, CONFIG};
use common::{
assets::{self, AssetExt},
comp::{
fish_medium, fish_small, quadruped_low, quadruped_medium, quadruped_small, theropod,
Alignment,
},
generation::{ChunkSupplement, EntityInfo},
resources::TimeOfDay,
terrain::Block,
time::DayPeriod::{self, Evening, Morning, Night, Noon},
time::DayPeriod,
vol::{BaseVol, ReadVol, RectSizedVol, WriteVol},
};
use rand::prelude::*;
use serde::Deserialize;
use std::{f32, ops::Range};
use std::f32;
use vek::*;
fn close(x: f32, tgt: f32, falloff: f32) -> f32 {
@ -172,7 +168,7 @@ pub fn wildlife_spawn_manifest() -> Vec<(&'static str, DensityFn)> {
}
}),
// River animals
("world.wildlife.spawn.tropical.river", |c_, col| {
("world.wildlife.spawn.tropical.river", |_c, col| {
close(col.temp, CONFIG.tropical_temp, 0.5)
* if col.water_dist.map(|d| d < 10.0).unwrap_or(false) {
0.001
@ -181,15 +177,12 @@ pub fn wildlife_spawn_manifest() -> Vec<(&'static str, DensityFn)> {
}
}),
// Rainforest area animals
(
"world.wildlife.spawn.tropical.rainforest_area",
|c, _col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.desert_hum, 0.4)
* BASE_DENSITY
* 2.0
},
),
("world.wildlife.spawn.tropical.rainforest", |c, _col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.desert_hum, 0.4)
* BASE_DENSITY
* 2.0
}),
// Rock animals
("world.wildlife.spawn.tropical.rock", |c, col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.5) * col.rock * BASE_DENSITY * 5.0
@ -202,7 +195,7 @@ pub fn wildlife_spawn_manifest() -> Vec<(&'static str, DensityFn)> {
* BASE_DENSITY
* 0.8
}),
// Hot area animals
// Wasteland animals
("world.wildlife.spawn.desert.wasteland", |c, _col| {
close(c.temp, CONFIG.desert_temp + 0.2, 0.3)
* close(c.humidity, CONFIG.desert_hum, 0.5)
@ -210,7 +203,7 @@ pub fn wildlife_spawn_manifest() -> Vec<(&'static str, DensityFn)> {
* 1.3
}),
// River animals
("world.wildlife.spawn.desert.river", |_c, _col| {
("world.wildlife.spawn.desert.river", |_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
@ -218,6 +211,7 @@ pub fn wildlife_spawn_manifest() -> Vec<(&'static str, DensityFn)> {
0.0
}
}),
// Hot area desert
("world.wildlife.spawn.desert.hot", |c, _col| {
close(c.temp, CONFIG.desert_temp + 0.2, 0.3) * BASE_DENSITY * 3.8
}),
@ -264,7 +258,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
if let Some(time) = time {
current_day_period = DayPeriod::from(time.0)
} else {
current_day_period = Noon
current_day_period = DayPeriod::Noon
}
let entity_group = scatter