From 6d8f2c8c7b48b3442bb34bb483aacafcf4c1a3bc Mon Sep 17 00:00:00 2001 From: flo Date: Sun, 13 Nov 2022 19:14:26 +0000 Subject: [PATCH] add merchants to savannah pits --- server/src/rtsim/mod.rs | 29 ++++++++++++++++++++++++++++ world/src/site2/plot/savannah_pit.rs | 12 ++++++++++++ 2 files changed, 41 insertions(+) diff --git a/server/src/rtsim/mod.rs b/server/src/rtsim/mod.rs index acad75ee0a..bd6796c497 100644 --- a/server/src/rtsim/mod.rs +++ b/server/src/rtsim/mod.rs @@ -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 { diff --git a/world/src/site2/plot/savannah_pit.rs b/world/src/site2/plot/savannah_pit.rs index 18738344da..d6357565b1 100644 --- a/world/src/site2/plot/savannah_pit.rs +++ b/world/src/site2/plot/savannah_pit.rs @@ -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, + ); } } }