{
  "id": "062_southern_fleet",
  "name": "Southern Fleet",
  "objectives": {
    "victory": "Reach the southern fleet anchorage with Cao Cao, then defeat the fleet captain.",
    "defeat": "Cao Cao is defeated or the battle reaches Turn 18."
  },
  "conditions": {
    "victory": { "type": "all_units_defeated", "team": "enemy", "after_event": "southern_fleet_anchorage_reached" },
    "defeat": [
      { "type": "any_officer_defeated", "team": "player", "officer_ids": ["cao_cao"] },
      { "type": "turn_reached", "turn": 18, "team": "player" }
    ]
  },
  "briefing": {
    "title": "Southern Fleet",
    "location": "Southern Fleet Anchorage, Nanhai Coast, Eastern Front, 220 CE",
    "lines": [
      "With the Nanhai route cut, Wu's last southern captains anchor their fleet near the coast and try to keep one passage open.",
      "Cao Cao pushes along the shore road to break the anchorage and decide whether the fleet is secured or driven toward Hainan."
    ],
    "conditional_lines": [
      {
        "campaign_flags": { "secured_nanhai_route": true },
        "lines": [
          "Securing the Nanhai route gives Wei control of the shore road, forcing the fleet to defend from a known anchorage."
        ]
      },
      {
        "campaign_flags": { "pressed_southern_fleet": true },
        "lines": [
          "Pressing the southern fleet early has denied the captains rest, but every boat that remains now crowds the coast for a final stand."
        ]
      }
    ]
  },
  "shop": {
    "items": [
      "bean",
      "wine",
      "iron_sword",
      "training_spear",
      "short_bow",
      "hand_axe",
      "war_axe",
      "leather_armor",
      "iron_armor"
    ],
    "conditional_items": [
      {
        "campaign_flags": { "secured_nanhai_route": true },
        "items": ["imperial_seal"]
      },
      {
        "campaign_flags": { "pressed_southern_fleet": 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_ch62",
      "officer_id": "cao_cao",
      "team": "player",
      "pos": [1, 4]
    },
    {
      "unit_id": "guo_jia_ch62",
      "officer_id": "guo_jia",
      "team": "player",
      "requires_joined": true,
      "pos": [2, 4]
    },
    {
      "unit_id": "zhang_he_ch62",
      "officer_id": "zhang_he",
      "team": "player",
      "requires_joined": true,
      "pos": [2, 3]
    },
    {
      "unit_id": "xiahou_dun_ch62",
      "officer_id": "xiahou_dun",
      "team": "player",
      "pos": [1, 5]
    },
    {
      "unit_id": "dian_wei_ch62",
      "officer_id": "dian_wei",
      "team": "player",
      "requires_joined": true,
      "pos": [2, 5]
    },
    {
      "unit_id": "xiahou_yuan_ch62",
      "officer_id": "xiahou_yuan",
      "team": "player",
      "requires_joined": true,
      "pos": [3, 3]
    },
    {
      "unit_id": "cao_ren_ch62",
      "officer_id": "cao_ren",
      "team": "player",
      "requires_joined": true,
      "pos": [3, 4]
    },
    {
      "unit_id": "southern_fleet_captain",
      "name": "Southern Fleet Captain",
      "class_id": "commander",
      "team": "enemy",
      "level": 59,
      "pos": [14, 4],
      "base": { "hp": 202, "mp": 98, "atk": 62, "def": 53, "int": 51, "agi": 38 }
    },
    {
      "unit_id": "fleet_anchorage_guard",
      "name": "Fleet Anchorage Guard",
      "class_id": "guard_captain",
      "team": "enemy",
      "level": 59,
      "pos": [12, 4],
      "base": { "hp": 152, "atk": 61, "def": 54 }
    },
    {
      "unit_id": "southern_flagship_boat",
      "name": "Southern Flagship Boat",
      "class_id": "champion",
      "team": "enemy",
      "move_type": "water",
      "level": 59,
      "pos": [4, 3],
      "base": { "hp": 180, "mp": 12, "atk": 63, "def": 49, "int": 16, "agi": 45 }
    },
    {
      "unit_id": "southern_fleet_advisor",
      "name": "Southern Fleet Advisor",
      "class_id": "military_advisor",
      "team": "enemy",
      "level": 59,
      "pos": [13, 5],
      "skills": ["blaze", "great_mend"],
      "base": { "hp": 138, "mp": 122, "atk": 8, "def": 40, "int": 62, "agi": 35 }
    },
    {
      "unit_id": "fleet_spear_north",
      "name": "Fleet Spear",
      "class_id": "infantry",
      "team": "enemy",
      "level": 59,
      "pos": [12, 3],
      "base": { "hp": 140, "atk": 60, "def": 50 }
    },
    {
      "unit_id": "fleet_spear_south",
      "name": "Fleet Spear",
      "class_id": "infantry",
      "team": "enemy",
      "level": 59,
      "pos": [12, 5],
      "base": { "hp": 140, "atk": 60, "def": 50 }
    },
    {
      "unit_id": "fleet_arrow_boat",
      "name": "Fleet Arrow Boat",
      "class_id": "marksman",
      "team": "enemy",
      "move_type": "water",
      "level": 59,
      "pos": [5, 5],
      "base": { "hp": 132, "atk": 61, "def": 36, "agi": 48 }
    }
  ],
  "events": [
    {
      "id": "opening",
      "once": true,
      "when": { "type": "battle_start" },
      "actions": [
        { "type": "log", "text": "Wei advances along the Nanhai coast to break the southern fleet anchorage." }
      ]
    },
    {
      "id": "opening_dialogue",
      "once": true,
      "when": { "type": "battle_begin" },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Xiahou Yuan", "text": "The fleet is anchored close to the shore. Their boats can strike the road if we drift too wide." },
            { "speaker": "Guo Jia", "text": "A fleet without a safe coast is only timber waiting for weather." },
            { "speaker": "Cao Cao", "text": "Then take the coast and let their timber learn the wind." }
          ]
        }
      ]
    },
    {
      "id": "secured_route_marks_fleet_landing",
      "once": true,
      "when": { "type": "turn_start", "team": "player", "turn": 2, "campaign_flags": { "secured_nanhai_route": true } },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Cao Ren", "text": "The secured route gives us the landing marks. Their anchorage has fewer secrets than it thinks." },
            { "speaker": "Cao Cao", "text": "Good. A known shore is a conquered shore waiting for banners." }
          ]
        }
      ]
    },
    {
      "id": "pressed_fleet_commits_screen_boat",
      "once": true,
      "when": { "type": "turn_start", "team": "enemy", "turn": 2, "campaign_flags": { "pressed_southern_fleet": true } },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Southern Fleet Captain", "text": "Wei came too quickly. Send the screen boat forward and keep the anchorage breathing." },
            { "speaker": "Zhang He", "text": "They are already spending their screen. The fleet is less ready than its banners claim." }
          ]
        },
        {
          "type": "spawn_deployment",
          "deployment": {
            "unit_id": "southern_screen_boat",
            "name": "Southern Screen Boat",
            "class_id": "champion",
            "team": "enemy",
            "move_type": "water",
            "level": 59,
            "pos": [5, 3],
            "base": { "hp": 130, "atk": 56, "def": 40, "agi": 46 }
          }
        }
      ]
    },
    {
      "id": "turn_4_fleet_tightens_anchorage",
      "once": true,
      "when": { "type": "turn_start", "team": "enemy", "turn": 4 },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Southern Fleet Advisor", "text": "Hold the anchorage. If Wei takes the shore marker, the fleet cannot choose its own tide." },
            { "speaker": "Guo Jia", "text": "They fear a marker more than a blade. That tells us where to stand." }
          ]
        }
      ]
    },
    {
      "id": "southern_fleet_anchorage_reached",
      "once": true,
      "when": { "type": "unit_reaches_tile", "team": "player", "officer_ids": ["cao_cao"], "pos": [10, 4] },
      "actions": [
        {
          "type": "set_objective",
          "victory": "The southern fleet anchorage is reached. Defeat the fleet captain.",
          "defeat": "Cao Cao is defeated or the battle reaches Turn 18."
        },
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Cao Cao", "text": "This anchorage now answers to Wei. Strike down the captain and the fleet loses its harbor." },
            { "speaker": "Southern Fleet Captain", "text": "A captain can still turn harbor into open water." }
          ]
        },
        {
          "type": "spawn_deployments",
          "deployments": [
            {
              "unit_id": "southern_fleet_last_guard",
              "name": "Southern Fleet Last Guard",
              "class_id": "guard_captain",
              "team": "enemy",
              "level": 59,
              "pos": [16, 4],
              "base": { "hp": 148, "atk": 60, "def": 53 }
            },
            {
              "unit_id": "southern_fleet_crossbow_boat",
              "name": "Southern Fleet Crossbow Boat",
              "class_id": "marksman",
              "team": "enemy",
              "move_type": "water",
              "level": 59,
              "pos": [10, 1],
              "base": { "hp": 124, "atk": 59, "def": 33, "agi": 47 }
            }
          ]
        }
      ]
    },
    {
      "id": "turn_9_fleet_line_wavers",
      "once": true,
      "when": { "type": "turn_start", "team": "player", "turn": 9 },
      "actions": [
        {
          "type": "dialogue",
          "lines": [
            { "speaker": "Dian Wei", "text": "Their shore guard is breaking. Even the boats are pulling close, like they fear the road." },
            { "speaker": "Cao Cao", "text": "Then make the road the sharper weapon." }
          ]
        }
      ]
    }
  ],
  "rewards": {
    "gold": 12200,
    "items": ["bean", "wine", "iron_armor"]
  },
  "post_battle_dialogue": [
    { "speaker": "Guo Jia", "text": "The southern fleet anchorage is broken. Wei can secure the fleet under coastal order, or press the fleeing captains toward Hainan before they gather again." },
    { "speaker": "Cao Ren", "text": "Securing the fleet steadies the coast. Pressing Hainan cuts the horizon they still trust." },
    { "speaker": "Cao Cao", "text": "Ships and roads serve the same master when their captains have no choice left." }
  ],
  "post_battle_choices": [
    {
      "id": "secure_southern_fleet",
      "label": "Secure Fleet",
      "description": "Cao Cao secures the southern fleet and folds its anchorage into Wei's coastal order.",
      "set_flags": { "secured_southern_fleet": true, "pressed_hainan_coast": false },
      "gold": 2350,
      "items": ["imperial_seal"]
    },
    {
      "id": "press_hainan_coast",
      "label": "Press Hainan",
      "description": "Cao Cao presses fleeing captains toward Hainan before they can regroup.",
      "set_flags": { "secured_southern_fleet": false, "pressed_hainan_coast": true },
      "gold": 2150,
      "items": ["war_drum"]
    }
  ]
}
