world: 细化魔族十族与三十三支系生活设定

This commit is contained in:
2026-09-28 22:40:22 +08:00
parent 2687f49f85
commit 5f6c1a6dfe
25 changed files with 393 additions and 27 deletions
+41
View File
@@ -150,6 +150,47 @@ foreach ($row in $casteRows) {
}
Write-Output "Species: $($speciesRows.Count); life stages: $($lifeStages.Count); family rows: $($familyRows.Count); insect castes: $($casteRows.Count)"
# The demon taxonomy distinguishes physiology, culture and political membership.
# Compare its age summary against the existing source table, not duplicated constants.
$taxonomyText = Read-ProjectText '02_世界设定/魔族种族分类与生活图谱.md'
$taxonRows = @([regex]::Matches($taxonomyText, '(?m)^\| (M\d{2}) \| ([^|]+) \| ([^|]+) \| (\d+)岁 \| (\d+)—(\d+)年 \|'))
$branchRows = @([regex]::Matches($taxonomyText, '(?m)^\| (M\d{2}-[A-Z]) \| ([^|]+) \| ([^|]+) \|'))
$expectedTaxa = @(1..10 | ForEach-Object { 'M{0:D2}' -f $_ })
if (($taxonRows | ForEach-Object { $_.Groups[1].Value }) -join ',' -ne ($expectedTaxa -join ',')) {
$failures.Add('Demon taxonomy must contain ordered M01 through M10')
}
if ($branchRows.Count -ne 33 -or @($branchRows | ForEach-Object { $_.Groups[1].Value } | Sort-Object -Unique).Count -ne 33) {
$failures.Add('Expected 33 unique demon branch/culture IDs')
}
$mappedSpecies = @()
foreach ($row in $taxonRows) {
$taxonId = $row.Groups[1].Value
$ageName = $row.Groups[3].Value
$mappedSpecies += $ageName
$sourceRows = @($speciesRows | Where-Object { $_.Groups[1].Value -eq $ageName })
if ($sourceRows.Count -ne 1) {
$failures.Add("Demon taxon lacks a unique age source: $taxonId / $ageName")
} else {
$ageSource = $sourceRows[0]
foreach ($group in 4..6) {
if ($row.Groups[$group].Value -ne $ageSource.Groups[$group].Value) {
$failures.Add("Demon taxon age mismatch: $taxonId / group $group")
}
}
}
$lastBranch = if ($taxonId -eq 'M03') { 5 } else { 2 }
$expectedBranches = @(0..$lastBranch | ForEach-Object { "$taxonId-$([char](65 + $_))" })
$actualBranches = @($branchRows | Where-Object { $_.Groups[1].Value.StartsWith("$taxonId-") } | ForEach-Object { $_.Groups[1].Value })
if (($actualBranches -join ',') -ne ($expectedBranches -join ',')) {
$failures.Add("Demon branch coverage mismatch: $taxonId")
}
}
$expectedAgeNames = @($speciesRows | Where-Object { $_.Groups[1].Value -notin @('人类', '矮人', '精灵') } | ForEach-Object { $_.Groups[1].Value })
if (($mappedSpecies | Sort-Object) -join ',' -ne (($expectedAgeNames | Sort-Object) -join ',')) {
$failures.Add('Demon taxonomy must map all ten existing age groups exactly once')
}
Write-Output "Demon taxonomy: $($taxonRows.Count) groups; $($branchRows.Count) branches/cultures; age-source mapping checked"
Write-Output "Links checked: $linkCount; timeline rows: $timelineRows; scenes: $($sceneIds.Count); scene budget: $sceneTotal sec"
Write-Output "Shots: $($shots.Count); shot budget: $cumulative sec; script body non-whitespace chars: $scriptChars"
Write-Output "Novel draft files: $($novelFiles.Count); draft non-whitespace chars including headings: $novelChars; PNG references: $pngCount"