From 471123378bfe5bf0bed3168b21abe822c41c95e0 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Thu, 18 Jun 2026 00:45:56 +0900 Subject: [PATCH] Add Ma Chao retreat scenario --- README.md | 3 +- data/campaign/campaign.json | 5 + data/scenarios/038_ma_chao_retreat.json | 359 ++++++++++++++++++++++++ docs/DATA_MODEL.md | 4 +- docs/ROADMAP.md | 5 +- 5 files changed, 372 insertions(+), 4 deletions(-) create mode 100644 data/scenarios/038_ma_chao_retreat.json diff --git a/README.md b/README.md index fc56248..f7aeb7b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Godot 4 tactical RPG prototype inspired by classic turn-based Romance of the Thr ## Current Slice -- Thirty-seven campaign scenarios. +- Thirty-eight campaign scenarios. - Grid movement. - Unit selection. - Move, attack, wait, end turn. @@ -58,6 +58,7 @@ Godot 4 tactical RPG prototype inspired by classic turn-based Romance of the Thr - Weishui Camps consumes the Ma Chao Counterstroke branch flags and turns the Wei River line into a test of ground and alliance trust. - Weishui Crossing consumes the Weishui Camps branch flags and turns the western campaign from river defense into a Guanzhong foothold. - Guanzhong Foothold consumes the Weishui Crossing branch flags and turns the seized riverbank into a western base against Ma Chao's rearguard. +- Ma Chao Retreat consumes the Guanzhong Foothold branch flags and drives the western campaign toward Guanzhong pacification or the Hanzhong front. - Post-battle choices can save campaign flags that branch later briefing text, shop stock, and scenario events. - Scenario post-battle dialogue can play before the victory result panel. - Basic battle EXP, level-ups, and core first-tier class promotion routes. diff --git a/data/campaign/campaign.json b/data/campaign/campaign.json index d1f6bd1..090ea2c 100644 --- a/data/campaign/campaign.json +++ b/data/campaign/campaign.json @@ -188,6 +188,11 @@ "id": "037_guanzhong_foothold", "title": "Guanzhong Foothold", "path": "res://data/scenarios/037_guanzhong_foothold.json" + }, + { + "id": "038_ma_chao_retreat", + "title": "Ma Chao Retreat", + "path": "res://data/scenarios/038_ma_chao_retreat.json" } ] } diff --git a/data/scenarios/038_ma_chao_retreat.json b/data/scenarios/038_ma_chao_retreat.json new file mode 100644 index 0000000..71e8811 --- /dev/null +++ b/data/scenarios/038_ma_chao_retreat.json @@ -0,0 +1,359 @@ +{ + "id": "038_ma_chao_retreat", + "name": "Ma Chao Retreat", + "objectives": { + "victory": "Reach Ma Chao's retreat road with Cao Cao, then defeat the western rearguard.", + "defeat": "Cao Cao is defeated or the battle reaches Turn 18." + }, + "conditions": { + "victory": { "type": "all_units_defeated", "team": "enemy", "after_event": "retreat_road_reached" }, + "defeat": [ + { "type": "any_officer_defeated", "team": "player", "officer_ids": ["cao_cao"] }, + { "type": "turn_reached", "turn": 18, "team": "player" } + ] + }, + "briefing": { + "title": "Ma Chao Retreat", + "location": "Western Guanzhong, 211 CE", + "lines": [ + "The Guanzhong foothold holds, and Ma Chao's riders begin to give ground toward the western roads.", + "Cao Cao must decide whether the retreat becomes a clean pursuit or a wider pacification before Hanzhong draws the next line." + ], + "conditional_lines": [ + { + "campaign_flags": { "secured_guanzhong_commandery": true }, + "lines": [ + "Secured commandery stores give Cao Cao a steadier pursuit column and enough grain to keep pressure on the retreat." + ] + }, + { + "campaign_flags": { "pressed_ma_chao_retreat": true }, + "lines": [ + "The hard pursuit keeps Ma Chao's riders from fully reforming, but it stretches Cao Cao's front toward rougher western roads." + ] + } + ] + }, + "shop": { + "items": [ + "bean", + "wine", + "iron_sword", + "training_spear", + "short_bow", + "hand_axe", + "war_axe", + "leather_armor", + "iron_armor" + ], + "conditional_items": [ + { + "campaign_flags": { "secured_guanzhong_commandery": true }, + "items": ["imperial_seal"] + }, + { + "campaign_flags": { "pressed_ma_chao_retreat": true }, + "items": ["war_drum"] + } + ] + }, + "roster": { + "max_units": 7, + "required_officers": ["cao_cao", "guo_jia"] + }, + "formation": { + "cells": [[1, 3], [1, 4], [1, 5], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6]] + }, + "map": { + "width": 18, + "height": 11, + "terrain": [ + "GGGGHHGGGGGGHHGGGG", + "GGFFHHGGRRGGHHFFGG", + "GGRRRRRRRRRRRRFFGG", + "GGGFGHGGGGRRGGGGGG", + "RRRRRRRRRRRRRRRRRR", + "GGGGGHHGGGRRGFFGGG", + "GGHHGFFFGGFFFGGHHG", + "GGHHGFFFGGFFFGGHHG", + "GGGGGGFFGGHHHGGGGG", + "GGFFGGGGGGHHHFFGGG", + "GGGGGGGGGGGGGGGGGG" + ] + }, + "deployments": [ + { + "unit_id": "cao_cao_ch38", + "officer_id": "cao_cao", + "team": "player", + "pos": [1, 4] + }, + { + "unit_id": "guo_jia_ch38", + "officer_id": "guo_jia", + "team": "player", + "requires_joined": true, + "pos": [2, 4] + }, + { + "unit_id": "zhang_he_ch38", + "officer_id": "zhang_he", + "team": "player", + "requires_joined": true, + "pos": [2, 3] + }, + { + "unit_id": "xiahou_dun_ch38", + "officer_id": "xiahou_dun", + "team": "player", + "pos": [1, 5] + }, + { + "unit_id": "dian_wei_ch38", + "officer_id": "dian_wei", + "team": "player", + "requires_joined": true, + "pos": [2, 5] + }, + { + "unit_id": "xiahou_yuan_ch38", + "officer_id": "xiahou_yuan", + "team": "player", + "requires_joined": true, + "pos": [3, 3] + }, + { + "unit_id": "cao_ren_ch38", + "officer_id": "cao_ren", + "team": "player", + "requires_joined": true, + "pos": [3, 4] + }, + { + "unit_id": "ma_chao_retreat_guard", + "name": "Ma Chao Retreat Guard", + "class_id": "elite_cavalry", + "team": "enemy", + "level": 36, + "pos": [14, 4], + "base": { "hp": 144, "mp": 16, "atk": 41, "def": 29, "int": 14, "agi": 30 } + }, + { + "unit_id": "pang_de_rear_column", + "name": "Pang De Rear Column", + "class_id": "champion", + "team": "enemy", + "level": 35, + "pos": [15, 3], + "base": { "hp": 128, "mp": 12, "atk": 38, "def": 26, "int": 12, "agi": 24 } + }, + { + "unit_id": "western_road_captain", + "name": "Western Road Captain", + "class_id": "guard_captain", + "team": "enemy", + "level": 35, + "pos": [12, 4], + "base": { "hp": 102, "atk": 36, "def": 29 } + }, + { + "unit_id": "retreat_tactic_advisor", + "name": "Retreat Tactic Advisor", + "class_id": "military_advisor", + "team": "enemy", + "level": 35, + "pos": [13, 5], + "skills": ["blaze", "great_mend"], + "base": { "hp": 90, "mp": 74, "atk": 8, "def": 18, "int": 38, "agi": 18 } + }, + { + "unit_id": "retreat_spear_north", + "name": "Retreat Spear Guard", + "class_id": "infantry", + "team": "enemy", + "level": 35, + "pos": [12, 3], + "base": { "hp": 92, "atk": 36, "def": 26 } + }, + { + "unit_id": "retreat_spear_south", + "name": "Retreat Spear Guard", + "class_id": "infantry", + "team": "enemy", + "level": 35, + "pos": [12, 5], + "base": { "hp": 92, "atk": 36, "def": 26 } + }, + { + "unit_id": "western_road_marksman", + "name": "Western Road Marksman", + "class_id": "marksman", + "team": "enemy", + "level": 35, + "pos": [13, 2], + "base": { "hp": 84, "atk": 37, "def": 14, "agi": 27 } + } + ], + "events": [ + { + "id": "opening", + "once": true, + "when": { "type": "battle_start" }, + "actions": [ + { "type": "log", "text": "Cao Cao presses the western road as Ma Chao's retreat guard tries to keep Guanzhong from closing behind them." } + ] + }, + { + "id": "opening_dialogue", + "once": true, + "when": { "type": "battle_begin" }, + "actions": [ + { + "type": "dialogue", + "lines": [ + { "speaker": "Xiahou Yuan", "text": "Ma Chao is falling back, but not broken. His rear guard still turns like a blade." }, + { "speaker": "Guo Jia", "text": "A retreat that chooses where to stop is still a plan." }, + { "speaker": "Cao Cao", "text": "Then take the choice away." } + ] + } + ] + }, + { + "id": "commandery_stores_feed_pursuit", + "once": true, + "when": { "type": "turn_start", "team": "player", "turn": 2, "campaign_flags": { "secured_guanzhong_commandery": true } }, + "actions": [ + { + "type": "dialogue", + "lines": [ + { "speaker": "Cao Ren", "text": "Guanzhong stores are feeding the column. The pursuit can stay ordered." }, + { "speaker": "Cao Cao", "text": "Order is how pursuit becomes conquest." } + ] + } + ] + }, + { + "id": "hard_pursuit_catches_rear", + "once": true, + "when": { "type": "turn_start", "team": "enemy", "turn": 2, "campaign_flags": { "pressed_ma_chao_retreat": true } }, + "actions": [ + { + "type": "dialogue", + "lines": [ + { "speaker": "Ma Chao Retreat Guard", "text": "Cao Cao is too close. Turn the rear column and buy the west one more road." }, + { "speaker": "Zhang He", "text": "The pursuit has touched their spine. Expect the rearguard to snap back." } + ] + }, + { + "type": "spawn_deployment", + "deployment": { + "unit_id": "ma_clan_rear_riders", + "name": "Ma Clan Rear Riders", + "class_id": "cavalry", + "team": "enemy", + "level": 35, + "pos": [16, 3], + "base": { "hp": 84, "atk": 33, "def": 18, "agi": 24 } + } + } + ] + }, + { + "id": "turn_4_western_road_narrows", + "once": true, + "when": { "type": "turn_start", "team": "enemy", "turn": 4 }, + "actions": [ + { + "type": "dialogue", + "lines": [ + { "speaker": "Pang De Rear Column", "text": "The road narrows ahead. Hold them here or the retreat becomes a rout." }, + { "speaker": "Xiahou Yuan", "text": "He knows the road better than we do. That makes speed matter." } + ] + } + ] + }, + { + "id": "retreat_road_reached", + "once": true, + "when": { "type": "unit_reaches_tile", "team": "player", "officer_ids": ["cao_cao"], "pos": [10, 4] }, + "actions": [ + { + "type": "set_objective", + "victory": "Ma Chao's retreat road is reached. Defeat the western rearguard.", + "defeat": "Cao Cao is defeated or the battle reaches Turn 18." + }, + { + "type": "dialogue", + "lines": [ + { "speaker": "Cao Cao", "text": "This road decides whether Ma Chao retreats or escapes. Break the rearguard." }, + { "speaker": "Ma Chao Retreat Guard", "text": "The west is not yours while one horse still turns." } + ] + }, + { + "type": "spawn_deployments", + "deployments": [ + { + "unit_id": "retreat_halberd_guard", + "name": "Retreat Halberd Guard", + "class_id": "guard_captain", + "team": "enemy", + "level": 35, + "pos": [16, 4], + "base": { "hp": 100, "atk": 36, "def": 29 } + }, + { + "unit_id": "western_rear_arrow_screen", + "name": "Western Rear Arrow Screen", + "class_id": "archer", + "team": "enemy", + "level": 35, + "pos": [16, 5], + "base": { "hp": 78, "atk": 35, "def": 12, "agi": 25 } + } + ] + } + ] + }, + { + "id": "turn_9_retreat_frays", + "once": true, + "when": { "type": "turn_start", "team": "player", "turn": 9 }, + "actions": [ + { + "type": "dialogue", + "lines": [ + { "speaker": "Zhang He", "text": "Their retreat is losing its rhythm." }, + { "speaker": "Cao Cao", "text": "Then strike before rhythm becomes distance." } + ] + } + ] + } + ], + "rewards": { + "gold": 7400, + "items": ["bean", "wine", "imperial_seal"] + }, + "post_battle_dialogue": [ + { "speaker": "Guo Jia", "text": "Ma Chao's retreat guard is broken. Guanzhong can be settled, or Hanzhong can be watched before Zhang Lu makes his own terms." }, + { "speaker": "Xiahou Yuan", "text": "Pacifying the west will quiet the roads. Preparing Hanzhong will keep the next gate from closing." }, + { "speaker": "Cao Cao", "text": "The west is never silent for long. Choose where our next silence is made." } + ], + "post_battle_choices": [ + { + "id": "pacify_guanzhong", + "label": "Pacify Guanzhong", + "description": "Cao Cao pacifies Guanzhong's commanderies before looking toward Hanzhong.", + "set_flags": { "pacified_guanzhong": true, "prepared_hanzhong_front": false }, + "gold": 1150, + "items": ["imperial_seal"] + }, + { + "id": "prepare_hanzhong_front", + "label": "Prepare Hanzhong", + "description": "Cao Cao prepares the Hanzhong front before Zhang Lu can harden the passes.", + "set_flags": { "pacified_guanzhong": false, "prepared_hanzhong_front": true }, + "gold": 950, + "items": ["war_drum"] + } + ] +} diff --git a/docs/DATA_MODEL.md b/docs/DATA_MODEL.md index 59854e1..719fe8a 100644 --- a/docs/DATA_MODEL.md +++ b/docs/DATA_MODEL.md @@ -48,6 +48,7 @@ data/scenarios/034_ma_chao_counterstroke.json data/scenarios/035_weishui_camps.json data/scenarios/036_weishui_crossing.json data/scenarios/037_guanzhong_foothold.json +data/scenarios/038_ma_chao_retreat.json ``` ## Campaign @@ -97,7 +98,8 @@ The campaign file defines scenario order, resource paths, and officers who are a { "id": "034_ma_chao_counterstroke", "title": "Ma Chao Counterstroke", "path": "res://data/scenarios/034_ma_chao_counterstroke.json" }, { "id": "035_weishui_camps", "title": "Weishui Camps", "path": "res://data/scenarios/035_weishui_camps.json" }, { "id": "036_weishui_crossing", "title": "Weishui Crossing", "path": "res://data/scenarios/036_weishui_crossing.json" }, - { "id": "037_guanzhong_foothold", "title": "Guanzhong Foothold", "path": "res://data/scenarios/037_guanzhong_foothold.json" } + { "id": "037_guanzhong_foothold", "title": "Guanzhong Foothold", "path": "res://data/scenarios/037_guanzhong_foothold.json" }, + { "id": "038_ma_chao_retreat", "title": "Ma Chao Retreat", "path": "res://data/scenarios/038_ma_chao_retreat.json" } ] } ``` diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index ad18628..421a334 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -21,7 +21,7 @@ - Destination victory conditions and objective map markers exist. - Turn-limit conditions and HUD turn-limit display exist. - Victory reward summary is visible. -- Next-battle flow exists across the current thirty-seven-scenario campaign. +- Next-battle flow exists across the current thirty-eight-scenario campaign. - Campaign completion and new-campaign reset exist. - Reward inventory can be brought into the next battle. @@ -52,7 +52,7 @@ - Party roster persistence has a first save-file skeleton. - Level, experience, and equipment persistence. - Chapter selection and save/load. -- Linear thirty-seven-scenario campaign order exists. +- Linear thirty-eight-scenario campaign order exists. - Save reset exists. - Victory rewards, consumable counts, equipment stock, and equipped gear persist. - A basic pre-battle shop with scenario-specific stock exists. Sell-back and richer item management are still planned. @@ -97,6 +97,7 @@ - Thirty-fifth-scenario content exists with Wei River camp pressure, Ma Chao river assaults, Han Sui mistrust, and 034 branch reactions. - Thirty-sixth-scenario content exists with Wei River crossing pressure, Guanzhong foothold stakes, western alliance strain, and 035 branch reactions. - Thirty-seventh-scenario content exists with Guanzhong foothold pressure, Ma Chao's rearguard, split-alliance tension, and 036 branch reactions. +- Thirty-eighth-scenario content exists with Ma Chao retreat pressure, Guanzhong commandery stakes, western road pursuit, and 037 branch reactions. ## Milestone 5: Presentation