aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-25 11:20:10 +0300
committerValentin Popov <valentin@popov.link>2026-11-25 11:20:10 +0300
commitbccae28a00af19dc095910073e7e820aa81dc393 (patch)
tree77f8f37bff10b6274a84b87fd7f3b3e329089c1b /crates/fparkan-runtime/src/lib.rs
parent05fe0d6d8c10629d0b485d1eb3c1e25279164a53 (diff)
downloadfparkan-bccae28a00af19dc095910073e7e820aa81dc393.tar.xz
fparkan-bccae28a00af19dc095910073e7e820aa81dc393.zip
feat(ai): guard the least defended clan building
Execute Handler(37) from the live clan roster, rank nearby guard strength and feed the existing protection scheduler. Keep the native strict 250-unit radius, first tie and empty-roster sentinel. Count approximate selections by clan and target in simulation reports. The GOG AI handler was called directly for weak buildings, equal strength, the radius boundary and an empty roster. Stock missions 8, 9 and 10 now assign guard patrols before reaching the next explicit script blocker. Mission 9 ran in the window with clean Vulkan validation. The existing factory protection regression and workspace checks pass.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
-rw-r--r--crates/fparkan-runtime/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs
index a2d24893..722c7750 100644
--- a/crates/fparkan-runtime/src/lib.rs
+++ b/crates/fparkan-runtime/src/lib.rs
@@ -2965,6 +2965,7 @@ pub struct SimulationReport {
pub script_capture_queries: Vec<(usize, u64)>,
pub script_attack_queries: Vec<(usize, u64)>,
pub script_factory_defence_queries: Vec<(usize, u32, u64)>,
+ pub script_building_defence_queries: Vec<(usize, u32, u64)>,
pub script_base_threat_queries: Vec<(usize, u32, u64)>,
pub script_group_orders: Vec<(usize, u32, u64)>,
pub script_problem_waits: Vec<(usize, u32, u64)>,
@@ -3019,6 +3020,7 @@ pub fn simulate_mission_report(
script_capture_queries: Vec::new(),
script_attack_queries: Vec::new(),
script_factory_defence_queries: Vec::new(),
+ script_building_defence_queries: Vec::new(),
script_base_threat_queries: Vec::new(),
script_group_orders: Vec::new(),
script_problem_waits: Vec::new(),
@@ -3117,6 +3119,9 @@ pub fn simulate_mission_report(
.script_factory_defence_queries
.extend(loaded.clan_ai_events.factory_defence_queries());
report
+ .script_building_defence_queries
+ .extend(loaded.clan_ai_events.building_defence_queries());
+ report
.script_base_threat_queries
.extend(loaded.clan_ai_events.base_threat_queries());
report