add merchants to savannah pits

This commit is contained in:
flo 2022-11-13 19:14:26 +00:00 committed by Christof Petig
parent 97f3fa56d3
commit 6d8f2c8c7b
2 changed files with 41 additions and 0 deletions

View File

@ -299,6 +299,35 @@ pub fn init(
});
}
},
SiteKind::SavannahPit(site2) => {
for _ in 0..4 {
rtsim.entities.insert(Entity {
is_loaded: false,
pos: site2
.plots()
.filter(|plot| {
matches!(plot.kind(), world::site2::PlotKind::SavannahPit(_))
})
.choose(&mut thread_rng())
.map_or(site.get_origin(), |plot| {
site2.tile_center_wpos(
plot.root_tile()
+ Vec2::new(
thread_rng().gen_range(-5..5),
thread_rng().gen_range(-5..5),
),
)
})
.with_z(0)
.map(|e| e as f32),
seed: thread_rng().gen(),
controller: RtSimController::default(),
last_time_ticked: 0.0,
kind: RtSimEntityKind::Merchant,
brain: Brain::merchant(site_id, &mut thread_rng()),
});
}
},
SiteKind::DesertCity(site2) => {
// villagers
for _ in 0..(site2.plazas().len() as f32 * 1.5) as usize {

View File

@ -1581,6 +1581,12 @@ impl Structure for SavannahPit {
}
let lantern_pos = tower_center - 3;
painter.sprite(lantern_pos.with_z(base + (length / 2)), SpriteKind::Lantern);
// tunnel lanterns
let tunnel_lantern_pos = tower_center - 3;
painter.sprite(
tunnel_lantern_pos.with_z(base - (2 * length) - 2),
SpriteKind::Lantern,
);
}
// watchtowers with entries
for dir in CARDINALS {
@ -1644,6 +1650,12 @@ impl Structure for SavannahPit {
}
let lantern_pos = center + dir * (7 * wall_length);
painter.sprite(lantern_pos.with_z(base + (length / 2)), SpriteKind::Lantern);
// tunnel lanterns
let tunnel_lantern_pos = tower_center;
painter.sprite(
tunnel_lantern_pos.with_z(base - (2 * length) - 2),
SpriteKind::Lantern,
);
}
}
}