Add first support tactic
This commit is contained in:
@@ -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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user