diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 19:58:58 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 19:58:58 +0300 |
| commit | 77ab4031f5c140ae5bce4096abab0552a0675ef9 (patch) | |
| tree | 64763b31961c71bcd6591d65c3631e51b083f145 /crates/fparkan-runtime/src/clan_script_init.rs | |
| parent | e5e9f2a8ddc41f0e1af0e1ada5c1da669d40ceb0 (diff) | |
| download | fparkan-77ab4031f5c140ae5bce4096abab0552a0675ef9.tar.xz fparkan-77ab4031f5c140ae5bce4096abab0552a0675ef9.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src/clan_script_init.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/clan_script_init.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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) { |
