Add first support tactic

This commit is contained in:
2026-06-18 03:11:35 +09:00
parent b0d26530f2
commit 618a780796
9 changed files with 263 additions and 23 deletions

View File

@@ -97,9 +97,10 @@ $validActions = @("log", "dialogue", "set_objective", "spawn_deployment", "spawn
$validEffects = @("heal_hp", "heal_mp")
$validItemKinds = @("weapon", "armor", "accessory", "consumable")
$validBonusStats = @("hp", "mp", "atk", "def", "int", "agi")
$validSkillKinds = @("damage", "heal")
$validSkillKinds = @("damage", "heal", "support")
$validSkillTargets = @("enemy", "ally", "self", "any")
$validSkillStats = @("atk", "def", "int", "agi")
$validSkillEffectTypes = @("stat_bonus")
$knownFlagIds = New-Object System.Collections.Generic.HashSet[string]
$knownFlagValueKinds = @{}
$joinedOfficerIds = New-Object System.Collections.Generic.HashSet[string]
@@ -658,6 +659,32 @@ function Check-Skill-Definitions() {
if (-not $validSkillStats.Contains($stat)) {
Fail "Skill $skillId references unsupported stat: $stat"
}
$effects = Get-Prop $skill "effects" @()
if ($kind -eq "support" -and @($effects).Count -eq 0) {
Fail "Support skill $skillId must define at least one effect."
}
foreach ($effect in @($effects)) {
if ($effect -isnot [pscustomobject]) {
Fail "Skill $skillId has malformed effect."
continue
}
$effectType = [string](Get-Prop $effect "type" "")
if (-not $validSkillEffectTypes.Contains($effectType)) {
Fail "Skill $skillId has unknown effect: $effectType"
}
if ($effectType -eq "stat_bonus") {
$effectStat = [string](Get-Prop $effect "stat" "")
if (-not $validSkillStats.Contains($effectStat)) {
Fail "Skill $skillId effect references unsupported stat: $effectStat"
}
if ([int](Get-Prop $effect "amount" 0) -eq 0) {
Fail "Skill $skillId stat_bonus effect must have non-zero amount."
}
if ([int](Get-Prop $effect "duration_turns" 1) -le 0) {
Fail "Skill $skillId stat_bonus effect must have positive duration_turns."
}
}
}
}
}