world(ages): 建立全种族生命周期与代际基准,暂缓人物改龄
This commit is contained in:
@@ -77,6 +77,52 @@ $novelFiles = Get-ChildItem -LiteralPath (Join-Path $projectRoot '05_小说创
|
||||
$novelChars = ($novelFiles | ForEach-Object { [regex]::Replace((Get-Content -LiteralPath $_.FullName -Raw -Encoding UTF8), '\s', '').Length } | Measure-Object -Sum).Sum
|
||||
$pngCount = @(Get-ChildItem -LiteralPath (Join-Path $projectRoot '06_AI动漫制作') -Filter '*.png' -File -Recurse).Count
|
||||
|
||||
# Species tables are author-defined fiction; check internal ranges and coverage only.
|
||||
$speciesText = Read-ProjectText '02_世界设定/种族年龄与生命周期.md'
|
||||
$speciesRows = @([regex]::Matches($speciesText, '(?m)^\| ([^|]+) \| (\d+)—(\d+)岁 \| (\d+)岁 \| (\d+)—(\d+)年 \| (\d+)岁 \| (\d+)岁 \|\r?$'))
|
||||
$speciesAdults = @{}
|
||||
if ($speciesRows.Count -ne 13) { $failures.Add('Expected 13 humanoid species age rows') }
|
||||
foreach ($row in $speciesRows) {
|
||||
$name = $row.Groups[1].Value
|
||||
$matureMin = [int]$row.Groups[2].Value
|
||||
$matureMax = [int]$row.Groups[3].Value
|
||||
$adult = [int]$row.Groups[4].Value
|
||||
$lifeMin = [int]$row.Groups[5].Value
|
||||
$lifeMax = [int]$row.Groups[6].Value
|
||||
$aging = [int]$row.Groups[7].Value
|
||||
$rare = [int]$row.Groups[8].Value
|
||||
if ($speciesAdults.ContainsKey($name)) { $failures.Add("Duplicate species: $name") }
|
||||
$speciesAdults[$name] = $adult
|
||||
if ($matureMin -gt $matureMax -or $adult -lt $matureMin -or $aging -le $adult -or $aging -gt $lifeMin -or $lifeMin -gt $lifeMax -or $lifeMax -gt $rare) {
|
||||
$failures.Add("Invalid species age ranges: $name")
|
||||
}
|
||||
}
|
||||
$lifeStages = @([regex]::Matches($speciesText, '(?m)^\| ([^|]+) \| 0—(\d+) \| (\d+)—(\d+) \| (\d+)—(\d+) \| (\d+)—(\d+) \| (\d+)起 \|'))
|
||||
if ($lifeStages.Count -ne 13) { $failures.Add('Expected 13 humanoid life-stage rows') }
|
||||
foreach ($row in $lifeStages) {
|
||||
$name = $row.Groups[1].Value
|
||||
$values = @(2..9 | ForEach-Object { [int]$row.Groups[$_].Value })
|
||||
if (-not $speciesAdults.ContainsKey($name) -or $values[1] -ne $speciesAdults[$name] -or $values[0] -ge $values[1] -or $values[3] -ne ($values[2] + 1) -or $values[5] -ne ($values[4] + 1) -or $values[7] -ne ($values[6] + 1)) {
|
||||
$failures.Add("Non-contiguous adult life stages: $name")
|
||||
}
|
||||
}
|
||||
$familyRows = @([regex]::Matches($speciesText, '(?m)^\| ([^|]+) \| (\d+)—(\d+) \| (\d+)—(\d+)年 \| (\d+)—(\d+)年 \|'))
|
||||
if ($familyRows.Count -ne 13) { $failures.Add('Expected 13 family-generation rows') }
|
||||
foreach ($row in $familyRows) {
|
||||
$name = $row.Groups[1].Value
|
||||
if (-not $speciesAdults.ContainsKey($name) -or [int]$row.Groups[2].Value -lt $speciesAdults[$name] -or [int]$row.Groups[2].Value -gt [int]$row.Groups[3].Value -or [int]$row.Groups[4].Value -gt [int]$row.Groups[5].Value -or [int]$row.Groups[6].Value -gt [int]$row.Groups[7].Value) {
|
||||
$failures.Add("Invalid family age ranges: $name")
|
||||
}
|
||||
}
|
||||
$casteRows = @([regex]::Matches($speciesText, '(?m)^\| ([^|]+) \| (\d+)—(\d+)岁 \| (\d+)岁 \| (\d+)—(\d+)年 \| (\d+)岁 \| (\d+)岁 \| [^|]+ \|'))
|
||||
if ($casteRows.Count -ne 6) { $failures.Add('Expected 6 insect functional-age rows') }
|
||||
foreach ($row in $casteRows) {
|
||||
if ([int]$row.Groups[2].Value -gt [int]$row.Groups[3].Value -or [int]$row.Groups[4].Value -lt [int]$row.Groups[2].Value -or [int]$row.Groups[7].Value -le [int]$row.Groups[4].Value -or [int]$row.Groups[7].Value -gt [int]$row.Groups[5].Value -or [int]$row.Groups[5].Value -gt [int]$row.Groups[6].Value -or [int]$row.Groups[6].Value -gt [int]$row.Groups[8].Value) {
|
||||
$failures.Add("Invalid insect age ranges: $($row.Groups[1].Value)")
|
||||
}
|
||||
}
|
||||
Write-Output "Species: $($speciesRows.Count); life stages: $($lifeStages.Count); family rows: $($familyRows.Count); insect castes: $($casteRows.Count)"
|
||||
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user