aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/clan_script_init.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-14 19:11:32 +0300
committerValentin Popov <valentin@popov.link>2026-11-14 19:11:32 +0300
commit38cd46123518136222473662df409f78cc63584b (patch)
tree312719305797fdd4c62fd2964322f23523a83e3b /crates/fparkan-runtime/src/clan_script_init.rs
parentc374b6e4b219f9dccaf09c8b709f243ad6eb4290 (diff)
downloadfparkan-38cd46123518136222473662df409f78cc63584b.tar.xz
fparkan-38cd46123518136222473662df409f78cc63584b.zip
feat(ai): issue scripted place patrols from clan Init
Handler(15) читает живые клетки и направляет размещённого варбота в указанную точку. Кампания 01, миссия 02 при штатном старте ставит четыре патруля и продолжает Init до Handler(51).
Diffstat (limited to 'crates/fparkan-runtime/src/clan_script_init.rs')
-rw-r--r--crates/fparkan-runtime/src/clan_script_init.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/crates/fparkan-runtime/src/clan_script_init.rs b/crates/fparkan-runtime/src/clan_script_init.rs
index ce0d3e2f..f9c23498 100644
--- a/crates/fparkan-runtime/src/clan_script_init.rs
+++ b/crates/fparkan-runtime/src/clan_script_init.rs
@@ -1,4 +1,23 @@
-use fparkan_script::ScriptInstruction;
+use crate::script_patrol::ScriptPatrol;
+use fparkan_script::{ScriptDispatchSelector, ScriptInstruction, VarSet, VarSetDefault};
+
+pub(super) fn patrol_order(
+ declarations: &VarSet,
+ instruction: &ScriptInstruction,
+ values: &[VarSetDefault],
+) -> Option<ScriptPatrol> {
+ if instruction.dispatch_selector() != ScriptDispatchSelector::Handler(15)
+ || instruction.header_words[1] != u32::MAX
+ || instruction.header_words[3] != u32::MAX
+ {
+ return None;
+ }
+ ScriptPatrol::from_order(
+ declarations
+ .resolve_handler15_with_values(instruction, values)
+ .ok()?,
+ )
+}
pub(super) fn stubbed_handler(instruction: &ScriptInstruction) -> Option<u8> {
// shortcut: resume Init after the catalog refresh until the live research context is wired.