Add campaign chapter metadata

This commit is contained in:
2026-06-18 04:00:38 +09:00
parent b8378d9144
commit f0d941c273
8 changed files with 275 additions and 12 deletions

View File

@@ -82,7 +82,7 @@ data/scenarios/067_outer_islands.json
## Campaign
The campaign file defines scenario order, resource paths, and officers who are available at the start of a new campaign.
The campaign file defines chapter ranges, scenario order, resource paths, and officers who are available at the start of a new campaign.
```json
{
@@ -90,6 +90,14 @@ The campaign file defines scenario order, resource paths, and officers who are a
"title": "Cao Cao Campaign",
"start_scenario": "001_yellow_turbans",
"initial_joined_officers": ["cao_cao", "xiahou_dun"],
"chapters": [
{
"id": "rise_through_turmoil",
"title": "Rise Through Turmoil",
"start_scenario": "001_yellow_turbans",
"end_scenario": "009_xiapi_siege"
}
],
"scenarios": [
{ "id": "001_yellow_turbans", "title": "Yingchuan Skirmish", "path": "res://data/scenarios/001_yellow_turbans.json" },
{ "id": "002_sishui_gate", "title": "Sishui Gate Vanguard", "path": "res://data/scenarios/002_sishui_gate.json" },
@@ -162,6 +170,8 @@ The campaign file defines scenario order, resource paths, and officers who are a
}
```
`chapters` are display metadata for campaign presentation. Each chapter has a stable lowercase `id`, non-empty `title`, and inclusive `start_scenario`/`end_scenario` ids from the linear scenario order. When chapters are present, the validator requires the ranges to cover every campaign scenario exactly once, without overlaps or gaps. `CampaignState` uses them for briefing headers and chapter-local battle numbering; save files still store scenario ids, not chapter ids.
## Officers
Officers hold identity, personal base stats, initial class, and starting equipment.
@@ -479,4 +489,4 @@ Before a battle starts, `BattleScene` can buy priced items through `CampaignStat
When every campaign scenario id is present in `completed_scenarios`, the battle scene shows a campaign completion panel. Starting a new campaign clears the save file and resets `current_scenario_id` to `start_scenario`.
Run `tools/validate_data.ps1` after data edits to check campaign paths, map dimensions, terrain keys, class/officer/item/skill references, item effect names and amounts, equipment slot compatibility including accessory types, promotion routes and promotion equipment compatibility, condition/event names, condition unit references, destination condition coordinates, campaign flag references, joined-officer gates, briefing line blocks, deployment ids, deployment bounds, impassable spawn cells, shop stock, roster rules, formation cells, post-battle dialogue, post-battle choices, and reward item ids.
Run `tools/validate_data.ps1` after data edits to check campaign paths, chapter ranges, map dimensions, terrain keys, class/officer/item/skill references, item effect names and amounts, equipment slot compatibility including accessory types, promotion routes and promotion equipment compatibility, condition/event names, condition unit references, destination condition coordinates, campaign flag references, joined-officer gates, briefing line blocks, deployment ids, deployment bounds, impassable spawn cells, shop stock, roster rules, formation cells, post-battle dialogue, post-battle choices, and reward item ids.