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:
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: [
|
groups: [
|
||||||
(1, (1, 1, "common.entity.wild.aggressive.ogre")),
|
(1, (1, 1, "common.entity.wild.aggressive.ogre")),
|
||||||
(1, (1, 1, "common.entity.wild.aggressive.swamp_troll")),
|
(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,
|
is_underwater: false,
|
||||||
day_period: [Night, Morning, Noon, Evening],
|
day_period: [Night, Morning, Noon, Evening],
|
||||||
|
@ -12,7 +12,6 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use common::{
|
use common::{
|
||||||
assets::AssetExt,
|
assets::AssetExt,
|
||||||
comp,
|
|
||||||
generation::{ChunkSupplement, EntityInfo},
|
generation::{ChunkSupplement, EntityInfo},
|
||||||
lottery::Lottery,
|
lottery::Lottery,
|
||||||
terrain::{Block, BlockKind, SpriteKind},
|
terrain::{Block, BlockKind, SpriteKind},
|
||||||
@ -454,68 +453,39 @@ pub fn apply_caves_supplement<'a>(
|
|||||||
&& cave_base < surface_z as i32 - 40
|
&& cave_base < surface_z as i32 - 40
|
||||||
{
|
{
|
||||||
let entity = EntityInfo::at(wpos2d.map(|e| e as f32).with_z(z as f32));
|
let entity = EntityInfo::at(wpos2d.map(|e| e as f32).with_z(z as f32));
|
||||||
let entity = if cave_depth < 70.0 {
|
let entity = {
|
||||||
let species = match dynamic_rng.gen_range(0..4) {
|
let asset = if cave_depth < 70.0 {
|
||||||
0 => comp::quadruped_small::Species::Truffler,
|
match dynamic_rng.gen_range(0..4) {
|
||||||
1 => comp::quadruped_small::Species::Dodarock,
|
0 => "common.entity.wild.peaceful.truffler",
|
||||||
2 => comp::quadruped_small::Species::Holladon,
|
1 => "common.entity.wild.aggressive.dodarock",
|
||||||
_ => comp::quadruped_small::Species::Batfox,
|
2 => "common.entity.wild.peaceful.holladon",
|
||||||
};
|
_ => "common.entity.wild.aggressive.batfox",
|
||||||
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 {
|
} else if cave_depth < 120.0 {
|
||||||
let species = match dynamic_rng.gen_range(0..3) {
|
match dynamic_rng.gen_range(0..3) {
|
||||||
0 => comp::quadruped_low::Species::Rocksnapper,
|
0 => "common.entity.wild.aggressive.rocksnapper",
|
||||||
1 => comp::quadruped_low::Species::Salamander,
|
1 => "common.entity.wild.aggressive.cave_salamander",
|
||||||
_ => comp::quadruped_low::Species::Asp,
|
_ => "common.entity.wild.aggressive.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 {
|
} else if cave_depth < 190.0 {
|
||||||
let species = match dynamic_rng.gen_range(0..3) {
|
match dynamic_rng.gen_range(0..3) {
|
||||||
0 => comp::quadruped_low::Species::Rocksnapper,
|
0 => "common.entity.wild.aggressive.rocksnapper",
|
||||||
1 => comp::quadruped_low::Species::Lavadrake,
|
1 => "common.entity.wild.aggressive.lavadrake",
|
||||||
_ => comp::quadruped_low::Species::Basilisk,
|
_ => "common.entity.wild.aggressive.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 {
|
} else {
|
||||||
let species = match dynamic_rng.gen_range(0..5) {
|
match dynamic_rng.gen_range(0..5) {
|
||||||
0 => comp::biped_large::Species::Ogre,
|
0 => "common.entity.wild.aggressive.ogre",
|
||||||
1 => comp::biped_large::Species::Cyclops,
|
1 => "common.entity.wild.aggressive.cyclops",
|
||||||
2 => comp::biped_large::Species::Wendigo,
|
2 => "common.entity.wild.aggressive.wendigo",
|
||||||
3 => match dynamic_rng.gen_range(0..2) {
|
3 => match dynamic_rng.gen_range(0..2) {
|
||||||
0 => comp::biped_large::Species::Blueoni,
|
0 => "common.entity.wild.aggressive.blue_oni",
|
||||||
_ => comp::biped_large::Species::Redoni,
|
_ => "common.entity.wild.aggressive.red_oni",
|
||||||
},
|
},
|
||||||
_ => comp::biped_large::Species::Cavetroll,
|
_ => "common.entity.wild.aggressive.cave_troll",
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
entity.with_asset_expect(asset)
|
||||||
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()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
supplement.add_entity(entity);
|
supplement.add_entity(entity);
|
||||||
|
Reference in New Issue
Block a user