mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Cave now uses entity configs.
This commit is contained in:
parent
56b17e7141
commit
70c2e9bebe
11
assets/common/entity/wild/aggressive/basilisk.ron
Normal file
11
assets/common/entity/wild/aggressive/basilisk.ron
Normal file
@ -0,0 +1,11 @@
|
||||
EntityConfig (
|
||||
name: Automatic,
|
||||
body: RandomWith("basilisk"),
|
||||
alignment: Alignment(Enemy),
|
||||
|
||||
loot: LootTable("common.loot_tables.creature.quad_low.basilisk"),
|
||||
|
||||
hands: Uninit,
|
||||
|
||||
meta: [],
|
||||
)
|
11
assets/common/entity/wild/aggressive/blue_oni.ron
Normal file
11
assets/common/entity/wild/aggressive/blue_oni.ron
Normal file
@ -0,0 +1,11 @@
|
||||
EntityConfig (
|
||||
name: Automatic,
|
||||
body: RandomWith("oni_blue"),
|
||||
alignment: Alignment(Enemy),
|
||||
|
||||
loot: LootTable("common.loot_tables.creature.biped_large.default"),
|
||||
|
||||
hands: Uninit,
|
||||
|
||||
meta: [],
|
||||
)
|
11
assets/common/entity/wild/aggressive/cave_salamander.ron
Normal file
11
assets/common/entity/wild/aggressive/cave_salamander.ron
Normal file
@ -0,0 +1,11 @@
|
||||
EntityConfig (
|
||||
name: Automatic,
|
||||
body: RandomWith("salamander"),
|
||||
alignment: Alignment(Enemy),
|
||||
|
||||
loot: LootTable("common.loot_tables.creature.quad_low.salamander"),
|
||||
|
||||
hands: Uninit,
|
||||
|
||||
meta: [],
|
||||
)
|
11
assets/common/entity/wild/aggressive/cave_troll.ron
Normal file
11
assets/common/entity/wild/aggressive/cave_troll.ron
Normal file
@ -0,0 +1,11 @@
|
||||
EntityConfig (
|
||||
name: Automatic,
|
||||
body: RandomWith("troll_cave"),
|
||||
alignment: Alignment(Enemy),
|
||||
|
||||
loot: LootTable("common.loot_tables.creature.biped_large.troll"),
|
||||
|
||||
hands: Uninit,
|
||||
|
||||
meta: [],
|
||||
)
|
11
assets/common/entity/wild/aggressive/red_oni.ron
Normal file
11
assets/common/entity/wild/aggressive/red_oni.ron
Normal file
@ -0,0 +1,11 @@
|
||||
EntityConfig (
|
||||
name: Automatic,
|
||||
body: RandomWith("oni_red"),
|
||||
alignment: Alignment(Enemy),
|
||||
|
||||
loot: LootTable("common.loot_tables.creature.biped_large.default"),
|
||||
|
||||
hands: Uninit,
|
||||
|
||||
meta: [],
|
||||
)
|
@ -6,7 +6,7 @@ SpawnEntry (
|
||||
groups: [
|
||||
(1, (1, 1, "common.entity.wild.aggressive.ogre")),
|
||||
(1, (1, 1, "common.entity.wild.aggressive.swamp_troll")),
|
||||
(1, (1, 1, "common.entity.wild.aggressive.cyclope")),
|
||||
(1, (1, 1, "common.entity.wild.aggressive.cyclops")),
|
||||
],
|
||||
is_underwater: false,
|
||||
day_period: [Night, Morning, Noon, Evening],
|
||||
|
@ -12,7 +12,6 @@ use crate::{
|
||||
};
|
||||
use common::{
|
||||
assets::AssetExt,
|
||||
comp,
|
||||
generation::{ChunkSupplement, EntityInfo},
|
||||
lottery::Lottery,
|
||||
terrain::{Block, BlockKind, SpriteKind},
|
||||
@ -454,68 +453,39 @@ pub fn apply_caves_supplement<'a>(
|
||||
&& cave_base < surface_z as i32 - 40
|
||||
{
|
||||
let entity = EntityInfo::at(wpos2d.map(|e| e as f32).with_z(z as f32));
|
||||
let entity = if cave_depth < 70.0 {
|
||||
let species = match dynamic_rng.gen_range(0..4) {
|
||||
0 => comp::quadruped_small::Species::Truffler,
|
||||
1 => comp::quadruped_small::Species::Dodarock,
|
||||
2 => comp::quadruped_small::Species::Holladon,
|
||||
_ => comp::quadruped_small::Species::Batfox,
|
||||
let entity = {
|
||||
let asset = if cave_depth < 70.0 {
|
||||
match dynamic_rng.gen_range(0..4) {
|
||||
0 => "common.entity.wild.peaceful.truffler",
|
||||
1 => "common.entity.wild.aggressive.dodarock",
|
||||
2 => "common.entity.wild.peaceful.holladon",
|
||||
_ => "common.entity.wild.aggressive.batfox",
|
||||
}
|
||||
} else if cave_depth < 120.0 {
|
||||
match dynamic_rng.gen_range(0..3) {
|
||||
0 => "common.entity.wild.aggressive.rocksnapper",
|
||||
1 => "common.entity.wild.aggressive.cave_salamander",
|
||||
_ => "common.entity.wild.aggressive.asp",
|
||||
}
|
||||
} else if cave_depth < 190.0 {
|
||||
match dynamic_rng.gen_range(0..3) {
|
||||
0 => "common.entity.wild.aggressive.rocksnapper",
|
||||
1 => "common.entity.wild.aggressive.lavadrake",
|
||||
_ => "common.entity.wild.aggressive.basilisk",
|
||||
}
|
||||
} else {
|
||||
match dynamic_rng.gen_range(0..5) {
|
||||
0 => "common.entity.wild.aggressive.ogre",
|
||||
1 => "common.entity.wild.aggressive.cyclops",
|
||||
2 => "common.entity.wild.aggressive.wendigo",
|
||||
3 => match dynamic_rng.gen_range(0..2) {
|
||||
0 => "common.entity.wild.aggressive.blue_oni",
|
||||
_ => "common.entity.wild.aggressive.red_oni",
|
||||
},
|
||||
_ => "common.entity.wild.aggressive.cave_troll",
|
||||
}
|
||||
};
|
||||
let body =
|
||||
comp::quadruped_small::Body::random_with(dynamic_rng, &species);
|
||||
// FIXME:
|
||||
// Drop something.
|
||||
entity
|
||||
.with_body(body.into())
|
||||
.with_alignment(comp::Alignment::Wild)
|
||||
.with_automatic_name()
|
||||
} else if cave_depth < 120.0 {
|
||||
let species = match dynamic_rng.gen_range(0..3) {
|
||||
0 => comp::quadruped_low::Species::Rocksnapper,
|
||||
1 => comp::quadruped_low::Species::Salamander,
|
||||
_ => comp::quadruped_low::Species::Asp,
|
||||
};
|
||||
let body =
|
||||
comp::quadruped_low::Body::random_with(dynamic_rng, &species);
|
||||
// FIXME:
|
||||
// Drop something.
|
||||
entity
|
||||
.with_body(body.into())
|
||||
.with_alignment(comp::Alignment::Enemy)
|
||||
.with_automatic_name()
|
||||
} else if cave_depth < 190.0 {
|
||||
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::Basilisk,
|
||||
};
|
||||
let body =
|
||||
comp::quadruped_low::Body::random_with(dynamic_rng, &species);
|
||||
// FIXME:
|
||||
// Drop something.
|
||||
entity
|
||||
.with_body(body.into())
|
||||
.with_alignment(comp::Alignment::Enemy)
|
||||
.with_automatic_name()
|
||||
} else {
|
||||
let species = match dynamic_rng.gen_range(0..5) {
|
||||
0 => comp::biped_large::Species::Ogre,
|
||||
1 => comp::biped_large::Species::Cyclops,
|
||||
2 => comp::biped_large::Species::Wendigo,
|
||||
3 => match dynamic_rng.gen_range(0..2) {
|
||||
0 => comp::biped_large::Species::Blueoni,
|
||||
_ => comp::biped_large::Species::Redoni,
|
||||
},
|
||||
_ => comp::biped_large::Species::Cavetroll,
|
||||
};
|
||||
|
||||
let body = comp::biped_large::Body::random_with(dynamic_rng, &species);
|
||||
// FIXME:
|
||||
// Drop something.
|
||||
entity
|
||||
.with_body(body.into())
|
||||
.with_alignment(comp::Alignment::Enemy)
|
||||
.with_automatic_name()
|
||||
entity.with_asset_expect(asset)
|
||||
};
|
||||
|
||||
supplement.add_entity(entity);
|
||||
|
Loading…
Reference in New Issue
Block a user