Add dialogue portrait slots

This commit is contained in:
2026-06-18 03:38:45 +09:00
parent bdd38104f4
commit 2166ea51ef
7 changed files with 97 additions and 11 deletions

View File

@@ -392,7 +392,7 @@ Conditions may include `after_event` to stay inactive until a one-shot event has
`unit_reaches_tile` checks living deployed units against a zero-based `pos` coordinate. Use `officer_ids` for persistent named officers or `unit_ids` for scenario-specific units; the validator requires one of those filters so destination objectives do not accidentally trigger from any unit. Victory destination cells are drawn as objective markers on the battle map.
`post_battle_dialogue` plays once after victory and before the victory result panel opens. Lines may be plain strings or objects with `speaker` and non-empty `text`.
`post_battle_dialogue` plays once after victory and before the victory result panel opens. Lines may be plain strings or objects with `speaker`, non-empty `text`, and optional `portrait` resource paths such as `res://art/portraits/cao_cao.png`. If no usable portrait is loaded, the battle scene falls back to a speaker-initial panel.
`post_battle_choices` are shown on the victory result panel after first-time scenario rewards are applied. Each choice needs a unique stable lowercase `id`, a non-empty `label`, and a `set_flags` object whose keys are stable lowercase flag ids. Choices may also grant positive `gold`, known `items`, `join_officers`, and `leave_officers`. When rewards are saved but the player has not selected a choice yet, `CampaignState.pending_post_battle_choice_scenario_id` records that scenario id so reloading the game returns to the victory choice panel instead of skipping the branch. The selected choice is saved to `CampaignState.flags`, `CampaignState.applied_post_battle_choices`, and campaign membership only when the player presses its result-panel button; completed-scenario replays do not show choices again. Save-load migration for older saves uses flags as a conservative choice signal, so avoid designing multiple choices in one scenario that can all match the same saved flag state.
@@ -413,7 +413,7 @@ Scenario `events` support `battle_start`, `battle_begin`, `turn_start`, and move
{
"type": "dialogue",
"lines": [
{ "speaker": "Cao Cao", "text": "Hold formation." }
{ "speaker": "Cao Cao", "portrait": "res://art/portraits/cao_cao.png", "text": "Hold formation." }
]
},
{ "type": "set_objective", "victory": "Defeat the vanguard and reinforcements." },