Add guard behavior for opening defenders

This commit is contained in:
2026-06-19 19:06:50 +09:00
parent f13f20939f
commit 8f1b6fb398
6 changed files with 232 additions and 3 deletions

View File

@@ -355,6 +355,8 @@ Scenario `roster.max_units`, `roster.required_officers`, and `roster.required_un
Scenario-only protected units can use `team: "player"`, `controllable: false`, `persist_progression: false`, and an optional `ai_target_priority`. They remain valid targets for enemies, healing, and defeat conditions, but the player cannot select, move, attack, change equipment, or place them in Formation, and they are omitted from campaign roster progression snapshots. `ai_target_priority` is a non-negative scenario hint that makes enemy movement and damage-skill AI treat that unit as a more attractive target. Events can later change the same value with `set_ai_target_priority`.
Enemy deployments may set `ai_behavior: "guard"` with optional `ai_guard_anchor: [x, y]` and `ai_guard_radius` to hold villages, gates, castles, or other defensive terrain. Guard units still attack and pursue targets inside their assigned radius, but they do not abandon the guard zone to chase distant player units and will step back toward the anchor if displaced outside it.
Scenario `formation.cells` controls the highlighted starting cells available during pre-battle Formation. These choices only change the current battle's unit positions; they are not saved to campaign state. If a scenario omits `formation`, player deployment positions become the default formation cells.
## Scenarios