From 127d41dfe91b8eed2b83be4f6f6be586c501ecf9 Mon Sep 17 00:00:00 2001 From: autocommit Date: Thu, 30 Apr 2026 00:14:46 -0700 Subject: [PATCH] =?UTF-8?q?feat(simulator):=20=E2=9C=A8=20Add=20Rust=20API?= =?UTF-8?q?=20bindings=20for=20bridge-related=20city=20operations=20in=20s?= =?UTF-8?q?imulator=20extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/simulator/api-gdext/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/simulator/api-gdext/src/lib.rs b/src/simulator/api-gdext/src/lib.rs index a26561c2..479c8c06 100644 --- a/src/simulator/api-gdext/src/lib.rs +++ b/src/simulator/api-gdext/src/lib.rs @@ -1546,6 +1546,20 @@ impl GdCity { fn mark_attacked(&mut self, turn: i64) { self.inner.mark_attacked(turn.max(0) as u32); } + + /// Mark the city as captured on `turn`. Enables the occupation production + /// penalty for the next OCCUPATION_TURNS turns. + #[func] + fn mark_captured(&mut self, turn: i64) { + self.inner.mark_captured(turn.max(0) as u32); + } + + /// Returns the production multiplier for `current_turn`. + /// 0.5 while the city is under occupation (first 5 turns post-capture), 1.0 otherwise. + #[func] + fn get_occupation_production_mult(&self, current_turn: i64) -> f64 { + self.inner.occupation_production_mult(current_turn.max(0) as u32) + } } // ── Private helpers for GdCity ──────────────────────────────────────────