From 8d7d2af8fd6ec1bfe99dc8656da654b0ccd6fbfa Mon Sep 17 00:00:00 2001 From: Claude Code Date: Wed, 8 Apr 2026 17:32:56 -0700 Subject: [PATCH] =?UTF-8?q?feat(api-gdext):=20=E2=9C=A8=20Add=20Rust=20bin?= =?UTF-8?q?dings=20for=20Godot=20engine=20extensions=20with=20new=20API=20?= =?UTF-8?q?functions=20and=20compatibility=20improvements?= 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 {