{
  "id": "060_southern_holdouts",
  "name": "Southern Holdouts",
  "objectives": {
    "victory": "Reach the southern holdout camp with Cao Cao, then defeat the holdout captain.",
    "defeat": "Cao Cao is defeated or the battle reaches Turn 18."
  },
  "conditions": {
    "victory": { "type": "all_units_defeated", "team": "enemy", "after_event": "southern_holdout_camp_reached" },
    "defeat": [
      { "type": "any_officer_defeated", "team": "player", "officer_ids": ["cao_cao"] },
      { "type": "turn_reached", "turn": 18, "team": "player" }
    ]
  },
  "briefing": {
    "title": "Southern Holdouts",
    "location": "Southern Canal Camp, Jianye Outskirts, Eastern Front, 220 CE",
    "lines": [
      "Wu's surrender road has opened, but scattered officers and boat captains still gather south of Jianye.",
      "Cao Cao leads a final sweep through the canal camp to decide whether the southern holdouts are settled under Wei order or driven toward the Nanhai route."
    ],
    "conditional_lines": [
      {
        "campaign_flags": { "accepted_wu_surrender": true },
        "lines": [
          "Accepting Wu's surrender brings local guides and clerks to Wei's side, giving the army clearer roads through the southern camp."
        ]
      },
      {
        "campaign_flags": { "pursued_wu_holdouts": true },
        "lines": [
          "Pursuing Wu's holdouts keeps them moving, but the canal captains now fight with every escape boat already loaded."
        ]
      }
    ]
  },
  "shop": {
    "items": [
      "bean",
      "wine",
      "iron_sword",
      "training_spear",
      "short_bow",
      "hand_axe",
      "war_axe",
      "leather_armor",
      "iron_armor"
    ],
    "conditional_items": [
      {
        "campaign_flags": { "accepted_wu_surrender": true },
        "items": ["imperial_seal"]
      },
      {
        "campaign_flags": { "pursued_wu_holdouts": 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": [
      "WWWWWWWWWWWWWWWWWW",
      "WGGGFFWWRRWWFFGGGW",
      "GGGGWWGGGGRRGGGGGG",
      "GGFFWWGGRRRRGFFGGG",
      "RRRRRRRRRRRRRRRRRR",
      "GGFFWWGGRRRRGFFGGG",
      "GGGGWWGGGGRRGGGGGG",
      "GHHHWWGFFFGGFFFGGG",
      "GHHHWWGGGGHHHGGGGG",
      "GGGGWWGGGGHHHFFGGG",
      "WWWWWWWWWWWWWWWWWW"
    ]
  },
  "deployments": [
    {
      "unit_id": "cao_cao_ch60",
      "officer_id": "cao_cao",
      "team": "player",
      "pos": [1, 4]
    },
    {
      "unit_id": "guo_jia_ch60",
      "officer_id": "guo_jia",
      "team": "player",
      "requires_joined": true,
      "pos": [2, 4]
    },
    {
      "unit_id": "zhang_he_ch60",
      "officer_id": "zhang_he",
      "team": "player",
      "requires_joined": true,
      "pos": [2, 3]
    },
    {
      "unit_id": "xiahou_dun_ch60",
      "officer_id": "xiahou_dun",
      "team": "player",
      "pos": [1, 5]
    },
    {
      "unit_id": "dian_wei_ch60",
      "officer_id": "dian_wei",
      "team": "player",
      "requires_joined": true,
      "pos": [2, 5]
    },
    {
      "unit_id": "xiahou_yuan_ch60",
      "officer_id": "xiahou_yuan",
      "team": "player",
      "requires_joined": true,
      "pos": [3, 3]
    },
    {
      "unit_id": "cao_ren_ch60",
      "officer_id": "cao_ren",
      "team": "player",
      "requires_joined": true,
      "pos": [3, 4]
    },
    {
      "unit_id": "southern_holdout_captain",
      "name": "Southern Holdout Captain",
      "class_id": "commander",
      "team": "enemy",
      "level": 57,
      "pos": [14, 4],
      "base": { "hp": 194, "mp": 94, "atk": 60, "def": 51, "int": 49, "agi": 36 }
    },
    {
      "unit_id": "southern_camp_guard",
      "name": "Southern Camp Guard",
      "class_id": "guard_captain",
      "team": "enemy",
      "level": 57,
      "pos": [12, 4],
      "base": { "hp": 148, "atk": 59, "def": 52 }
    },
    {
      "unit_id": "southern_holdout_canal_boat",
      "name": "Southern Holdout Canal Boat",
      "class_id": "champion",
      "team": "enemy",
      "move_type": "water",
      "level": 57,
      "pos": [4, 3],
      "base": { "hp": 176, "mp": 12, "atk": 61, "def": 47, "int": 16, "agi": 43 }
    },
    {
      "unit_id": "southern_holdout_advisor",
      "name": "Southern Holdout Advisor",
      "class_id": "military_advisor",
      "team": "enemy",
      "level": 57,
      "pos": [13, 5],
      "skills": ["blaze", "great_mend"],
      "base": { "hp": 134, "mp": 118, "atk": 8, "def": 38, "int": 60, "agi": 33 }
    },
    {
      "unit_id": "southern_spear_north",
      "name": "Southern Spear",
      "class_id": "infantry",
      "team": "enemy",
      "level": 57,
      "pos": [12, 3],
      "base": { "hp": 136, "atk": 58, "def": 48 }
    },
    {
      "unit_id": "southern_spear_south",
      "name": "Southern Spear",
      "class_id": "infantry",
      "team": "enemy",
      "level": 57,
      "pos": [12, 5],
      "base": { "hp": 136, "atk": 58, "def": 48 }
    },
    {
      "unit_id": "southern_arrow_boat",
      "name": "Southern Arrow Boat",
      "class_id": "marksman",
      "team": "enemy",
      "move_type": "water",
      "level": 57,
      "pos": [5, 5],
      "base": { "hp": 128, "atk": 59, "def": 34, "agi": 46 }
    }
  ],
  "events": [
    {
      "id": "opening",
      "once": true,
      "when": { "type": "battle_start" },
      "actions": [
        { "type": "log", "text": "Wei sweeps south of Jianye to break the remaining Wu holdout camp." }
      ]
    },
    {
      "id": "opening_dialogue",
      "once": true,
      "when": { "type": "battle_begin" },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Xiahou Yuan", "text": "The southern camp is ahead. Their boats are tied close, but the road still reaches them." },
            { "speaker": "Guo Jia", "text": "Holdouts do not need a capital. They need a rumor that refusal still has somewhere to run." },
            { "speaker": "Cao Cao", "text": "Then close the road and quiet the rumor." }
          ]
        }
      ]
    },
    {
      "id": "accepted_surrender_guides_south",
      "once": true,
      "when": { "type": "turn_start", "team": "player", "turn": 2, "campaign_flags": { "accepted_wu_surrender": true } },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Cao Ren", "text": "The surrendered clerks marked the camp stores. Their captains cannot hide their supply road." },
            { "speaker": "Cao Cao", "text": "A city that accepts order should see order rewarded. Advance cleanly." }
          ]
        }
      ]
    },
    {
      "id": "pursued_holdouts_launch_escape_boat",
      "once": true,
      "when": { "type": "turn_start", "team": "enemy", "turn": 2, "campaign_flags": { "pursued_wu_holdouts": true } },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Southern Holdout Captain", "text": "Wei chased us from the surrender road. Launch the escape boat and cut their flank." },
            { "speaker": "Dian Wei", "text": "They run loudly for men who claim they still hold a camp." }
          ]
        },
        {
          "type": "spawn_deployment",
          "deployment": {
            "unit_id": "southern_escape_boat",
            "name": "Southern Escape Boat",
            "class_id": "champion",
            "team": "enemy",
            "move_type": "water",
            "level": 57,
            "pos": [5, 3],
            "base": { "hp": 126, "atk": 54, "def": 38, "agi": 44 }
          }
        }
      ]
    },
    {
      "id": "turn_4_holdouts_burn_records",
      "once": true,
      "when": { "type": "turn_start", "team": "enemy", "turn": 4 },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Southern Holdout Advisor", "text": "Burn the rosters. If the camp falls, Wei must not know who fled south." },
            { "speaker": "Guo Jia", "text": "A man who burns names expects those names to matter. Take the camp before ash becomes rumor." }
          ]
        }
      ]
    },
    {
      "id": "southern_holdout_camp_reached",
      "once": true,
      "when": { "type": "unit_reaches_tile", "team": "player", "officer_ids": ["cao_cao"], "pos": [10, 4] },
      "actions": [
        {
          "type": "set_objective",
          "victory": "The southern holdout camp is reached. Defeat the holdout captain.",
          "defeat": "Cao Cao is defeated or the battle reaches Turn 18."
        },
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Cao Cao", "text": "This camp is the last breath of Jianye's refusal. Extinguish it." },
            { "speaker": "Southern Holdout Captain", "text": "Then hear that breath become a southern wind." }
          ]
        },
        {
          "type": "spawn_deployments",
          "deployments": [
            {
              "unit_id": "southern_holdout_last_guard",
              "name": "Southern Holdout Last Guard",
              "class_id": "guard_captain",
              "team": "enemy",
              "level": 57,
              "pos": [16, 4],
              "base": { "hp": 144, "atk": 58, "def": 51 }
            },
            {
              "unit_id": "southern_crossbow_boat",
              "name": "Southern Crossbow Boat",
              "class_id": "marksman",
              "team": "enemy",
              "move_type": "water",
              "level": 57,
              "pos": [10, 1],
              "base": { "hp": 120, "atk": 57, "def": 31, "agi": 45 }
            }
          ]
        }
      ]
    },
    {
      "id": "turn_9_holdout_line_frays",
      "once": true,
      "when": { "type": "turn_start", "team": "player", "turn": 9 },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Zhang He", "text": "Their camp line is fraying. Some look south; some look at the ground." },
            { "speaker": "Cao Cao", "text": "Leave them no direction but surrender." }
          ]
        }
      ]
    }
  ],
  "rewards": {
    "gold": 11800,
    "items": ["bean", "wine", "iron_armor"]
  },
  "post_battle_dialogue": [
    { "speaker": "Guo Jia", "text": "The southern holdout camp is broken. We can settle the remaining officers into Jianye's new order, or press the route toward Nanhai before refusal hardens again." },
    { "speaker": "Cao Ren", "text": "Settlement gives the city fewer wounds. Pursuit gives the south fewer places to gather." },
    { "speaker": "Cao Cao", "text": "A campaign ends when the next banner cannot find hands. Choose where those hands are watched." }
  ],
  "post_battle_choices": [
    {
      "id": "settle_southern_holdouts",
      "label": "Settle Holdouts",
      "description": "Cao Cao settles the remaining southern holdouts under Wei's Jianye administration.",
      "set_flags": { "settled_southern_holdouts": true, "pressed_nanhai_route": false },
      "gold": 2250,
      "items": ["imperial_seal"]
    },
    {
      "id": "press_nanhai_route",
      "label": "Press Nanhai",
      "description": "Cao Cao sends the army down the southern route before fleeing holdouts can gather again.",
      "set_flags": { "settled_southern_holdouts": false, "pressed_nanhai_route": true },
      "gold": 2050,
      "items": ["war_drum"]
    }
  ]
}
