mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Simplify tunnel entity spawning
This commit is contained in:
parent
8a02a943f4
commit
8da1ae578f
@ -332,33 +332,26 @@ impl GnarlingFortification {
|
||||
for terminal in &self.tunnels.terminals {
|
||||
if area.contains_point(terminal.xy() - self.origin) {
|
||||
let chance = dynamic_rng.gen_range(0..10);
|
||||
match chance {
|
||||
0..=4 => supplement
|
||||
.add_entity(mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng)),
|
||||
5 => {
|
||||
supplement
|
||||
.add_entity(mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng));
|
||||
supplement
|
||||
.add_entity(mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng));
|
||||
},
|
||||
6 => {
|
||||
supplement.add_entity(deadwood(*terminal - 5 * Vec3::unit_z(), dynamic_rng))
|
||||
},
|
||||
7 => {
|
||||
supplement
|
||||
.add_entity(mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng));
|
||||
supplement
|
||||
.add_entity(deadwood(*terminal - 5 * Vec3::unit_z(), dynamic_rng));
|
||||
},
|
||||
8 => {
|
||||
supplement
|
||||
.add_entity(mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng));
|
||||
supplement
|
||||
.add_entity(mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng));
|
||||
supplement
|
||||
.add_entity(mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng));
|
||||
},
|
||||
_ => {},
|
||||
let entities = match chance {
|
||||
0..=4 => vec![mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng)],
|
||||
5 => vec![
|
||||
mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng),
|
||||
mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng),
|
||||
],
|
||||
6 => vec![deadwood(*terminal - 5 * Vec3::unit_z(), dynamic_rng)],
|
||||
7 => vec![
|
||||
mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng),
|
||||
deadwood(*terminal - 5 * Vec3::unit_z(), dynamic_rng),
|
||||
],
|
||||
8 => vec![
|
||||
mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng),
|
||||
mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng),
|
||||
mandragora(*terminal - 5 * Vec3::unit_z(), dynamic_rng),
|
||||
],
|
||||
_ => Vec::new(),
|
||||
};
|
||||
for entity in entities {
|
||||
supplement.add_entity(entity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user