import type { TerrainType, UnitClassKey } from './battleRules';
import type { EquipmentSet } from './battleItems';

export type PortraitKey = 'liuBei' | 'guanYu' | 'zhangFei';

export type StoryPage = {
  id: string;
  chapter: string;
  background: string;
  speaker?: string;
  portrait?: PortraitKey;
  bgm?: string;
  text: string;
};

export type UnitData = {
  id: string;
  name: string;
  faction: 'ally' | 'enemy';
  className: string;
  classKey: UnitClassKey;
  level: number;
  exp: number;
  hp: number;
  maxHp: number;
  attack: number;
  move: number;
  stats: UnitStats;
  equipment: EquipmentSet;
  x: number;
  y: number;
};

export type UnitStats = {
  might: number;
  intelligence: number;
  leadership: number;
  agility: number;
  luck: number;
};

export type BattleBond = {
  id: string;
  unitIds: [string, string];
  title: string;
  level: number;
  exp: number;
  description: string;
};

export type BattleMap = {
  width: number;
  height: number;
  terrain: TerrainType[][];
};

export const prologuePages: StoryPage[] = [
  {
    id: 'yellow-turban-chaos',
    bgm: 'story-dark',
    chapter: '난세의 시작',
    background: 'story-chaos',
    text: '중평 원년, 황건의 깃발이 각지에서 일어났다. 관군은 흩어지고, 마을마다 피난 행렬이 이어졌다.'
  },
  {
    id: 'liu-bei-resolve',
    bgm: 'story-dark',
    chapter: '탁현의 방',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '한실의 백성이 이토록 고통받는데, 어찌 초가집 그늘에 숨어 있을 수 있겠는가.'
  },
  {
    id: 'zhang-fei-joins',
    bgm: 'story-dark',
    chapter: '뜻이 모이다',
    background: 'story-three-heroes',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '좋소! 나라를 바로잡고 백성을 구한다면, 내 재산도 이 목숨도 아깝지 않소.'
  },
  {
    id: 'guan-yu-joins',
    bgm: 'story-dark',
    chapter: '뜻이 모이다',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '의로운 뜻을 품은 이와 길을 함께한다면, 천 리라도 멀다 하지 않겠습니다.'
  },
  {
    id: 'oath-narration',
    bgm: 'oath-theme',
    chapter: '도원결의',
    background: 'title-taoyuan',
    text: '복숭아꽃이 흩날리는 동산에서 세 사람은 하늘과 땅에 고했다.'
  },
  {
    id: 'oath-liu-bei',
    bgm: 'oath-theme',
    chapter: '도원결의',
    background: 'title-taoyuan',
    speaker: '유비',
    portrait: 'liuBei',
    text: '우리는 태어난 날은 달라도, 오늘부터 뜻을 함께한다. 백성을 구하고 한실을 돕는 길에서 물러서지 않겠다.'
  },
  {
    id: 'oath-brothers',
    bgm: 'oath-theme',
    chapter: '도원결의',
    background: 'title-taoyuan',
    speaker: '관우',
    portrait: 'guanYu',
    text: '의를 저버리지 않고, 형제를 저버리지 않겠습니다.'
  },
  {
    id: 'militia-rises',
    bgm: 'militia-theme',
    chapter: '의용군 모집',
    background: 'story-militia',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '창을 들 사람은 앞으로 나오시오! 오늘 모인 이름 없는 무리가 내일의 방패가 될 것이오!'
  },
  {
    id: 'first-sortie',
    bgm: 'battle-prep',
    chapter: '첫 출진',
    background: 'story-sortie',
    speaker: '유비',
    portrait: 'liuBei',
    text: '우리는 아직 작다. 그러나 오늘 한 마을을 지켜낸다면, 그 뜻은 천하로 번져갈 것이다.'
  },
  {
    id: 'battle-briefing',
    bgm: 'battle-prep',
    chapter: '황건적 토벌',
    background: 'story-sortie',
    text: '의용군은 마을 어귀로 향했다. 첫 싸움은 곧 시작된다.'
  }
];

export const firstBattleVictoryPages: StoryPage[] = [
  {
    id: 'first-victory-village',
    bgm: 'militia-theme',
    chapter: '첫 승리',
    background: 'story-militia',
    text: '황건적의 깃발이 쓰러지자, 숨어 있던 백성들이 하나둘 마을 어귀로 돌아왔다.'
  },
  {
    id: 'first-victory-liu-bei',
    bgm: 'militia-theme',
    chapter: '첫 승리',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '오늘의 승리는 작다. 그러나 백성 한 사람을 지키는 일에서 천하를 바로잡는 뜻이 시작된다.'
  },
  {
    id: 'first-victory-guan-yu',
    bgm: 'militia-theme',
    chapter: '의용군의 이름',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '형님의 뜻을 보고 사람들이 모일 것입니다. 다음 싸움은 오늘보다 더 큰 책임을 요구하겠지요.'
  },
  {
    id: 'first-victory-zhang-fei',
    bgm: 'militia-theme',
    chapter: '의용군의 이름',
    background: 'story-militia',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '하하! 그럼 더 크게 외쳐야겠소. 창을 들 자는 모여라! 우리 의용군은 물러서지 않는다!'
  },
  {
    id: 'first-victory-next',
    bgm: 'battle-prep',
    chapter: '다음 길',
    background: 'story-sortie',
    text: '세 형제의 이름은 탁현 일대에 퍼지기 시작했다. 이제 더 넓은 전장과 더 많은 인연이 그들을 기다린다.'
  }
];

export const secondBattleIntroPages: StoryPage[] = [
  {
    id: 'second-pursuit-rumor',
    bgm: 'militia-theme',
    chapter: '잔당의 그림자',
    background: 'story-militia',
    text: '첫 승리의 기쁨이 채 가시기도 전에, 황건 잔당이 북쪽 길목의 마을을 습격하고 있다는 급보가 도착했다.'
  },
  {
    id: 'second-liu-bei-command',
    bgm: 'battle-prep',
    chapter: '추격 명령',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '백성이 다시 칼끝에 몰렸다면 우리가 쉬어 갈 곳은 없다. 길을 따라 추격하되, 마을을 먼저 지켜야 한다.'
  },
  {
    id: 'second-guan-yu-vow',
    bgm: 'battle-prep',
    chapter: '좁은 길목',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '적은 숲과 강을 끼고 물러설 것입니다. 제가 앞길을 열겠습니다. 형님께서는 백성을 살피십시오.'
  },
  {
    id: 'second-zhang-fei-charge',
    bgm: 'battle-prep',
    chapter: '의용군 출진',
    background: 'story-sortie',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '좋다! 숨어 있는 놈들도 모조리 끌어내 주마. 이번에는 도망칠 틈도 주지 않겠다!'
  }
];

export const secondBattleVictoryPages: StoryPage[] = [
  {
    id: 'second-victory-village',
    bgm: 'militia-theme',
    chapter: '마을의 안도',
    background: 'story-militia',
    text: '잔당의 불길은 꺼지고, 피난하던 백성들이 하나둘 마을로 돌아왔다. 의용군의 이름은 이제 길목의 장터마다 오르내렸다.'
  },
  {
    id: 'second-victory-liu-bei',
    bgm: 'militia-theme',
    chapter: '다음 책임',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '우리가 이긴 것은 힘만으로 된 일이 아니다. 백성을 지키겠다는 뜻을 잊지 않는다면, 더 큰 전장도 견딜 수 있을 것이다.'
  },
  {
    id: 'second-victory-next',
    bgm: 'battle-prep',
    chapter: '넓어지는 전장',
    background: 'story-sortie',
    text: '탁현 인근의 소란은 잦아들었지만, 황건의 난은 아직 천하 곳곳에서 타오르고 있었다. 세 형제의 길은 이제 더 멀리 이어진다.'
  }
];

export const thirdBattleIntroPages: StoryPage[] = [
  {
    id: 'third-guangzong-report',
    bgm: 'militia-theme',
    chapter: '광종의 급보',
    background: 'story-militia',
    text: '탁현 북쪽의 소란을 잠재우자, 장터에는 더 큰 소식이 밀려왔다. 광종 방면에서 황건 본대가 관군을 압박하고 있다는 전갈이었다.'
  },
  {
    id: 'third-liu-bei-decision',
    bgm: 'battle-prep',
    chapter: '넓어지는 길',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '작은 마을만 지키고 물러선다면 난세는 끝나지 않는다. 광종으로 향하는 길을 열어, 더 많은 백성이 버틸 시간을 만들어야 한다.'
  },
  {
    id: 'third-guan-yu-bridge',
    bgm: 'battle-prep',
    chapter: '강가의 길목',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '적 전령이 강가 요새를 거쳐 본대로 향한다면, 그 길을 끊어야 합니다. 좁은 다리와 숲길을 먼저 장악하겠습니다.'
  },
  {
    id: 'third-zhang-fei-vanguard',
    bgm: 'battle-prep',
    chapter: '전초전',
    background: 'story-sortie',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '전령이든 두령이든 내 앞길에 서면 다 똑같소! 형님, 명만 내리시오. 길목을 시원하게 열어 버리겠소!'
  }
];

export const thirdBattleVictoryPages: StoryPage[] = [
  {
    id: 'third-victory-road',
    bgm: 'militia-theme',
    chapter: '열린 길목',
    background: 'story-sortie',
    text: '황건 전령의 깃발이 꺾이자 광종으로 향하는 길목에 잠시 숨통이 트였다. 흩어진 백성들은 의용군의 이름을 기억하기 시작했다.'
  },
  {
    id: 'third-victory-liu-bei',
    bgm: 'militia-theme',
    chapter: '큰 싸움의 그림자',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '우리가 막은 것은 작은 전갈 하나일 뿐이다. 그러나 작은 길 하나가 열리면, 다음 전장에서도 백성을 구할 길이 생긴다.'
  },
  {
    id: 'third-victory-next',
    bgm: 'battle-prep',
    chapter: '광종으로',
    background: 'story-militia',
    text: '세 형제는 병사를 추스르고 광종 방면으로 눈을 돌렸다. 황건의 큰 물결은 아직 꺾이지 않았다.'
  }
];

export const fourthBattleIntroPages: StoryPage[] = [
  {
    id: 'fourth-guangzong-camp',
    bgm: 'militia-theme',
    chapter: '광종 본영',
    background: 'story-militia',
    text: '전령의 길이 끊기자 황건 본대는 광종 들판에 진을 굳혔다. 노란 깃발이 겹겹이 서고, 장각의 이름이 병사들 사이에 낮게 울렸다.'
  },
  {
    id: 'fourth-liu-bei-resolve',
    bgm: 'battle-prep',
    chapter: '의용군의 결의',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '장각을 치는 일은 한 사람을 꺾는 일이 아니다. 두려움에 몰린 백성들이 다시 길을 찾게 하는 일이다.'
  },
  {
    id: 'fourth-guan-yu-line',
    bgm: 'battle-prep',
    chapter: '본영 돌파',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '적은 요새와 숲 사이에 궁병을 숨겼습니다. 전열을 흐트러뜨리지 않고 본영의 깃발까지 밀고 들어가야 합니다.'
  },
  {
    id: 'fourth-zhang-fei-roar',
    bgm: 'battle-prep',
    chapter: '황건적 토벌',
    background: 'story-sortie',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '좋소! 광종의 누런 깃발을 오늘 모두 뽑아 버립시다. 뒤돌아볼 틈 없이 밀고 들어가겠소!'
  }
];

export const fourthBattleVictoryPages: StoryPage[] = [
  {
    id: 'fourth-victory-yellow-flags-fall',
    bgm: 'militia-theme',
    chapter: '황건적 토벌',
    background: 'story-militia',
    text: '광종의 들판에서 황건의 본영이 무너졌다. 피난민들은 오래 닫았던 문을 열고, 쓰러진 깃발 너머로 관군과 의용군을 바라보았다.'
  },
  {
    id: 'fourth-victory-liu-bei',
    bgm: 'militia-theme',
    chapter: '이름이 퍼지다',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '난은 잠시 가라앉았지만, 천하가 바로 선 것은 아니다. 오늘의 공이 교만이 되지 않도록 마음을 다잡자.'
  },
  {
    id: 'fourth-victory-next-era',
    bgm: 'battle-prep',
    chapter: '새로운 혼란',
    background: 'story-sortie',
    text: '황건의 불길이 잦아들 무렵, 조정 안에서는 또 다른 그림자가 자라났다. 세 형제의 길은 이제 반동탁의 흐름으로 이어진다.'
  }
];

