Make opening lure line wake front sentries

This commit is contained in:
2026-06-20 09:33:46 +09:00
parent bd0b7a238e
commit c41906832c
7 changed files with 103 additions and 19 deletions

View File

@@ -93,7 +93,7 @@ $validConditionTypes = @(
"any"
)
$validTriggers = @("battle_start", "battle_begin", "turn_start", "unit_reaches_tile", "unit_defeated")
$validActions = @("log", "dialogue", "set_objective", "grant_item", "grant_items", "grant_gold", "spawn_deployment", "spawn_deployments", "withdraw_unit", "withdraw_units", "set_ai_target_priority")
$validActions = @("log", "dialogue", "set_objective", "grant_item", "grant_items", "grant_gold", "spawn_deployment", "spawn_deployments", "withdraw_unit", "withdraw_units", "set_ai_awake", "set_ai_target_priority")
$validEffects = @("heal_hp", "heal_mp", "cure_status", "cleanse_debuffs")
$validItemKinds = @("weapon", "armor", "accessory", "consumable")
$validItemRarities = @("common", "named")
@@ -793,10 +793,10 @@ function Check-Event-Unit-Ids($Action, $KnownUnitIds, [string]$Context) {
}
function Check-Event-Ai-Target-Priority($Action, $KnownUnitIds, [string]$Context) {
Check-Event-Unit-Ids $Action $KnownUnitIds $Context
if (-not (Has-Prop $Action "priority")) {
Fail "$Context must set priority."
}
Check-Event-Unit-Ids $Action $KnownUnitIds $Context
if (-not (Has-Prop $Action "priority")) {
Fail "$Context must set priority."
}
$priorityValue = Get-Prop $Action "priority" 0
if (-not ($priorityValue -is [int] -or $priorityValue -is [long])) {
Fail "$Context priority must be an integer."
@@ -808,9 +808,22 @@ function Check-Event-Ai-Target-Priority($Action, $KnownUnitIds, [string]$Context
if ((Has-Prop $Action "text") -and [string]::IsNullOrWhiteSpace([string](Get-Prop $Action "text" ""))) {
Fail "$Context text must not be empty."
}
if ((Has-Prop $Action "silent") -and -not ((Get-Prop $Action "silent" $false) -is [bool])) {
Fail "$Context silent must be boolean."
}
if ((Has-Prop $Action "silent") -and -not ((Get-Prop $Action "silent" $false) -is [bool])) {
Fail "$Context silent must be boolean."
}
}
function Check-Event-Ai-Awake($Action, $KnownUnitIds, [string]$Context) {
Check-Event-Unit-Ids $Action $KnownUnitIds $Context
if ((Has-Prop $Action "awake") -and -not ((Get-Prop $Action "awake" $true) -is [bool])) {
Fail "$Context awake must be boolean."
}
if ((Has-Prop $Action "text") -and [string]::IsNullOrWhiteSpace([string](Get-Prop $Action "text" ""))) {
Fail "$Context text must not be empty."
}
if ((Has-Prop $Action "silent") -and -not ((Get-Prop $Action "silent" $false) -is [bool])) {
Fail "$Context silent must be boolean."
}
}
function Check-Class-Equipment-Slots() {
@@ -2217,12 +2230,15 @@ foreach ($scenario in $campaign.scenarios) {
$unitId = [string](Get-Prop $action "unit_id" (Get-Prop $action "id" ""))
Check-Event-Withdraw-Unit-Id $unitId $knownUnitIds "Scenario $scenarioId event $eventId withdraw_unit"
}
if ($actionType -eq "withdraw_units") {
Check-Event-Withdraw-Units (Get-Prop $action "unit_ids" $null) $knownUnitIds "Scenario $scenarioId event $eventId withdraw_units"
}
if ($actionType -eq "set_ai_target_priority") {
Check-Event-Ai-Target-Priority $action $knownUnitIds "Scenario $scenarioId event $eventId set_ai_target_priority"
}
if ($actionType -eq "withdraw_units") {
Check-Event-Withdraw-Units (Get-Prop $action "unit_ids" $null) $knownUnitIds "Scenario $scenarioId event $eventId withdraw_units"
}
if ($actionType -eq "set_ai_awake") {
Check-Event-Ai-Awake $action $knownUnitIds "Scenario $scenarioId event $eventId set_ai_awake"
}
if ($actionType -eq "set_ai_target_priority") {
Check-Event-Ai-Target-Priority $action $knownUnitIds "Scenario $scenarioId event $eventId set_ai_target_priority"
}
}
}