diff --git a/src/simulator/api-gdext/src/lib.rs b/src/simulator/api-gdext/src/lib.rs index 301ed0e7..d133b0c1 100644 --- a/src/simulator/api-gdext/src/lib.rs +++ b/src/simulator/api-gdext/src/lib.rs @@ -1385,6 +1385,22 @@ impl GdCity { self.inner.process_culture(&ty) } + /// Process culture accumulation with a percentage modifier added to the + /// raw culture gain. `total_pct` is the SUM of all percentage bonuses + /// (cult_pct + border_pct + difficulty_culture_mult - 1.0). Rust owns + /// both the raw gain and the percent-bonus application — no GDScript-side + /// post-call adjustment needed (warcouncil p1-39 Rail-1 port, 2026-04-27). + /// Returns true if border expansion is ready post-bonus. + #[func] + fn process_culture_with_modifier(&mut self, tile_yields_json: GString, total_pct: f64) -> bool { + let ty = Self::parse_tile_yields(&tile_yields_json.to_string()); + let yields = self.inner.get_yields(&ty); + let raw_gain = yields.culture; + let scaled_gain = raw_gain * (1.0 + total_pct.max(-1.0)); + self.inner.culture_stored += scaled_gain; + self.inner.can_expand() + } + /// Add production production. #[func] fn add_production(&mut self, production: f64) {