Add battlefield visuals and camp talk slice
This commit is contained in:
@@ -500,6 +500,9 @@ function Check-Deployment($Deployment, [string]$ScenarioId, [int]$Width, [int]$H
|
||||
if (Has-Prop $Deployment "portrait") {
|
||||
Check-Portrait-Path (Get-Prop $Deployment "portrait" "") "Scenario $ScenarioId deployment $unitId portrait"
|
||||
}
|
||||
if (Has-Prop $Deployment "sprite") {
|
||||
Check-Portrait-Path (Get-Prop $Deployment "sprite" "") "Scenario $ScenarioId deployment $unitId sprite"
|
||||
}
|
||||
if (Has-Prop $Deployment "requires_joined") {
|
||||
if (-not ((Get-Prop $Deployment "requires_joined" $false) -is [bool])) {
|
||||
Fail "Scenario $ScenarioId deployment $unitId requires_joined must be boolean."
|
||||
@@ -871,6 +874,9 @@ function Check-Item-Effects() {
|
||||
$itemId = $itemProp.Name
|
||||
$item = $itemProp.Value
|
||||
$kind = [string](Get-Prop $item "kind" "")
|
||||
if (Has-Prop $item "icon") {
|
||||
Check-Portrait-Path (Get-Prop $item "icon" "") "Item $itemId icon"
|
||||
}
|
||||
if (-not $validItemKinds.Contains($kind)) {
|
||||
Fail "Item $itemId has unknown kind: $kind"
|
||||
}
|
||||
@@ -1197,6 +1203,25 @@ function Check-Shop($Shop, [string]$ScenarioId) {
|
||||
if (Has-Prop $Shop "stock") {
|
||||
Check-Shop-Stock-Block $Shop.stock $seenShopItems "Scenario $ScenarioId shop"
|
||||
}
|
||||
if (Has-Prop $Shop "merchant") {
|
||||
$merchant = Get-Prop $Shop "merchant" $null
|
||||
if ($null -eq $merchant -or $merchant -is [string] -or $merchant -is [System.Array]) {
|
||||
Fail "Scenario $ScenarioId shop merchant must be an object."
|
||||
}
|
||||
$merchantName = [string](Get-Prop $merchant "name" "Merchant")
|
||||
if ([string]::IsNullOrWhiteSpace($merchantName)) {
|
||||
Fail "Scenario $ScenarioId shop merchant has an empty name."
|
||||
}
|
||||
$merchantLines = Get-Prop $merchant "lines" $null
|
||||
if ($null -eq $merchantLines -or -not ($merchantLines -is [System.Array])) {
|
||||
Fail "Scenario $ScenarioId shop merchant must have line array."
|
||||
}
|
||||
foreach ($merchantLine in @($merchantLines)) {
|
||||
if ([string]::IsNullOrWhiteSpace([string]$merchantLine)) {
|
||||
Fail "Scenario $ScenarioId shop merchant has an empty line."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$conditionalItems = Get-Prop $Shop "conditional_items" @()
|
||||
foreach ($block in @($conditionalItems)) {
|
||||
@@ -1670,6 +1695,9 @@ function Check-Briefing($Briefing, [string]$ScenarioId) {
|
||||
Fail "Scenario $ScenarioId briefing has an empty line."
|
||||
}
|
||||
}
|
||||
foreach ($line in @((Get-Prop $Briefing "camp_dialogue" @()))) {
|
||||
Check-Dialogue-Line $line "Scenario $ScenarioId briefing camp_dialogue"
|
||||
}
|
||||
|
||||
$conditionalLines = Get-Prop $Briefing "conditional_lines" @()
|
||||
foreach ($block in @($conditionalLines)) {
|
||||
@@ -1814,6 +1842,9 @@ Check-Class-Promotions
|
||||
|
||||
foreach ($classProp in $classes.PSObject.Properties) {
|
||||
Check-Skill-Refs (Get-Prop $classProp.Value "skills" @()) "Class $($classProp.Name)"
|
||||
if (Has-Prop $classProp.Value "sprite") {
|
||||
Check-Portrait-Path (Get-Prop $classProp.Value "sprite" "") "Class $($classProp.Name) sprite"
|
||||
}
|
||||
}
|
||||
|
||||
$officerNames = New-Object System.Collections.Generic.HashSet[string]
|
||||
@@ -1842,6 +1873,9 @@ foreach ($scenario in $campaign.scenarios) {
|
||||
}
|
||||
|
||||
$map = $scenarioData.map
|
||||
if (Has-Prop $map "background") {
|
||||
Check-Portrait-Path (Get-Prop $map "background" "") "Scenario $scenarioId map background"
|
||||
}
|
||||
$width = [int]$map.width
|
||||
$height = [int]$map.height
|
||||
$rows = @($map.terrain)
|
||||
|
||||
Reference in New Issue
Block a user