export const fifthBattleIntroPages: StoryPage[] = [
  {
    id: 'fifth-coalition-rumor',
    bgm: 'militia-theme',
    chapter: '반동탁의 격문',
    background: 'story-militia',
    text: '황건의 불길이 잦아들자 조정에는 또 다른 폭풍이 일었다. 동탁이 낙양을 장악했다는 소식과 함께, 각지의 제후들이 반동탁의 격문에 응하기 시작했다.'
  },
  {
    id: 'fifth-liu-bei-choice',
    bgm: 'battle-prep',
    chapter: '새로운 대의',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '백성을 괴롭히는 난을 막았다 하나, 조정이 어지러우면 천하는 다시 피를 흘린다. 우리는 더 큰 흐름 속으로 들어가야 한다.'
  },
  {
    id: 'fifth-gongsun-zan',
    bgm: 'battle-prep',
    chapter: '공손찬의 진영',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '공손찬의 군영에 합류하면 연합군의 움직임을 가까이서 볼 수 있습니다. 그러나 동탁군도 사수관 앞길을 막고 있습니다.'
  },
  {
    id: 'fifth-sishui-sortie',
    bgm: 'battle-prep',
    chapter: '사수관 전초전',
    background: 'story-sortie',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '동탁군이든 황건적이든 백성을 짓밟는 놈들은 똑같소. 사수관 앞길부터 뚫어 봅시다!'
  }
];

export const fifthBattleVictoryPages: StoryPage[] = [
  {
    id: 'fifth-victory-sishui',
    bgm: 'militia-theme',
    chapter: '사수관의 문턱',
    background: 'story-sortie',
    text: '동탁군의 전초 부대가 물러서자 연합군 진영에 세 형제의 이름이 다시 한 번 전해졌다.'
  },
  {
    id: 'fifth-victory-next',
    bgm: 'battle-prep',
    chapter: '공손찬 의탁',
    background: 'story-militia',
    text: '사수관 앞 전초전은 끝났지만, 반동탁의 싸움은 이제 막 시작되었다. 유비는 공손찬의 군영에서 다음 기회를 기다린다.'
  }
];

export const sixthBattleIntroPages: StoryPage[] = [
  {
    id: 'sixth-gongsun-zan-order',
    bgm: 'militia-theme',
    chapter: '공손찬의 명',
    background: 'story-three-heroes',
    text: '사수관 전초전 뒤, 유비군은 공손찬의 군영에 머물며 북방의 정세를 살폈다. 원소군의 별동대가 계교로 향하는 보급로를 위협하자, 공손찬은 세 형제에게 길목을 맡겼다.'
  },
  {
    id: 'sixth-liu-bei-service',
    bgm: 'battle-prep',
    chapter: '의탁의 무게',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '남의 깃발 아래에 서더라도 백성을 지키는 뜻은 변하지 않는다. 공손찬 장군의 군영에 머무는 동안에도 우리의 길을 분명히 하자.'
  },
  {
    id: 'sixth-guan-yu-road',
    bgm: 'battle-prep',
    chapter: '계교 원군로',
    background: 'story-militia',
    speaker: '관우',
    portrait: 'guanYu',
    text: '계교로 향하는 길은 강과 숲이 얽혀 있습니다. 원소군의 궁병과 기병을 나누어 상대해야 길을 열 수 있습니다.'
  },
  {
    id: 'sixth-zhang-fei-sortie',
    bgm: 'battle-prep',
    chapter: '북방의 먼지',
    background: 'story-sortie',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '원소군이든 누구든 길을 막는 놈은 비켜서게 만들면 됩니다. 형님, 이번엔 제가 먼저 먼지를 일으키겠습니다!'
  }
];

export const sixthBattleVictoryPages: StoryPage[] = [
  {
    id: 'sixth-victory-jieqiao',
    bgm: 'militia-theme',
    chapter: '계교의 길',
    background: 'story-militia',
    text: '계교로 향하는 보급로가 열리자 공손찬의 군영에도 한숨 돌릴 여유가 생겼다. 그러나 북방의 전공은 세 형제의 마음을 오래 붙잡아 두지 못했다.'
  },
  {
    id: 'sixth-xuzhou-envoy',
    bgm: 'battle-prep',
    chapter: '서주의 사신',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '도겸 공이 서주에서 원군을 청한다면, 백성의 고통을 외면할 수 없소. 공손찬 장군께 허락을 구하고 서주로 향할 준비를 하자.'
  }
];

export const seventhBattleIntroPages: StoryPage[] = [
  {
    id: 'seventh-xuzhou-envoy-arrives',
    bgm: 'militia-theme',
    chapter: '도겸의 사신',
    background: 'story-militia',
    text: '서주의 도겸이 조조군의 압박을 견디지 못하고 원군을 청했다. 공손찬의 허락을 받은 유비는 세 형제와 의용군을 이끌고 남쪽 길로 향했다.'
  },
  {
    id: 'seventh-liu-bei-xuzhou',
    bgm: 'battle-prep',
    chapter: '서주로 가는 길',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '서주 백성이 위태롭다는데 어찌 머뭇거리겠는가. 도겸 공을 돕고, 백성들이 피난길에서 더 쓰러지지 않게 길을 열자.'
  },
  {
    id: 'seventh-guan-yu-field',
    bgm: 'battle-prep',
    chapter: '조조군 선봉',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '조조군 선봉은 길과 촌락을 함께 누르고 있습니다. 기병은 길을 따라 빠르게 내려오고, 궁병은 강가와 마을 뒤에서 전열을 끊을 것입니다.'
  },
  {
    id: 'seventh-zhang-fei-charge',
    bgm: 'battle-prep',
    chapter: '서주 구원전',
    background: 'story-sortie',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '서주 백성을 울리는 놈들이라면 이름이 누구든 상관없습니다. 형님, 조조군 선봉부터 박살내고 길을 열어 봅시다!'
  }
];

export const seventhBattleVictoryPages: StoryPage[] = [
  {
    id: 'seventh-victory-xuzhou-road',
    bgm: 'militia-theme',
    chapter: '서주의 문',
    background: 'story-militia',
    text: '조조군 선봉이 물러서자 서주 성문 앞 피난민들의 숨통이 트였다. 도겸은 유비의 군기를 맞이하며 깊이 고개를 숙였다.'
  },
  {
    id: 'seventh-tao-qian-entrusts',
    bgm: 'battle-prep',
    chapter: '도겸의 부탁',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '서주를 맡아 달라는 도겸 공의 청은 너무 무거운 일이다. 그러나 백성이 의지할 곳이 없다면, 외면하는 것도 의가 아니다.'
  }
];

export const eighthBattleIntroPages: StoryPage[] = [
  {
    id: 'eighth-xuzhou-handover',
    bgm: 'militia-theme',
    chapter: '서주의 새 군영',
    background: 'story-militia',
    text: '도겸은 병든 몸을 일으켜 서주의 장부와 군량 창고를 유비에게 넘겼다. 간옹과 미축은 백성의 청원과 보급로를 정리하며 새 군영의 기초를 세웠다.'
  },
  {
    id: 'eighth-lu-bu-shadow',
    bgm: 'battle-prep',
    chapter: '여포의 그림자',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '여포가 떠돌고 있다는 소식은 가볍지 않다. 그 이름 하나만으로도 여러 군세가 흔들린다. 그러나 지금은 서주의 길과 백성을 먼저 지켜야 한다.'
  },
  {
    id: 'eighth-xiaopei-road',
    bgm: 'battle-prep',
    chapter: '소패 보급로',
    background: 'story-sortie',
    speaker: '미축',
    text: '소패로 이어지는 창고 길목이 습격받고 있습니다. 군량이 끊기면 서주를 안정시킬 수 없습니다. 보급로와 마을을 동시에 지켜야 합니다.'
  },
  {
    id: 'eighth-sortie-choice',
    bgm: 'battle-prep',
    chapter: '첫 방위전',
    background: 'story-three-heroes',
    speaker: '간옹',
    text: '현덕, 이제 함께 갈 장수를 고르는 일도 전술이 되었네. 칼이 필요한 곳과 말이 필요한 곳, 그리고 말보다 장부가 필요한 곳을 구분해야 하네.'
  }
];

export const eighthBattleVictoryPages: StoryPage[] = [
  {
    id: 'eighth-victory-supply-road',
    bgm: 'militia-theme',
    chapter: '지켜낸 보급로',
    background: 'story-militia',
    text: '소패의 보급로가 다시 열리자 서주의 창고와 마을은 겨우 숨을 돌렸다. 새로 합류한 장수들은 각자의 방식으로 유비군의 빈틈을 메웠다.'
  },
  {
    id: 'eighth-lu-bu-arrival',
    bgm: 'battle-prep',
    chapter: '뜻밖의 손님',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '전투가 끝난 뒤, 여포가 몸을 의탁할 곳을 구한다는 전갈이 왔다. 그를 받아들이는 일은 의로울 수 있으나, 서주에 또 다른 불씨를 들이는 일이기도 했다.'
  }
];

export const ninthBattleIntroPages: StoryPage[] = [
  {
    id: 'ninth-lu-bu-refuge',
    bgm: 'militia-theme',
    chapter: '여포의 의탁',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '여포가 몸을 의탁하겠다 청했다. 난세에 갈 곳 없는 이를 내치는 것은 쉽지 않으나, 서주 백성의 불안을 모른 척할 수도 없다.'
  },
  {
    id: 'ninth-zhang-fei-suspicion',
    bgm: 'battle-prep',
    chapter: '성문 안의 불씨',
    background: 'story-three-heroes',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '여포 같은 자를 성 안에 들이면 반드시 화근이 됩니다. 도겸의 옛 무장들까지 술렁이니, 성문부터 단단히 지켜야 합니다.'
  },
  {
    id: 'ninth-cao-bao-mutiny',
    bgm: 'battle-prep',
    chapter: '조표의 야습',
    background: 'story-sortie',
    text: '밤이 깊자 조표가 일부 성문 수비병을 움직였다. 바깥의 여포군 기병은 불빛을 신호로 삼아 성문을 향해 몰려들었다.'
  },
  {
    id: 'ninth-xuzhou-gate',
    bgm: 'battle-prep',
    chapter: '서주 성문 방위',
    background: 'story-militia',
    speaker: '간옹',
    text: '현덕, 이 싸움은 이겨도 상처가 남을 걸세. 하지만 성문이 오늘 밤 무너지면 내일의 선택도 사라진다네.'
  }
];

export const ninthBattleVictoryPages: StoryPage[] = [
  {
    id: 'ninth-victory-gate-held',
    bgm: 'militia-theme',
    chapter: '지켜낸 밤',
    background: 'story-militia',
    text: '조표의 야습은 물러났고 성문은 다시 닫혔다. 그러나 성 안의 의심과 두려움은 이미 선명한 금이 되어 남았다.'
  },
  {
    id: 'ninth-lu-bu-pretext',
    bgm: 'battle-prep',
    chapter: '더 깊어진 그림자',
    background: 'story-liu-bei',
    speaker: '유비',
    portrait: 'liuBei',
    text: '여포는 서주의 혼란을 핑계 삼아 더 깊이 발을 들이려 했다. 오늘 밤 성문은 지켰으나, 서주를 잃을 싸움은 이제 시작되고 있었다.'
  }
];

export const tenthBattleIntroPages: StoryPage[] = [
  {
    id: 'tenth-zhang-fei-fault',
    bgm: 'story-dark',
    chapter: '술잔이 부른 균열',
    background: 'story-liu-bei',
    speaker: '장비',
    portrait: 'zhangFei',
    text: '조표의 잔당을 다그치던 장비는 분노를 이기지 못했다. 말 한마디, 술 한잔, 그리고 성 안의 오래된 원한이 한밤중에 다시 타올랐다.'
  },
  {
    id: 'tenth-lu-bu-takes-xuzhou',
    bgm: 'story-dark',
    chapter: '빼앗긴 서주',
    background: 'story-militia',
    text: '여포는 성문이 흔들린 틈을 놓치지 않았다. 서주 곳곳의 수비대가 갈라졌고, 유비가 돌아왔을 때 성루의 깃발은 이미 바뀌어 있었다.'
  },
  {
    id: 'tenth-brothers-regroup',
    bgm: 'militia-theme',
    chapter: '무너진 성 앞에서',
    background: 'story-three-heroes',
    speaker: '관우',
    portrait: 'guanYu',
    text: '형님, 지금 성을 되찾으려 들면 백성과 군졸을 모두 잃습니다. 익덕을 꾸짖는 일은 살아나간 뒤에 해도 늦지 않습니다.'
  },
  {
    id: 'tenth-xuzhou-escape',
    bgm: 'battle-prep',
    chapter: '서주 탈출',
    background: 'story-sortie',
    speaker: '유비',
    portrait: 'liuBei',
    text: '서주는 오늘 내 손에서 떠났다. 그러나 백성과 형제와 뜻까지 잃을 수는 없다. 포위망을 뚫고 다음 길을 찾자.'
  }
];

