diff --git a/src/simulator/api-gdext/src/lib.rs b/src/simulator/api-gdext/src/lib.rs index 3681d68a..37c79902 100644 --- a/src/simulator/api-gdext/src/lib.rs +++ b/src/simulator/api-gdext/src/lib.rs @@ -1625,6 +1625,16 @@ impl GdGameState { .unwrap_or(0) } + /// Directly set the turn counter. Used by the iter 7k GDScript adapter + /// to seed the deterministic RNG from the live `GameState.turn_number` + /// so each real game turn produces a different encounter roll stream. + /// Without this, a rebuild-state-per-call pattern always starts with + /// `state.turn = 0` and produces identical RNG draws. + #[func] + fn set_turn(&mut self, turn: i64) { + self.inner.turn = turn.clamp(0, u32::MAX as i64) as u32; + } + /// Total lair count in the attached grid (all tiers). #[func] fn lair_count(&self) -> i64 {