From 77ab4031f5c140ae5bce4096abab0552a0675ef9 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 20:58:58 +0400 Subject: feat(ai): dispatch scripted attacks against logical targets Resolve the stock logical target and feed it to unit combat. Mission 20 assigns the attack at startup and continues through the remaining Init commands. All 29 original missions completed 15 minutes without a hard Init or periodic Mission stop. --- crates/fparkan-runtime/src/clan_script_init.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crates/fparkan-runtime/src/clan_script_init.rs') diff --git a/crates/fparkan-runtime/src/clan_script_init.rs b/crates/fparkan-runtime/src/clan_script_init.rs index fedc8ee9..3e102be3 100644 --- a/crates/fparkan-runtime/src/clan_script_init.rs +++ b/crates/fparkan-runtime/src/clan_script_init.rs @@ -5,6 +5,10 @@ use fparkan_script::{ pub(super) enum InitOrder { Patrol(ScriptPatrol), + Attack { + id: u32, + target: u32, + }, Move { id: u32, destination: [u32; 2], @@ -46,6 +50,14 @@ pub(super) fn unit_order( let order = declarations .resolve_handler15_with_values(instruction, values) .ok()?; + if let (3, 3, Handler15TargetPayload::ByLogicId(target)) = + (order.word_1, order.word_2, order.target) + { + return Some(InitOrder::Attack { + id: order.word_0, + target, + }); + } if let (2, insertion @ (1 | 3), Handler15TargetPayload::ByPlace { first, second }) = (order.word_1, order.word_2, order.target) { -- cgit v1.2.3