export const tenthBattleVictoryPages: StoryPage[] = [
  {
    id: 'tenth-victory-breakout',
    bgm: 'militia-theme',
    chapter: '잃고도 남은 것',
    background: 'story-militia',
    text: '유비군은 여포군 선봉을 뚫고 서주 외곽으로 물러났다. 성은 빼앗겼으나, 세 형제와 새로 모인 장수들의 전열은 아직 흩어지지 않았다.'
  },
  {
    id: 'tenth-cao-cao-shadow',
    bgm: 'story-dark',
    chapter: '허도로 향하는 그림자',
    background: 'story-liu-bei',
    speaker: '간옹',
    text: '현덕, 이제 서주 안에서 버티는 길은 막혔네. 조조의 휘하로 들어가는 일은 마음에 걸리지만, 살아남아 다시 뜻을 세우려면 그 길을 지나야 할 걸세.'
  }
];

export const firstBattleMap: BattleMap = {
  width: 20,
  height: 18,
  terrain: [
    ['forest', 'forest', 'hill', 'hill', 'cliff', 'cliff', 'hill', 'plain', 'road', 'road', 'plain', 'forest', 'hill', 'hill', 'plain', 'plain', 'forest', 'hill', 'hill', 'plain'],
    ['forest', 'hill', 'hill', 'plain', 'cliff', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'hill', 'plain', 'plain', 'plain', 'hill', 'fort', 'plain'],
    ['plain', 'forest', 'plain', 'plain', 'hill', 'hill', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'fort', 'fort', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'forest', 'hill', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'fort', 'plain', 'plain', 'forest'],
    ['plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'plain', 'forest', 'forest'],
    ['plain', 'plain', 'plain', 'forest', 'plain', 'road', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'village', 'plain', 'plain', 'plain', 'forest'],
    ['plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain'],
    ['hill', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'hill', 'plain', 'hill', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain'],
    ['hill', 'hill', 'plain', 'road', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'road', 'road', 'forest', 'plain', 'plain', 'plain', 'village', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'road', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain'],
    ['road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'forest', 'plain', 'hill', 'hill', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'village', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'camp', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill'],
    ['camp', 'road', 'plain', 'plain', 'hill', 'plain', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'hill'],
    ['camp', 'camp', 'road', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'plain', 'hill'],
    ['plain', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain'],
    ['plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'plain', 'plain']
  ]
};

export const secondBattleMap: BattleMap = {
  width: 24,
  height: 20,
  terrain: [
    ['forest', 'forest', 'forest', 'hill', 'plain', 'plain', 'road', 'plain', 'forest', 'hill', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'forest', 'plain', 'hill', 'hill', 'plain', 'plain', 'forest', 'forest'],
    ['forest', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'hill', 'river', 'river', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'fort', 'fort', 'plain', 'plain', 'forest'],
    ['plain', 'plain', 'plain', 'forest', 'plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'river', 'river', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'fort', 'plain', 'plain', 'plain', 'forest'],
    ['plain', 'plain', 'forest', 'forest', 'plain', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'river', 'river', 'road', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['plain', 'forest', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'hill', 'river', 'river', 'road', 'plain', 'plain', 'hill', 'cliff', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'river', 'river', 'road', 'plain', 'plain', 'hill', 'plain', 'village', 'plain', 'forest', 'forest', 'plain'],
    ['plain', 'plain', 'forest', 'plain', 'road', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain', 'plain', 'river', 'river', 'road', 'road', 'plain', 'plain', 'plain', 'village', 'plain', 'plain', 'forest', 'plain'],
    ['plain', 'forest', 'forest', 'plain', 'road', 'plain', 'plain', 'plain', 'hill', 'plain', 'road', 'road', 'plain', 'river', 'river', 'road', 'plain', 'plain', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain'],
    ['plain', 'forest', 'plain', 'road', 'road', 'plain', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'hill', 'plain'],
    ['plain', 'plain', 'plain', 'road', 'plain', 'plain', 'hill', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain'],
    ['hill', 'plain', 'plain', 'road', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'village', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'plain'],
    ['hill', 'hill', 'plain', 'road', 'plain', 'forest', 'plain', 'road', 'plain', 'plain', 'village', 'village', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain'],
    ['cliff', 'hill', 'plain', 'road', 'road', 'plain', 'plain', 'road', 'plain', 'plain', 'plain', 'village', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain'],
    ['cliff', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'road', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['plain', 'plain', 'camp', 'plain', 'plain', 'road', 'road', 'plain', 'road', 'plain', 'forest', 'plain', 'plain', 'forest', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain'],
    ['plain', 'camp', 'camp', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'forest', 'plain', 'hill'],
    ['plain', 'camp', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'hill', 'hill'],
    ['plain', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'hill'],
    ['plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain']
  ]
};

export const thirdBattleMap: BattleMap = {
  width: 24,
  height: 20,
  terrain: [
    ['forest', 'forest', 'hill', 'plain', 'plain', 'road', 'plain', 'forest', 'hill', 'plain', 'river', 'river', 'plain', 'forest', 'forest', 'hill', 'hill', 'plain', 'fort', 'fort', 'plain', 'forest', 'forest', 'hill'],
    ['forest', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'plain', 'plain', 'river', 'river', 'road', 'plain', 'forest', 'plain', 'hill', 'plain', 'fort', 'plain', 'plain', 'plain', 'forest', 'forest'],
    ['hill', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'forest'],
    ['plain', 'plain', 'forest', 'road', 'plain', 'plain', 'forest', 'plain', 'hill', 'road', 'river', 'river', 'road', 'road', 'plain', 'hill', 'hill', 'plain', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain'],
    ['plain', 'forest', 'forest', 'road', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'river', 'river', 'plain', 'road', 'plain', 'plain', 'hill', 'cliff', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['plain', 'plain', 'forest', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'road', 'plain', 'river', 'river', 'road', 'plain', 'village', 'plain', 'hill', 'plain', 'plain', 'plain', 'forest', 'forest', 'plain'],
    ['plain', 'plain', 'plain', 'plain', 'road', 'plain', 'hill', 'hill', 'plain', 'road', 'plain', 'river', 'river', 'road', 'plain', 'village', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain'],
    ['plain', 'forest', 'plain', 'plain', 'road', 'plain', 'plain', 'hill', 'plain', 'road', 'road', 'plain', 'river', 'river', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain'],
    ['forest', 'forest', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'hill', 'plain', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['forest', 'plain', 'plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'plain', 'hill', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'village', 'plain', 'plain', 'plain', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain'],
    ['hill', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'village', 'plain', 'forest', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'plain', 'plain', 'plain'],
    ['hill', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'plain'],
    ['camp', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'hill'],
    ['camp', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'hill'],
    ['plain', 'camp', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain'],
    ['plain', 'plain', 'camp', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'plain'],
    ['plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain']
  ]
};

export const fourthBattleMap: BattleMap = {
  width: 24,
  height: 20,
  terrain: [
    ['forest', 'forest', 'hill', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'hill', 'plain', 'plain', 'fort', 'fort', 'fort', 'plain', 'hill', 'hill', 'forest', 'forest', 'plain', 'plain'],
    ['forest', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'hill', 'plain', 'plain', 'fort', 'fort', 'fort', 'plain', 'plain', 'hill', 'forest', 'forest', 'plain', 'plain', 'hill'],
    ['hill', 'plain', 'plain', 'forest', 'plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'road', 'road', 'fort', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'hill'],
    ['plain', 'plain', 'forest', 'forest', 'plain', 'road', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain'],
    ['plain', 'forest', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'hill', 'plain', 'river', 'river', 'road', 'road', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'road', 'plain', 'village', 'plain', 'plain', 'forest', 'forest', 'plain'],
    ['plain', 'forest', 'plain', 'plain', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'river', 'river', 'plain', 'plain', 'road', 'plain', 'village', 'plain', 'forest', 'forest', 'plain', 'plain'],
    ['plain', 'forest', 'plain', 'road', 'road', 'plain', 'hill', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'hill', 'plain'],
    ['plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'road', 'plain', 'plain', 'hill', 'hill', 'plain', 'plain'],
    ['plain', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'village', 'plain', 'plain', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain'],
    ['road', 'road', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'village', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'road', 'road', 'plain', 'forest', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'forest', 'plain', 'hill'],
    ['hill', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'hill', 'hill'],
    ['hill', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'hill'],
    ['plain', 'camp', 'road', 'road', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain'],
    ['camp', 'camp', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'plain'],
    ['plain', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'plain'],
    ['plain', 'plain', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain']
  ]
};

export const fifthBattleMap: BattleMap = {
  width: 24,
  height: 20,
  terrain: [
    ['hill', 'hill', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'hill', 'hill', 'forest', 'plain', 'plain', 'fort', 'fort', 'plain', 'hill', 'hill', 'forest', 'forest', 'plain', 'plain', 'hill', 'hill'],
    ['hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'fort', 'fort', 'road', 'plain', 'hill', 'forest', 'plain', 'plain', 'plain', 'plain', 'hill'],
    ['plain', 'plain', 'forest', 'plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'road', 'road', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'forest', 'forest', 'plain', 'road', 'plain', 'hill', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'plain', 'road', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'forest', 'road', 'road', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill'],
    ['plain', 'plain', 'plain', 'road', 'plain', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'road', 'plain', 'village', 'plain', 'forest', 'forest', 'plain', 'hill'],
    ['forest', 'plain', 'plain', 'road', 'plain', 'hill', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'plain', 'village', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['forest', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain'],
    ['plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain'],
    ['road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'road', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'hill', 'plain'],
    ['camp', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain'],
    ['camp', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain'],
    ['plain', 'camp', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'plain'],
    ['plain', 'plain', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain']
  ]
};

export const sixthBattleMap: BattleMap = {
  width: 24,
  height: 20,
  terrain: [
    ['forest', 'hill', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'hill', 'hill', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'fort', 'fort', 'plain', 'hill', 'hill', 'forest', 'forest', 'plain'],
    ['hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'river', 'river', 'road', 'plain', 'fort', 'plain', 'plain', 'plain', 'hill', 'forest', 'plain', 'plain'],
    ['plain', 'plain', 'forest', 'plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'road', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'forest', 'forest', 'plain', 'road', 'plain', 'hill', 'forest', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'road', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'forest', 'road', 'road', 'plain', 'hill', 'plain', 'plain', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill'],
    ['plain', 'plain', 'plain', 'road', 'plain', 'plain', 'plain', 'plain', 'forest', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'road', 'plain', 'village', 'plain', 'forest', 'forest', 'plain', 'hill'],
    ['forest', 'plain', 'plain', 'road', 'plain', 'hill', 'hill', 'plain', 'forest', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'plain', 'village', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['forest', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'forest', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'road', 'forest', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain'],
    ['plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'road', 'road', 'road', 'road', 'road', 'road', 'river', 'river', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain'],
    ['road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'road', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'hill', 'plain'],
    ['camp', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain'],
    ['camp', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain'],
    ['plain', 'camp', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'plain'],
    ['plain', 'plain', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain']
  ]
};

export const seventhBattleMap: BattleMap = {
  width: 24,
  height: 20,
  terrain: [
    ['forest', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'hill', 'hill', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'fort', 'fort', 'plain', 'hill', 'forest', 'forest', 'plain', 'plain'],
    ['forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'road', 'river', 'river', 'road', 'plain', 'fort', 'plain', 'plain', 'plain', 'hill', 'forest', 'plain', 'plain'],
    ['plain', 'plain', 'forest', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'road', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain'],
    ['plain', 'forest', 'plain', 'road', 'plain', 'hill', 'forest', 'plain', 'road', 'road', 'plain', 'plain', 'river', 'river', 'road', 'road', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'road', 'road', 'plain', 'hill', 'plain', 'plain', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'road', 'road', 'plain', 'village', 'plain', 'forest', 'plain', 'plain', 'hill'],
    ['plain', 'plain', 'road', 'plain', 'plain', 'plain', 'plain', 'forest', 'road', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'road', 'village', 'village', 'plain', 'forest', 'forest', 'plain', 'hill'],
    ['forest', 'plain', 'road', 'plain', 'hill', 'hill', 'plain', 'forest', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'road', 'plain', 'village', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['forest', 'road', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'forest', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'road', 'forest', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain'],
    ['road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'road', 'road', 'road', 'road', 'road', 'road', 'river', 'river', 'road', 'road', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain'],
    ['road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'road', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'road', 'plain', 'plain', 'hill', 'plain', 'forest', 'plain', 'plain', 'plain', 'forest', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'hill', 'plain', 'plain'],
    ['camp', 'road', 'road', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'hill', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain', 'plain'],
    ['camp', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'river', 'plain', 'plain'],
    ['plain', 'camp', 'road', 'road', 'plain', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'river', 'plain', 'plain'],
    ['plain', 'plain', 'camp', 'road', 'plain', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'plain', 'forest', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain', 'plain'],
    ['plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'forest', 'forest', 'plain', 'plain', 'hill', 'plain', 'plain', 'forest', 'plain', 'plain', 'plain', 'plain', 'road', 'road', 'plain', 'plain', 'plain']
  ]
};

export const eighthBattleMap: BattleMap = {
  width: 26,
  height: 22,
  terrain: createEighthBattleTerrain()
};

export const ninthBattleMap: BattleMap = {
  width: 26,
  height: 22,
  terrain: createNinthBattleTerrain()
};

export const tenthBattleMap: BattleMap = {
  width: 28,
  height: 22,
  terrain: createTenthBattleTerrain()
};

export const firstBattleUnits: UnitData[] = [
  {
    id: 'liu-bei',
    name: '유비',
    faction: 'ally',
    className: '군웅',
    classKey: 'lord',
    level: 3,
    exp: 18,
    hp: 32,
    maxHp: 32,
    attack: 9,
    move: 4,
    stats: { might: 76, intelligence: 78, leadership: 84, agility: 70, luck: 88 },
    equipment: {
      weapon: { itemId: 'twin-oath-blades', level: 1, exp: 18 },
      armor: { itemId: 'oath-robe', level: 1, exp: 12 },
      accessory: { itemId: 'peach-charm', level: 1, exp: 0 }
    },
    x: 1,
    y: 15
  },
  {
    id: 'guan-yu',
    name: '관우',
    faction: 'ally',
    className: '의용 보병',
    classKey: 'infantry',
    level: 3,
    exp: 26,
    hp: 30,
    maxHp: 30,
    attack: 10,
    move: 3,
    stats: { might: 96, intelligence: 74, leadership: 91, agility: 72, luck: 68 },
    equipment: {
      weapon: { itemId: 'green-dragon-glaive', level: 1, exp: 26 },
      armor: { itemId: 'reinforced-lamellar', level: 1, exp: 10 },
      accessory: { itemId: 'war-manual', level: 1, exp: 0 }
    },
    x: 2,
    y: 15
  },
  {
    id: 'zhang-fei',
    name: '장비',
    faction: 'ally',
    className: '창병',
    classKey: 'spearman',
    level: 3,
    exp: 20,
    hp: 30,
    maxHp: 30,
    attack: 10,
    move: 3,
    stats: { might: 95, intelligence: 42, leadership: 83, agility: 67, luck: 61 },
    equipment: {
      weapon: { itemId: 'serpent-spear', level: 1, exp: 20 },
      armor: { itemId: 'lamellar-armor', level: 1, exp: 8 },
      accessory: { itemId: 'bravery-token', level: 1, exp: 0 }
    },
    x: 1,
    y: 16
  },
  {
    id: 'rebel-a',
    name: '황건병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 1,
    exp: 6,
    hp: 19,
    maxHp: 19,
    attack: 6,
    move: 3,
    stats: { might: 49, intelligence: 34, leadership: 38, agility: 45, luck: 40 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 6 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 4 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 6,
    y: 13
  },
  {
    id: 'rebel-b',
    name: '황건병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 1,
    exp: 4,
    hp: 20,
    maxHp: 20,
    attack: 6,
    move: 3,
    stats: { might: 47, intelligence: 32, leadership: 36, agility: 48, luck: 38 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 4 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 5 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 8,
    y: 12
  },
  {
    id: 'rebel-c',
    name: '황건궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 1,
    exp: 10,
    hp: 18,
    maxHp: 18,
    attack: 7,
    move: 3,
    stats: { might: 52, intelligence: 40, leadership: 43, agility: 56, luck: 42 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 10 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 6 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 10,
    y: 11
  },
  {
    id: 'rebel-d',
    name: '황건병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 1,
    exp: 8,
    hp: 20,
    maxHp: 20,
    attack: 6,
    move: 3,
    stats: { might: 51, intelligence: 31, leadership: 39, agility: 44, luck: 39 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 8 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 5 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 7,
    y: 9
  },
  {
    id: 'rebel-e',
    name: '황건병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 1,
    exp: 8,
    hp: 21,
    maxHp: 21,
    attack: 6,
    move: 3,
    stats: { might: 50, intelligence: 33, leadership: 37, agility: 46, luck: 41 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 8 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 5 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 10,
    y: 9
  },
  {
    id: 'rebel-cavalry-a',
    name: '황건기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 2,
    exp: 14,
    hp: 23,
    maxHp: 23,
    attack: 8,
    move: 5,
    stats: { might: 58, intelligence: 34, leadership: 45, agility: 62, luck: 42 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 12 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 6 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 12,
    y: 10
  },
  {
    id: 'rebel-archer-b',
    name: '황건궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 2,
    exp: 12,
    hp: 19,
    maxHp: 19,
    attack: 7,
    move: 3,
    stats: { might: 53, intelligence: 42, leadership: 44, agility: 57, luck: 44 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 12 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 6 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 15,
    y: 5
  },
  {
    id: 'rebel-cavalry-b',
    name: '황건기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 2,
    exp: 16,
    hp: 24,
    maxHp: 24,
    attack: 8,
    move: 5,
    stats: { might: 60, intelligence: 35, leadership: 48, agility: 63, luck: 45 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 14 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 7 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 13,
    y: 7
  },
  {
    id: 'rebel-f',
    name: '황건병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 2,
    exp: 10,
    hp: 22,
    maxHp: 22,
    attack: 7,
    move: 3,
    stats: { might: 54, intelligence: 35, leadership: 43, agility: 47, luck: 42 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 10 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 6 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 15,
    y: 3
  },
  {
    id: 'rebel-g',
    name: '황건병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 2,
    exp: 11,
    hp: 23,
    maxHp: 23,
    attack: 7,
    move: 3,
    stats: { might: 55, intelligence: 36, leadership: 44, agility: 48, luck: 43 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 10 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 6 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 17,
    y: 3
  },
  {
    id: 'rebel-leader',
    name: '두령 한석',
    faction: 'enemy',
    className: '두령',
    classKey: 'rebelLeader',
    level: 2,
    exp: 18,
    hp: 32,
    maxHp: 32,
    attack: 10,
    move: 3,
    stats: { might: 64, intelligence: 46, leadership: 61, agility: 52, luck: 50 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 1, exp: 18 },
      armor: { itemId: 'lamellar-armor', level: 1, exp: 12 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 16,
    y: 2
  }
];

const secondBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 2, y: 15 },
  'guan-yu': { x: 3, y: 15 },
  'zhang-fei': { x: 2, y: 16 }
};

export const secondBattleUnits: UnitData[] = [
  ...firstBattleUnits
    .filter((unit) => unit.faction === 'ally')
    .map((unit) => placeScenarioUnit(unit, secondBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })),
  {
    id: 'pursuit-raider-a',
    name: '황건 추격병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 2,
    exp: 12,
    hp: 23,
    maxHp: 23,
    attack: 7,
    move: 3,
    stats: { might: 55, intelligence: 34, leadership: 43, agility: 48, luck: 42 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 12 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 6 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 7,
    y: 12
  },
  {
    id: 'pursuit-raider-b',
    name: '황건 습격병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 2,
    exp: 12,
    hp: 23,
    maxHp: 23,
    attack: 7,
    move: 3,
    stats: { might: 54, intelligence: 35, leadership: 42, agility: 47, luck: 41 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 12 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 6 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 10,
    y: 11
  },
  {
    id: 'pursuit-bandit-a',
    name: '산길 복병',
    faction: 'enemy',
    className: '산적',
    classKey: 'bandit',
    level: 2,
    exp: 14,
    hp: 24,
    maxHp: 24,
    attack: 8,
    move: 3,
    stats: { might: 58, intelligence: 32, leadership: 40, agility: 53, luck: 44 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 13 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 7 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 6,
    y: 8
  },
  {
    id: 'pursuit-archer-a',
    name: '황건 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 2,
    exp: 16,
    hp: 20,
    maxHp: 20,
    attack: 8,
    move: 3,
    stats: { might: 54, intelligence: 43, leadership: 45, agility: 58, luck: 45 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 16 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 7 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 12,
    y: 10
  },
  {
    id: 'pursuit-cavalry-a',
    name: '황건 기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 3,
    exp: 18,
    hp: 26,
    maxHp: 26,
    attack: 9,
    move: 5,
    stats: { might: 62, intelligence: 35, leadership: 48, agility: 65, luck: 46 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 18 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 15,
    y: 7
  },
  {
    id: 'pursuit-raider-c',
    name: '마을 습격병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 2,
    exp: 13,
    hp: 24,
    maxHp: 24,
    attack: 7,
    move: 3,
    stats: { might: 56, intelligence: 34, leadership: 43, agility: 49, luck: 42 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 13 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 7 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 17,
    y: 6
  },
  {
    id: 'pursuit-archer-b',
    name: '황건 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 3,
    exp: 18,
    hp: 21,
    maxHp: 21,
    attack: 8,
    move: 3,
    stats: { might: 55, intelligence: 45, leadership: 46, agility: 59, luck: 47 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 18 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 8 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 20,
    y: 5
  },
  {
    id: 'pursuit-cavalry-b',
    name: '황건 기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 3,
    exp: 19,
    hp: 27,
    maxHp: 27,
    attack: 9,
    move: 5,
    stats: { might: 63, intelligence: 35, leadership: 49, agility: 66, luck: 47 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 19 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 18,
    y: 3
  },
  {
    id: 'pursuit-guard-a',
    name: '한석 친위병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 3,
    exp: 16,
    hp: 25,
    maxHp: 25,
    attack: 8,
    move: 3,
    stats: { might: 58, intelligence: 36, leadership: 48, agility: 50, luck: 44 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 16 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 19,
    y: 2
  },
  {
    id: 'pursuit-guard-b',
    name: '한석 친위병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 3,
    exp: 16,
    hp: 25,
    maxHp: 25,
    attack: 8,
    move: 3,
    stats: { might: 58, intelligence: 36, leadership: 48, agility: 50, luck: 44 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 16 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 21,
    y: 2
  },
  {
    id: 'pursuit-leader-han-seok',
    name: '두령 한석',
    faction: 'enemy',
    className: '두령',
    classKey: 'rebelLeader',
    level: 4,
    exp: 24,
    hp: 38,
    maxHp: 38,
    attack: 11,
    move: 3,
    stats: { might: 68, intelligence: 48, leadership: 64, agility: 54, luck: 52 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 1, exp: 24 },
      armor: { itemId: 'lamellar-armor', level: 1, exp: 14 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 20,
    y: 1
  }
];

const thirdBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 2, y: 17 },
  'guan-yu': { x: 3, y: 17 },
  'zhang-fei': { x: 2, y: 18 }
};

export const thirdBattleUnits: UnitData[] = [
  ...firstBattleUnits
    .filter((unit) => unit.faction === 'ally')
    .map((unit) => placeScenarioUnit(unit, thirdBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })),
  {
    id: 'guangzong-scout-a',
    name: '황건 척후병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 3,
    exp: 18,
    hp: 25,
    maxHp: 25,
    attack: 8,
    move: 3,
    stats: { might: 58, intelligence: 36, leadership: 45, agility: 52, luck: 43 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 18 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 6,
    y: 15
  },
  {
    id: 'guangzong-bandit-a',
    name: '숲길 복병',
    faction: 'enemy',
    className: '도적',
    classKey: 'bandit',
    level: 3,
    exp: 20,
    hp: 26,
    maxHp: 26,
    attack: 9,
    move: 3,
    stats: { might: 62, intelligence: 34, leadership: 42, agility: 58, luck: 46 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 18 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 8,
    y: 13
  },
  {
    id: 'guangzong-archer-a',
    name: '강가 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 3,
    exp: 20,
    hp: 22,
    maxHp: 22,
    attack: 9,
    move: 3,
    stats: { might: 57, intelligence: 45, leadership: 47, agility: 60, luck: 48 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 20 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 8 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 11,
    y: 14
  },
  {
    id: 'guangzong-cavalry-a',
    name: '황건 기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 4,
    exp: 22,
    hp: 29,
    maxHp: 29,
    attack: 10,
    move: 5,
    stats: { might: 66, intelligence: 36, leadership: 50, agility: 68, luck: 48 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 22 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 9 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 12,
    y: 11
  },
  {
    id: 'guangzong-raider-a',
    name: '황건 장정',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 3,
    exp: 18,
    hp: 26,
    maxHp: 26,
    attack: 8,
    move: 3,
    stats: { might: 59, intelligence: 35, leadership: 46, agility: 51, luck: 44 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 18 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 10,
    y: 9
  },
  {
    id: 'guangzong-raider-b',
    name: '황건 장정',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 3,
    exp: 18,
    hp: 26,
    maxHp: 26,
    attack: 8,
    move: 3,
    stats: { might: 59, intelligence: 35, leadership: 46, agility: 51, luck: 44 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 18 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 14,
    y: 10
  },
  {
    id: 'guangzong-archer-b',
    name: '요새 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 4,
    exp: 24,
    hp: 23,
    maxHp: 23,
    attack: 9,
    move: 3,
    stats: { might: 58, intelligence: 47, leadership: 48, agility: 61, luck: 49 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 24 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 9 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 15,
    y: 7
  },
  {
    id: 'guangzong-cavalry-b',
    name: '전령 기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 4,
    exp: 25,
    hp: 30,
    maxHp: 30,
    attack: 10,
    move: 5,
    stats: { might: 67, intelligence: 38, leadership: 51, agility: 70, luck: 50 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 25 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 10 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 17,
    y: 6
  },
  {
    id: 'guangzong-guard-a',
    name: '요새 수비병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 4,
    exp: 22,
    hp: 28,
    maxHp: 28,
    attack: 9,
    move: 3,
    stats: { might: 62, intelligence: 37, leadership: 50, agility: 52, luck: 46 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 22 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 10 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 18,
    y: 4
  },
  {
    id: 'guangzong-guard-b',
    name: '요새 수비병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 4,
    exp: 22,
    hp: 28,
    maxHp: 28,
    attack: 9,
    move: 3,
    stats: { might: 62, intelligence: 37, leadership: 50, agility: 52, luck: 46 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 22 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 10 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 20,
    y: 4
  },
  {
    id: 'guangzong-fort-archer',
    name: '망루 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 4,
    exp: 25,
    hp: 24,
    maxHp: 24,
    attack: 10,
    move: 3,
    stats: { might: 60, intelligence: 49, leadership: 49, agility: 61, luck: 50 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 25 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 10 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 19,
    y: 2
  },
  {
    id: 'guangzong-leader-ma-yuan',
    name: '전령 마원',
    faction: 'enemy',
    className: '두령',
    classKey: 'rebelLeader',
    level: 5,
    exp: 30,
    hp: 42,
    maxHp: 42,
    attack: 12,
    move: 3,
    stats: { might: 72, intelligence: 50, leadership: 68, agility: 56, luck: 54 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 8 },
      armor: { itemId: 'lamellar-armor', level: 1, exp: 18 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 20,
    y: 2
  }
];

const fourthBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 2, y: 16 },
  'guan-yu': { x: 3, y: 16 },
  'zhang-fei': { x: 2, y: 17 }
};

export const fourthBattleUnits: UnitData[] = [
  ...firstBattleUnits
    .filter((unit) => unit.faction === 'ally')
    .map((unit) => placeScenarioUnit(unit, fourthBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })),
  {
    id: 'guangzong-main-vanguard-a',
    name: '황건 선봉',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 4,
    exp: 24,
    hp: 28,
    maxHp: 28,
    attack: 9,
    move: 3,
    stats: { might: 63, intelligence: 36, leadership: 48, agility: 53, luck: 45 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 24 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 10 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 6,
    y: 14
  },
  {
    id: 'guangzong-main-vanguard-b',
    name: '황건 선봉',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 4,
    exp: 24,
    hp: 28,
    maxHp: 28,
    attack: 9,
    move: 3,
    stats: { might: 63, intelligence: 36, leadership: 48, agility: 53, luck: 45 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 24 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 10 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 8,
    y: 12
  },
  {
    id: 'guangzong-main-bandit-a',
    name: '숲길 돌격병',
    faction: 'enemy',
    className: '도적',
    classKey: 'bandit',
    level: 4,
    exp: 26,
    hp: 29,
    maxHp: 29,
    attack: 10,
    move: 3,
    stats: { might: 66, intelligence: 34, leadership: 44, agility: 61, luck: 48 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 24 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 10 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 5,
    y: 10
  },
  {
    id: 'guangzong-main-archer-a',
    name: '황건 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 4,
    exp: 26,
    hp: 24,
    maxHp: 24,
    attack: 10,
    move: 3,
    stats: { might: 60, intelligence: 48, leadership: 50, agility: 62, luck: 50 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 26 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 10 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 9,
    y: 10
  },
  {
    id: 'guangzong-main-cavalry-a',
    name: '황건 기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 5,
    exp: 28,
    hp: 32,
    maxHp: 32,
    attack: 11,
    move: 5,
    stats: { might: 70, intelligence: 38, leadership: 52, agility: 72, luck: 51 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 28 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 12 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 12,
    y: 9
  },
  {
    id: 'guangzong-main-guard-a',
    name: '본영 수비병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 5,
    exp: 28,
    hp: 31,
    maxHp: 31,
    attack: 10,
    move: 3,
    stats: { might: 68, intelligence: 38, leadership: 54, agility: 55, luck: 49 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 28 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 12 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 14,
    y: 7
  },
  {
    id: 'guangzong-main-archer-b',
    name: '본영 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 5,
    exp: 30,
    hp: 25,
    maxHp: 25,
    attack: 10,
    move: 3,
    stats: { might: 61, intelligence: 50, leadership: 51, agility: 63, luck: 51 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 1, exp: 30 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 12 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 16,
    y: 6
  },
  {
    id: 'guangzong-main-cavalry-b',
    name: '황건 기병',
    faction: 'enemy',
    className: '경기병',
    classKey: 'cavalry',
    level: 5,
    exp: 30,
    hp: 33,
    maxHp: 33,
    attack: 11,
    move: 5,
    stats: { might: 71, intelligence: 38, leadership: 53, agility: 73, luck: 51 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 30 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 12 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 18,
    y: 10
  },
  {
    id: 'guangzong-main-guard-b',
    name: '본영 수비병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 5,
    exp: 30,
    hp: 32,
    maxHp: 32,
    attack: 10,
    move: 3,
    stats: { might: 69, intelligence: 39, leadership: 55, agility: 55, luck: 50 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 30 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 12 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 18,
    y: 4
  },
  {
    id: 'guangzong-main-guard-c',
    name: '본영 수비병',
    faction: 'enemy',
    className: '황건병',
    classKey: 'yellowTurban',
    level: 5,
    exp: 30,
    hp: 32,
    maxHp: 32,
    attack: 10,
    move: 3,
    stats: { might: 69, intelligence: 39, leadership: 55, agility: 55, luck: 50 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 1, exp: 30 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 12 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 14,
    y: 3
  },
  {
    id: 'guangzong-main-archer-c',
    name: '망루 궁병',
    faction: 'enemy',
    className: '궁병',
    classKey: 'archer',
    level: 5,
    exp: 32,
    hp: 26,
    maxHp: 26,
    attack: 11,
    move: 3,
    stats: { might: 62, intelligence: 52, leadership: 52, agility: 64, luck: 52 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 6 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 12 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 16,
    y: 1
  },
  {
    id: 'guangzong-main-leader-zhang-jue',
    name: '장각',
    faction: 'enemy',
    className: '황건 대현량사',
    classKey: 'rebelLeader',
    level: 6,
    exp: 40,
    hp: 48,
    maxHp: 48,
    attack: 13,
    move: 3,
    stats: { might: 74, intelligence: 78, leadership: 82, agility: 58, luck: 64 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 16 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 4 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 15,
    y: 1
  }
];

const fifthBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 2, y: 16 },
  'guan-yu': { x: 3, y: 16 },
  'zhang-fei': { x: 2, y: 17 }
};

export const fifthBattleUnits: UnitData[] = [
  ...firstBattleUnits
    .filter((unit) => unit.faction === 'ally')
    .map((unit) => placeScenarioUnit(unit, fifthBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })),
  {
    id: 'sishui-vanguard-a',
    name: '서량 선봉',
    faction: 'enemy',
    className: '동탁 보병',
    classKey: 'yellowTurban',
    level: 5,
    exp: 30,
    hp: 32,
    maxHp: 32,
    attack: 10,
    move: 3,
    stats: { might: 68, intelligence: 38, leadership: 52, agility: 55, luck: 44 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 4 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 16 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 6,
    y: 14
  },
  {
    id: 'sishui-vanguard-b',
    name: '서량 선봉',
    faction: 'enemy',
    className: '동탁 보병',
    classKey: 'yellowTurban',
    level: 5,
    exp: 30,
    hp: 32,
    maxHp: 32,
    attack: 10,
    move: 3,
    stats: { might: 68, intelligence: 37, leadership: 52, agility: 54, luck: 44 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 4 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 16 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 8,
    y: 12
  },
  {
    id: 'sishui-raider-a',
    name: '산길 척후',
    faction: 'enemy',
    className: '척후병',
    classKey: 'bandit',
    level: 5,
    exp: 32,
    hp: 30,
    maxHp: 30,
    attack: 11,
    move: 4,
    stats: { might: 70, intelligence: 42, leadership: 48, agility: 66, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 8 },
      armor: { itemId: 'rebel-vest', level: 1, exp: 16 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 5,
    y: 9
  },
  {
    id: 'sishui-archer-a',
    name: '사수관 궁병',
    faction: 'enemy',
    className: '서량 궁병',
    classKey: 'archer',
    level: 5,
    exp: 32,
    hp: 27,
    maxHp: 27,
    attack: 11,
    move: 3,
    stats: { might: 63, intelligence: 50, leadership: 51, agility: 64, luck: 49 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 8 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 16 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 10,
    y: 10
  },
  {
    id: 'sishui-cavalry-a',
    name: '서량 기병',
    faction: 'enemy',
    className: '서량 경기병',
    classKey: 'cavalry',
    level: 6,
    exp: 34,
    hp: 36,
    maxHp: 36,
    attack: 12,
    move: 5,
    stats: { might: 74, intelligence: 38, leadership: 54, agility: 76, luck: 50 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 10 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 2 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 12,
    y: 9
  },
  {
    id: 'sishui-guard-a',
    name: '관문 수비병',
    faction: 'enemy',
    className: '동탁 보병',
    classKey: 'yellowTurban',
    level: 6,
    exp: 34,
    hp: 35,
    maxHp: 35,
    attack: 11,
    move: 3,
    stats: { might: 72, intelligence: 40, leadership: 56, agility: 56, luck: 48 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 12 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 2 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 14,
    y: 7
  },
  {
    id: 'sishui-archer-b',
    name: '관문 궁병',
    faction: 'enemy',
    className: '서량 궁병',
    classKey: 'archer',
    level: 6,
    exp: 36,
    hp: 28,
    maxHp: 28,
    attack: 12,
    move: 3,
    stats: { might: 65, intelligence: 52, leadership: 53, agility: 65, luck: 50 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 12 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 18 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 16,
    y: 6
  },
  {
    id: 'sishui-cavalry-b',
    name: '서량 기병',
    faction: 'enemy',
    className: '서량 경기병',
    classKey: 'cavalry',
    level: 6,
    exp: 36,
    hp: 37,
    maxHp: 37,
    attack: 12,
    move: 5,
    stats: { might: 75, intelligence: 39, leadership: 55, agility: 77, luck: 51 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 12 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 4 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 18,
    y: 10
  },
  {
    id: 'sishui-guard-b',
    name: '관문 수비병',
    faction: 'enemy',
    className: '동탁 보병',
    classKey: 'yellowTurban',
    level: 6,
    exp: 36,
    hp: 36,
    maxHp: 36,
    attack: 11,
    move: 3,
    stats: { might: 73, intelligence: 40, leadership: 57, agility: 56, luck: 49 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 14 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 4 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 16,
    y: 3
  },
  {
    id: 'sishui-gate-guard',
    name: '관문 친위병',
    faction: 'enemy',
    className: '동탁 보병',
    classKey: 'yellowTurban',
    level: 6,
    exp: 38,
    hp: 38,
    maxHp: 38,
    attack: 12,
    move: 3,
    stats: { might: 76, intelligence: 42, leadership: 60, agility: 57, luck: 50 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 18 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 14,
    y: 1
  },
  {
    id: 'sishui-leader-hu-zhen',
    name: '호진',
    faction: 'enemy',
    className: '동탁 장수',
    classKey: 'rebelLeader',
    level: 7,
    exp: 44,
    hp: 50,
    maxHp: 50,
    attack: 14,
    move: 3,
    stats: { might: 80, intelligence: 55, leadership: 72, agility: 60, luck: 54 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 20 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 10 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 15,
    y: 1
  }
];

const sixthBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 2, y: 16 },
  'guan-yu': { x: 3, y: 16 },
  'zhang-fei': { x: 2, y: 17 }
};

export const sixthBattleUnits: UnitData[] = [
  ...firstBattleUnits
    .filter((unit) => unit.faction === 'ally')
    .map((unit) => placeScenarioUnit(unit, sixthBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })),
  {
    id: 'jieqiao-skirmisher-a',
    name: '원소군 척후',
    faction: 'enemy',
    className: '척후병',
    classKey: 'bandit',
    level: 6,
    exp: 36,
    hp: 32,
    maxHp: 32,
    attack: 11,
    move: 4,
    stats: { might: 72, intelligence: 43, leadership: 50, agility: 68, luck: 50 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 14 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 6 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 5,
    y: 12
  },
  {
    id: 'jieqiao-infantry-a',
    name: '원소 보병',
    faction: 'enemy',
    className: '원소 보병',
    classKey: 'yellowTurban',
    level: 6,
    exp: 36,
    hp: 36,
    maxHp: 36,
    attack: 11,
    move: 3,
    stats: { might: 73, intelligence: 42, leadership: 58, agility: 56, luck: 49 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 14 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 6 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 7,
    y: 11
  },
  {
    id: 'jieqiao-archer-a',
    name: '원소 궁병',
    faction: 'enemy',
    className: '원소 궁병',
    classKey: 'archer',
    level: 6,
    exp: 38,
    hp: 29,
    maxHp: 29,
    attack: 12,
    move: 3,
    stats: { might: 66, intelligence: 54, leadership: 54, agility: 66, luck: 50 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 16 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 4 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 9,
    y: 10
  },
  {
    id: 'jieqiao-cavalry-a',
    name: '원소 기병',
    faction: 'enemy',
    className: '원소 경기병',
    classKey: 'cavalry',
    level: 7,
    exp: 40,
    hp: 39,
    maxHp: 39,
    attack: 13,
    move: 5,
    stats: { might: 78, intelligence: 42, leadership: 60, agility: 78, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 18 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 8 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 12,
    y: 9
  },
  {
    id: 'jieqiao-skirmisher-b',
    name: '강가 척후',
    faction: 'enemy',
    className: '척후병',
    classKey: 'bandit',
    level: 6,
    exp: 38,
    hp: 33,
    maxHp: 33,
    attack: 12,
    move: 4,
    stats: { might: 74, intelligence: 44, leadership: 51, agility: 69, luck: 51 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 16 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 6 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 6,
    y: 7
  },
  {
    id: 'jieqiao-archer-b',
    name: '강안 궁병',
    faction: 'enemy',
    className: '원소 궁병',
    classKey: 'archer',
    level: 7,
    exp: 40,
    hp: 30,
    maxHp: 30,
    attack: 13,
    move: 3,
    stats: { might: 68, intelligence: 56, leadership: 56, agility: 67, luck: 51 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 18 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 6 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 11,
    y: 6
  },
  {
    id: 'jieqiao-cavalry-b',
    name: '원소 기병',
    faction: 'enemy',
    className: '원소 경기병',
    classKey: 'cavalry',
    level: 7,
    exp: 42,
    hp: 40,
    maxHp: 40,
    attack: 13,
    move: 5,
    stats: { might: 79, intelligence: 42, leadership: 61, agility: 79, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 20 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 8 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 15,
    y: 8
  },
  {
    id: 'jieqiao-guard-a',
    name: '계교 수비병',
    faction: 'enemy',
    className: '원소 보병',
    classKey: 'yellowTurban',
    level: 7,
    exp: 42,
    hp: 38,
    maxHp: 38,
    attack: 12,
    move: 3,
    stats: { might: 76, intelligence: 45, leadership: 62, agility: 58, luck: 51 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 20 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 16,
    y: 5
  },
  {
    id: 'jieqiao-cavalry-c',
    name: '측면 기병',
    faction: 'enemy',
    className: '원소 경기병',
    classKey: 'cavalry',
    level: 7,
    exp: 44,
    hp: 41,
    maxHp: 41,
    attack: 13,
    move: 5,
    stats: { might: 80, intelligence: 43, leadership: 62, agility: 80, luck: 53 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 22 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 10 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 20,
    y: 5
  },
  {
    id: 'jieqiao-guard-b',
    name: '계교 수비병',
    faction: 'enemy',
    className: '원소 보병',
    classKey: 'yellowTurban',
    level: 7,
    exp: 44,
    hp: 39,
    maxHp: 39,
    attack: 12,
    move: 3,
    stats: { might: 77, intelligence: 45, leadership: 63, agility: 58, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 22 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 18,
    y: 3
  },
  {
    id: 'jieqiao-archer-c',
    name: '계교 궁병',
    faction: 'enemy',
    className: '원소 궁병',
    classKey: 'archer',
    level: 7,
    exp: 44,
    hp: 31,
    maxHp: 31,
    attack: 13,
    move: 3,
    stats: { might: 69, intelligence: 57, leadership: 57, agility: 68, luck: 52 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 22 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 8 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 16,
    y: 1
  },
  {
    id: 'jieqiao-leader-qu-yi',
    name: '곡의',
    faction: 'enemy',
    className: '원소군 교위',
    classKey: 'rebelLeader',
    level: 8,
    exp: 48,
    hp: 54,
    maxHp: 54,
    attack: 15,
    move: 3,
    stats: { might: 84, intelligence: 62, leadership: 78, agility: 62, luck: 56 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 26 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 14 },
      accessory: { itemId: 'war-manual', level: 1, exp: 0 }
    },
    x: 17,
    y: 1
  }
];

const seventhBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 2, y: 16 },
  'guan-yu': { x: 3, y: 16 },
  'zhang-fei': { x: 2, y: 17 }
};

export const seventhBattleUnits: UnitData[] = [
  ...firstBattleUnits
    .filter((unit) => unit.faction === 'ally')
    .map((unit) => placeScenarioUnit(unit, seventhBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })),
  {
    id: 'xuzhou-raider-a',
    name: '조조군 척후',
    faction: 'enemy',
    className: '조조 척후',
    classKey: 'bandit',
    level: 7,
    exp: 42,
    hp: 34,
    maxHp: 34,
    attack: 12,
    move: 4,
    stats: { might: 74, intelligence: 48, leadership: 54, agility: 70, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 18 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 8 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 5,
    y: 13
  },
  {
    id: 'xuzhou-infantry-a',
    name: '조조 보병',
    faction: 'enemy',
    className: '조조 보병',
    classKey: 'yellowTurban',
    level: 7,
    exp: 42,
    hp: 39,
    maxHp: 39,
    attack: 12,
    move: 3,
    stats: { might: 77, intelligence: 48, leadership: 64, agility: 58, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 18 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 8 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 7,
    y: 12
  },
  {
    id: 'xuzhou-archer-a',
    name: '조조 궁병',
    faction: 'enemy',
    className: '조조 궁병',
    classKey: 'archer',
    level: 7,
    exp: 44,
    hp: 31,
    maxHp: 31,
    attack: 13,
    move: 3,
    stats: { might: 69, intelligence: 58, leadership: 58, agility: 68, luck: 52 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 20 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 8 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 9,
    y: 11
  },
  {
    id: 'xuzhou-cavalry-a',
    name: '조조 기병',
    faction: 'enemy',
    className: '조조 경기병',
    classKey: 'cavalry',
    level: 8,
    exp: 46,
    hp: 42,
    maxHp: 42,
    attack: 14,
    move: 5,
    stats: { might: 82, intelligence: 46, leadership: 64, agility: 82, luck: 54 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 22 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 10 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 11,
    y: 9
  },
  {
    id: 'xuzhou-raider-b',
    name: '피난로 척후',
    faction: 'enemy',
    className: '조조 척후',
    classKey: 'bandit',
    level: 7,
    exp: 44,
    hp: 35,
    maxHp: 35,
    attack: 13,
    move: 4,
    stats: { might: 76, intelligence: 49, leadership: 55, agility: 71, luck: 53 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 20 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 8 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 6,
    y: 8
  },
  {
    id: 'xuzhou-archer-b',
    name: '마을 궁병',
    faction: 'enemy',
    className: '조조 궁병',
    classKey: 'archer',
    level: 8,
    exp: 46,
    hp: 32,
    maxHp: 32,
    attack: 14,
    move: 3,
    stats: { might: 70, intelligence: 60, leadership: 59, agility: 69, luck: 53 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 22 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 10 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 10,
    y: 7
  },
  {
    id: 'xuzhou-cavalry-b',
    name: '조조 기병',
    faction: 'enemy',
    className: '조조 경기병',
    classKey: 'cavalry',
    level: 8,
    exp: 48,
    hp: 43,
    maxHp: 43,
    attack: 14,
    move: 5,
    stats: { might: 83, intelligence: 47, leadership: 65, agility: 83, luck: 54 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 24 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 10 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 14,
    y: 8
  },
  {
    id: 'xuzhou-guard-a',
    name: '선봉 수비병',
    faction: 'enemy',
    className: '조조 보병',
    classKey: 'yellowTurban',
    level: 8,
    exp: 48,
    hp: 41,
    maxHp: 41,
    attack: 13,
    move: 3,
    stats: { might: 80, intelligence: 50, leadership: 67, agility: 60, luck: 53 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 24 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 10 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 15,
    y: 5
  },
  {
    id: 'xuzhou-cavalry-c',
    name: '측면 기병',
    faction: 'enemy',
    className: '조조 경기병',
    classKey: 'cavalry',
    level: 8,
    exp: 50,
    hp: 44,
    maxHp: 44,
    attack: 14,
    move: 5,
    stats: { might: 84, intelligence: 47, leadership: 66, agility: 84, luck: 55 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 26 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 12 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 19,
    y: 6
  },
  {
    id: 'xuzhou-guard-b',
    name: '선봉 수비병',
    faction: 'enemy',
    className: '조조 보병',
    classKey: 'yellowTurban',
    level: 8,
    exp: 50,
    hp: 42,
    maxHp: 42,
    attack: 13,
    move: 3,
    stats: { might: 81, intelligence: 50, leadership: 68, agility: 60, luck: 54 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 26 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 10 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 17,
    y: 3
  },
  {
    id: 'xuzhou-archer-c',
    name: '서주 길목 궁병',
    faction: 'enemy',
    className: '조조 궁병',
    classKey: 'archer',
    level: 8,
    exp: 50,
    hp: 33,
    maxHp: 33,
    attack: 14,
    move: 3,
    stats: { might: 71, intelligence: 61, leadership: 60, agility: 70, luck: 54 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 26 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 10 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 15,
    y: 1
  },
  {
    id: 'xuzhou-leader-xiahou-dun',
    name: '하후돈',
    faction: 'enemy',
    className: '조조군 장수',
    classKey: 'rebelLeader',
    level: 9,
    exp: 54,
    hp: 58,
    maxHp: 58,
    attack: 16,
    move: 4,
    stats: { might: 88, intelligence: 66, leadership: 82, agility: 66, luck: 58 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 30 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 16 },
      accessory: { itemId: 'war-manual', level: 1, exp: 0 }
    },
    x: 16,
    y: 1
  }
];

export const xuzhouRecruitUnits: UnitData[] = [
  {
    id: 'jian-yong',
    name: '간옹',
    faction: 'ally',
    className: '책사',
    classKey: 'strategist',
    level: 4,
    exp: 12,
    hp: 26,
    maxHp: 26,
    attack: 7,
    move: 4,
    stats: { might: 42, intelligence: 78, leadership: 66, agility: 64, luck: 72 },
    equipment: {
      weapon: { itemId: 'training-sword', level: 1, exp: 8 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 6 },
      accessory: { itemId: 'war-manual', level: 1, exp: 0 }
    },
    x: 3,
    y: 17
  },
  {
    id: 'mi-zhu',
    name: '미축',
    faction: 'ally',
    className: '군량관',
    classKey: 'quartermaster',
    level: 4,
    exp: 8,
    hp: 28,
    maxHp: 28,
    attack: 7,
    move: 4,
    stats: { might: 40, intelligence: 74, leadership: 70, agility: 58, luck: 82 },
    equipment: {
      weapon: { itemId: 'training-sword', level: 1, exp: 6 },
      armor: { itemId: 'cloth-armor', level: 1, exp: 6 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 4,
    y: 17
  }
];

const eighthBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 2, y: 17 },
  'guan-yu': { x: 3, y: 17 },
  'zhang-fei': { x: 2, y: 18 },
  'jian-yong': { x: 3, y: 18 },
  'mi-zhu': { x: 1, y: 18 }
};

export const eighthBattleUnits: UnitData[] = [
  ...[...firstBattleUnits.filter((unit) => unit.faction === 'ally'), ...xuzhouRecruitUnits].map((unit) =>
    placeScenarioUnit(unit, eighthBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })
  ),
  {
    id: 'xiaopei-raider-a',
    name: '여포군 척후',
    faction: 'enemy',
    className: '기동 척후',
    classKey: 'cavalry',
    level: 8,
    exp: 52,
    hp: 43,
    maxHp: 43,
    attack: 15,
    move: 5,
    stats: { might: 82, intelligence: 50, leadership: 62, agility: 86, luck: 55 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 28 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 14 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 17,
    y: 9
  },
  {
    id: 'xiaopei-raider-b',
    name: '여포군 척후',
    faction: 'enemy',
    className: '기동 척후',
    classKey: 'cavalry',
    level: 8,
    exp: 54,
    hp: 44,
    maxHp: 44,
    attack: 15,
    move: 5,
    stats: { might: 83, intelligence: 50, leadership: 62, agility: 86, luck: 55 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 30 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 14 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 19,
    y: 10
  },
  {
    id: 'xiaopei-infantry-a',
    name: '소패 침투병',
    faction: 'enemy',
    className: '여포군 보병',
    classKey: 'yellowTurban',
    level: 8,
    exp: 50,
    hp: 42,
    maxHp: 42,
    attack: 13,
    move: 3,
    stats: { might: 78, intelligence: 50, leadership: 66, agility: 61, luck: 53 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 26 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 12 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 11,
    y: 12
  },
  {
    id: 'xiaopei-infantry-b',
    name: '소패 침투병',
    faction: 'enemy',
    className: '여포군 보병',
    classKey: 'yellowTurban',
    level: 8,
    exp: 52,
    hp: 43,
    maxHp: 43,
    attack: 13,
    move: 3,
    stats: { might: 79, intelligence: 50, leadership: 67, agility: 62, luck: 53 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 28 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 12 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 12,
    y: 14
  },
  {
    id: 'xiaopei-archer-a',
    name: '소패 궁병',
    faction: 'enemy',
    className: '여포군 궁병',
    classKey: 'archer',
    level: 8,
    exp: 52,
    hp: 34,
    maxHp: 34,
    attack: 14,
    move: 3,
    stats: { might: 70, intelligence: 62, leadership: 60, agility: 71, luck: 54 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 28 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 12 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 18,
    y: 7
  },
  {
    id: 'xiaopei-archer-b',
    name: '소패 궁병',
    faction: 'enemy',
    className: '여포군 궁병',
    classKey: 'archer',
    level: 9,
    exp: 54,
    hp: 35,
    maxHp: 35,
    attack: 15,
    move: 3,
    stats: { might: 72, intelligence: 63, leadership: 61, agility: 72, luck: 55 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 30 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 12 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 21,
    y: 14
  },
  {
    id: 'xiaopei-guard-a',
    name: '창고 습격병',
    faction: 'enemy',
    className: '여포군 보병',
    classKey: 'bandit',
    level: 8,
    exp: 50,
    hp: 38,
    maxHp: 38,
    attack: 14,
    move: 4,
    stats: { might: 79, intelligence: 48, leadership: 58, agility: 72, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 26 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 12 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 8,
    y: 11
  },
  {
    id: 'xiaopei-guard-b',
    name: '창고 습격병',
    faction: 'enemy',
    className: '여포군 보병',
    classKey: 'bandit',
    level: 8,
    exp: 52,
    hp: 39,
    maxHp: 39,
    attack: 14,
    move: 4,
    stats: { might: 80, intelligence: 48, leadership: 58, agility: 73, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 28 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 12 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 9,
    y: 14
  },
  {
    id: 'xiaopei-cavalry-a',
    name: '여포군 기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 9,
    exp: 56,
    hp: 46,
    maxHp: 46,
    attack: 16,
    move: 5,
    stats: { might: 86, intelligence: 50, leadership: 66, agility: 88, luck: 56 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 32 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 16 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 23,
    y: 6
  },
  {
    id: 'xiaopei-cavalry-b',
    name: '여포군 기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 9,
    exp: 58,
    hp: 47,
    maxHp: 47,
    attack: 16,
    move: 5,
    stats: { might: 87, intelligence: 50, leadership: 66, agility: 89, luck: 56 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 34 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 16 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 24,
    y: 15
  },
  {
    id: 'xiaopei-leader-gao-shun',
    name: '고순',
    faction: 'enemy',
    className: '여포군 선봉장',
    classKey: 'rebelLeader',
    level: 10,
    exp: 62,
    hp: 62,
    maxHp: 62,
    attack: 17,
    move: 4,
    stats: { might: 88, intelligence: 66, leadership: 86, agility: 68, luck: 58 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 34 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 18 },
      accessory: { itemId: 'war-manual', level: 1, exp: 0 }
    },
    x: 22,
    y: 3
  }
];

const ninthBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 3, y: 17 },
  'guan-yu': { x: 4, y: 17 },
  'zhang-fei': { x: 3, y: 18 },
  'jian-yong': { x: 5, y: 18 },
  'mi-zhu': { x: 4, y: 19 }
};

export const ninthBattleUnits: UnitData[] = [
  ...[...firstBattleUnits.filter((unit) => unit.faction === 'ally'), ...xuzhouRecruitUnits].map((unit) =>
    placeScenarioUnit(unit, ninthBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })
  ),
  {
    id: 'xuzhou-gate-traitor-a',
    name: '성문 배반병',
    faction: 'enemy',
    className: '서주 배반병',
    classKey: 'bandit',
    level: 9,
    exp: 56,
    hp: 40,
    maxHp: 40,
    attack: 15,
    move: 4,
    stats: { might: 80, intelligence: 48, leadership: 58, agility: 74, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 30 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 14 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 11,
    y: 12
  },
  {
    id: 'xuzhou-gate-traitor-b',
    name: '성문 배반병',
    faction: 'enemy',
    className: '서주 배반병',
    classKey: 'bandit',
    level: 9,
    exp: 58,
    hp: 41,
    maxHp: 41,
    attack: 15,
    move: 4,
    stats: { might: 81, intelligence: 49, leadership: 59, agility: 74, luck: 52 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 32 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 14 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 12,
    y: 14
  },
  {
    id: 'xuzhou-gate-infantry-a',
    name: '성문 수비병',
    faction: 'enemy',
    className: '조표 휘하 보병',
    classKey: 'yellowTurban',
    level: 9,
    exp: 56,
    hp: 44,
    maxHp: 44,
    attack: 14,
    move: 3,
    stats: { might: 80, intelligence: 52, leadership: 68, agility: 62, luck: 54 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 30 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 14 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 17,
    y: 10
  },
  {
    id: 'xuzhou-gate-infantry-b',
    name: '성문 수비병',
    faction: 'enemy',
    className: '조표 휘하 보병',
    classKey: 'yellowTurban',
    level: 9,
    exp: 58,
    hp: 45,
    maxHp: 45,
    attack: 14,
    move: 3,
    stats: { might: 81, intelligence: 52, leadership: 68, agility: 63, luck: 54 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 32 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 14 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 18,
    y: 12
  },
  {
    id: 'xuzhou-gate-archer-a',
    name: '성벽 궁병',
    faction: 'enemy',
    className: '성벽 궁병',
    classKey: 'archer',
    level: 9,
    exp: 58,
    hp: 36,
    maxHp: 36,
    attack: 15,
    move: 3,
    stats: { might: 72, intelligence: 64, leadership: 62, agility: 73, luck: 55 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 32 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 14 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 20,
    y: 7
  },
  {
    id: 'xuzhou-gate-archer-b',
    name: '성벽 궁병',
    faction: 'enemy',
    className: '성벽 궁병',
    classKey: 'archer',
    level: 9,
    exp: 60,
    hp: 37,
    maxHp: 37,
    attack: 15,
    move: 3,
    stats: { might: 73, intelligence: 64, leadership: 63, agility: 74, luck: 55 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 34 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 14 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 22,
    y: 13
  },
  {
    id: 'lubu-cavalry-a',
    name: '여포군 기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 10,
    exp: 62,
    hp: 49,
    maxHp: 49,
    attack: 17,
    move: 5,
    stats: { might: 88, intelligence: 50, leadership: 68, agility: 90, luck: 57 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 36 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 18 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 23,
    y: 5
  },
  {
    id: 'lubu-cavalry-b',
    name: '여포군 기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 10,
    exp: 64,
    hp: 50,
    maxHp: 50,
    attack: 17,
    move: 5,
    stats: { might: 89, intelligence: 50, leadership: 68, agility: 91, luck: 57 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 38 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 18 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 24,
    y: 16
  },
  {
    id: 'lubu-cavalry-c',
    name: '여포군 기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 10,
    exp: 66,
    hp: 50,
    maxHp: 50,
    attack: 18,
    move: 5,
    stats: { might: 90, intelligence: 52, leadership: 70, agility: 91, luck: 58 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 40 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 18 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 21,
    y: 10
  },
  {
    id: 'xuzhou-leader-cao-bao',
    name: '조표',
    faction: 'enemy',
    className: '서주 성문장',
    classKey: 'rebelLeader',
    level: 10,
    exp: 68,
    hp: 64,
    maxHp: 64,
    attack: 17,
    move: 4,
    stats: { might: 84, intelligence: 60, leadership: 82, agility: 66, luck: 56 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 38 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 20 },
      accessory: { itemId: 'war-manual', level: 1, exp: 0 }
    },
    x: 20,
    y: 10
  }
];

const tenthBattleAllyPositions: Record<string, { x: number; y: number }> = {
  'liu-bei': { x: 3, y: 14 },
  'guan-yu': { x: 4, y: 15 },
  'zhang-fei': { x: 3, y: 16 },
  'jian-yong': { x: 5, y: 17 },
  'mi-zhu': { x: 4, y: 18 }
};

export const tenthBattleUnits: UnitData[] = [
  ...[...firstBattleUnits.filter((unit) => unit.faction === 'ally'), ...xuzhouRecruitUnits].map((unit) =>
    placeScenarioUnit(unit, tenthBattleAllyPositions[unit.id] ?? { x: unit.x, y: unit.y })
  ),
  {
    id: 'xuzhou-escape-cavalry-a',
    name: '여포군 추격기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 11,
    exp: 64,
    hp: 52,
    maxHp: 52,
    attack: 18,
    move: 5,
    stats: { might: 91, intelligence: 52, leadership: 70, agility: 92, luck: 58 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 42 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 20 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 21,
    y: 5
  },
  {
    id: 'xuzhou-escape-cavalry-b',
    name: '여포군 추격기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 11,
    exp: 66,
    hp: 53,
    maxHp: 53,
    attack: 18,
    move: 5,
    stats: { might: 92, intelligence: 52, leadership: 70, agility: 93, luck: 58 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 44 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 20 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 23,
    y: 9
  },
  {
    id: 'xuzhou-escape-cavalry-c',
    name: '여포군 추격기병',
    faction: 'enemy',
    className: '여포군 기병',
    classKey: 'cavalry',
    level: 11,
    exp: 66,
    hp: 53,
    maxHp: 53,
    attack: 18,
    move: 5,
    stats: { might: 92, intelligence: 53, leadership: 71, agility: 93, luck: 59 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 46 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 20 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 22,
    y: 16
  },
  {
    id: 'xuzhou-escape-guard-a',
    name: '서주 점거병',
    faction: 'enemy',
    className: '여포군 보병',
    classKey: 'yellowTurban',
    level: 10,
    exp: 62,
    hp: 47,
    maxHp: 47,
    attack: 15,
    move: 3,
    stats: { might: 82, intelligence: 54, leadership: 69, agility: 63, luck: 55 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 36 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 18 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 12,
    y: 9
  },
  {
    id: 'xuzhou-escape-guard-b',
    name: '서주 점거병',
    faction: 'enemy',
    className: '여포군 보병',
    classKey: 'yellowTurban',
    level: 10,
    exp: 62,
    hp: 48,
    maxHp: 48,
    attack: 15,
    move: 3,
    stats: { might: 83, intelligence: 54, leadership: 70, agility: 64, luck: 55 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 38 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 18 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 13,
    y: 13
  },
  {
    id: 'xuzhou-escape-guard-c',
    name: '서주 점거병',
    faction: 'enemy',
    className: '여포군 보병',
    classKey: 'yellowTurban',
    level: 10,
    exp: 64,
    hp: 48,
    maxHp: 48,
    attack: 15,
    move: 3,
    stats: { might: 84, intelligence: 55, leadership: 70, agility: 64, luck: 56 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 40 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 18 },
      accessory: { itemId: 'yellow-scarf-charm', level: 1, exp: 0 }
    },
    x: 15,
    y: 16
  },
  {
    id: 'xuzhou-escape-archer-a',
    name: '여포군 궁병',
    faction: 'enemy',
    className: '여포군 궁병',
    classKey: 'archer',
    level: 10,
    exp: 62,
    hp: 38,
    maxHp: 38,
    attack: 16,
    move: 3,
    stats: { might: 74, intelligence: 65, leadership: 63, agility: 74, luck: 56 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 38 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 16 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 17,
    y: 7
  },
  {
    id: 'xuzhou-escape-archer-b',
    name: '여포군 궁병',
    faction: 'enemy',
    className: '여포군 궁병',
    classKey: 'archer',
    level: 10,
    exp: 64,
    hp: 39,
    maxHp: 39,
    attack: 16,
    move: 3,
    stats: { might: 75, intelligence: 66, leadership: 64, agility: 75, luck: 56 },
    equipment: {
      weapon: { itemId: 'short-bow', level: 2, exp: 40 },
      armor: { itemId: 'cloth-armor', level: 2, exp: 16 },
      accessory: { itemId: 'wind-quiver', level: 1, exp: 0 }
    },
    x: 18,
    y: 14
  },
  {
    id: 'xuzhou-escape-raider-a',
    name: '성내 배반병',
    faction: 'enemy',
    className: '성내 배반병',
    classKey: 'bandit',
    level: 10,
    exp: 62,
    hp: 43,
    maxHp: 43,
    attack: 16,
    move: 4,
    stats: { might: 84, intelligence: 52, leadership: 61, agility: 76, luck: 55 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 38 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 18 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 8,
    y: 10
  },
  {
    id: 'xuzhou-escape-raider-b',
    name: '성내 배반병',
    faction: 'enemy',
    className: '성내 배반병',
    classKey: 'bandit',
    level: 10,
    exp: 64,
    hp: 44,
    maxHp: 44,
    attack: 16,
    move: 4,
    stats: { might: 85, intelligence: 52, leadership: 62, agility: 77, luck: 55 },
    equipment: {
      weapon: { itemId: 'yellow-turban-saber', level: 2, exp: 40 },
      armor: { itemId: 'rebel-vest', level: 2, exp: 18 },
      accessory: { itemId: 'grain-pouch', level: 1, exp: 0 }
    },
    x: 10,
    y: 17
  },
  {
    id: 'xuzhou-escape-leader-song-xian',
    name: '송헌',
    faction: 'enemy',
    className: '여포군 선봉장',
    classKey: 'rebelLeader',
    level: 11,
    exp: 70,
    hp: 68,
    maxHp: 68,
    attack: 18,
    move: 4,
    stats: { might: 88, intelligence: 60, leadership: 84, agility: 72, luck: 58 },
    equipment: {
      weapon: { itemId: 'leader-axe', level: 2, exp: 42 },
      armor: { itemId: 'lamellar-armor', level: 2, exp: 22 },
      accessory: { itemId: 'war-manual', level: 1, exp: 0 }
    },
    x: 20,
    y: 11
  }
];

export const firstBattleBonds: BattleBond[] = [
  {
    id: 'liu-bei__guan-yu',
    unitIds: ['liu-bei', 'guan-yu'],
    title: '도원결의',
    level: 72,
    exp: 20,
    description: '같은 적을 노릴 때 공격 피해 보너스와 연계 공격 확률이 오른다.'
  },
  {
    id: 'liu-bei__zhang-fei',
    unitIds: ['liu-bei', 'zhang-fei'],
    title: '의형제',
    level: 68,
    exp: 12,
    description: '공격 목표가 겹치면 공명 경험치가 빠르게 쌓인다.'
  },
  {
    id: 'guan-yu__zhang-fei',
    unitIds: ['guan-yu', 'zhang-fei'],
    title: '맹장 공명',
    level: 64,
    exp: 8,
    description: '둘이 같은 전선을 압박하면 연계 공격의 기초 확률이 오른다.'
  }
];

export const xuzhouRecruitBonds: BattleBond[] = [
  {
    id: 'liu-bei__jian-yong',
    unitIds: ['liu-bei', 'jian-yong'],
    title: '오랜 벗',
    level: 48,
    exp: 0,
    description: '간옹은 유비가 흔들릴 때 현실적인 말로 길을 정리해 주는 오랜 벗이다.'
  },
  {
    id: 'liu-bei__mi-zhu',
    unitIds: ['liu-bei', 'mi-zhu'],
    title: '서주 후원',
    level: 42,
    exp: 0,
    description: '미축은 서주의 민심과 군량을 묶어 유비군이 오래 버틸 수 있게 돕는다.'
  }
];

export const secondBattleBonds: BattleBond[] = firstBattleBonds.map(cloneBattleBondForScenario);
export const thirdBattleBonds: BattleBond[] = firstBattleBonds.map(cloneBattleBondForScenario);
export const fourthBattleBonds: BattleBond[] = firstBattleBonds.map(cloneBattleBondForScenario);
export const fifthBattleBonds: BattleBond[] = firstBattleBonds.map(cloneBattleBondForScenario);
export const sixthBattleBonds: BattleBond[] = firstBattleBonds.map(cloneBattleBondForScenario);
export const seventhBattleBonds: BattleBond[] = firstBattleBonds.map(cloneBattleBondForScenario);
export const eighthBattleBonds: BattleBond[] = [...firstBattleBonds, ...xuzhouRecruitBonds].map(cloneBattleBondForScenario);
export const ninthBattleBonds: BattleBond[] = eighthBattleBonds.map(cloneBattleBondForScenario);
export const tenthBattleBonds: BattleBond[] = ninthBattleBonds.map(cloneBattleBondForScenario);

function createEighthBattleTerrain(): TerrainType[][] {
  return Array.from({ length: 22 }, (_, y) =>
    Array.from({ length: 26 }, (_, x): TerrainType => {
      if (x <= 1 && y >= 16 && y <= 20) {
        return 'camp';
      }
      if ((x === 2 && y >= 15 && y <= 20) || (x === 3 && y >= 18 && y <= 20)) {
        return 'camp';
      }
      if ((x >= 20 && x <= 23 && y >= 2 && y <= 5) || (x >= 21 && x <= 24 && y >= 13 && y <= 16)) {
        return 'fort';
      }
      if ((x >= 17 && x <= 18 && y >= 7 && y <= 9) || (x >= 8 && x <= 9 && y >= 12 && y <= 14)) {
        return 'village';
      }
      if ((x === 14 || x === 15) && y <= 18 && y >= 0) {
        return 'river';
      }
      if (x === y - 12 || x === y - 13 || (y >= 7 && y <= 10 && x >= 2 && x <= 18) || (x >= 4 && x <= 22 && y === 10)) {
        return 'road';
      }
      if ((x <= 6 && y <= 4) || (x >= 5 && x <= 10 && y >= 3 && y <= 7) || (x >= 2 && x <= 6 && y >= 8 && y <= 12) || (x >= 18 && x <= 25 && y >= 17)) {
        return 'forest';
      }
      if ((x >= 18 && y <= 2) || (x >= 22 && y >= 7 && y <= 12) || (x >= 10 && x <= 13 && y >= 15 && y <= 20) || (x <= 4 && y >= 4 && y <= 7)) {
        return 'hill';
      }
      return 'plain';
    })
  );
}

function createNinthBattleTerrain(): TerrainType[][] {
  return Array.from({ length: 22 }, (_, y) =>
    Array.from({ length: 26 }, (_, x): TerrainType => {
      if ((x >= 1 && x <= 4 && y >= 16 && y <= 20) || (x >= 5 && x <= 7 && y >= 18 && y <= 20)) {
        return 'camp';
      }
      if ((x >= 19 && x <= 24 && y >= 3 && y <= 8) || (x >= 18 && x <= 24 && y >= 12 && y <= 16)) {
        return 'fort';
      }
      if ((x >= 20 && x <= 22 && y >= 9 && y <= 11) || (x >= 11 && x <= 12 && y >= 13 && y <= 15)) {
        return 'village';
      }
      if ((x === 14 || x === 15) && y >= 0 && y <= 20) {
        return 'river';
      }
      if ((y === 10 && x >= 2 && x <= 24) || (x === 8 && y >= 5 && y <= 20) || (x === 18 && y >= 2 && y <= 18) || (x + y === 25 && x >= 7 && x <= 17)) {
        return 'road';
      }
      if ((x <= 5 && y <= 5) || (x >= 2 && x <= 7 && y >= 7 && y <= 12) || (x >= 8 && x <= 13 && y >= 1 && y <= 5) || (x >= 4 && x <= 10 && y >= 14 && y <= 17)) {
        return 'forest';
      }
      if ((x >= 21 && y <= 2) || (x >= 22 && y >= 17) || (x >= 10 && x <= 13 && y >= 16) || (x <= 3 && y >= 6 && y <= 9)) {
        return 'hill';
      }
      return 'plain';
    })
  );
}

function createTenthBattleTerrain(): TerrainType[][] {
  return Array.from({ length: 22 }, (_, y) =>
    Array.from({ length: 28 }, (_, x): TerrainType => {
      if ((x <= 4 && y >= 14 && y <= 20) || (x >= 5 && x <= 7 && y >= 17 && y <= 20)) {
        return 'camp';
      }
      if ((x >= 18 && x <= 25 && y >= 5 && y <= 12) || (x >= 20 && x <= 26 && y >= 13 && y <= 17)) {
        return 'fort';
      }
      if ((x >= 6 && x <= 8 && y >= 9 && y <= 11) || (x >= 13 && x <= 14 && y >= 16 && y <= 18)) {
        return 'village';
      }
      if ((x === 15 || x === 16) && y >= 2 && y <= 21) {
        return 'river';
      }
      if (
        (y === 15 && x >= 2 && x <= 26) ||
        (x === 6 && y >= 7 && y <= 20) ||
        (x === 20 && y >= 4 && y <= 18) ||
        (x + y === 28 && x >= 9 && x <= 20)
      ) {
        return 'road';
      }
      if (
        (x <= 5 && y <= 6) ||
        (x >= 7 && x <= 12 && y >= 2 && y <= 7) ||
        (x >= 2 && x <= 9 && y >= 8 && y <= 13) ||
        (x >= 8 && x <= 13 && y >= 18 && y <= 21)
      ) {
        return 'forest';
      }
      if (
        (x >= 21 && y <= 4) ||
        (x >= 24 && y >= 18) ||
        (x >= 10 && x <= 13 && y >= 11 && y <= 14) ||
        (x <= 3 && y >= 7 && y <= 10)
      ) {
        return 'hill';
      }
      if ((x >= 25 && y >= 6 && y <= 10) || (x >= 18 && x <= 20 && y <= 2)) {
        return 'cliff';
      }
      return 'plain';
    })
  );
}

function placeScenarioUnit(unit: UnitData, position: { x: number; y: number }): UnitData {
  return {
    ...cloneUnitForScenario(unit),
    x: position.x,
    y: position.y
  };
}

function cloneUnitForScenario(unit: UnitData): UnitData {
  return JSON.parse(JSON.stringify(unit)) as UnitData;
}

function cloneBattleBondForScenario(bond: BattleBond): BattleBond {
  return {
    ...bond,
    unitIds: [...bond.unitIds] as [string, string]
  };
}
