LINE1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 1501234export const ENEMY_TEAM = 'torment';56export const CHARACTERS = {7 aislinn: {8 id: 'aislinn',9 name: 'Aislinn',10 title: 'Dreamweaver',11 team: 'allies',12 health: 150,13 damage: 14,14 armor: 2,15 initiative: 7,16 movement: 3,17 range: 3,18 color: 0xa98bff,19 portrait: 'assets/game_icons/witch-face.svg',20 blurb: 'A dream given shape by the mist of Lake Bala. She fights from afar, bending wind and sleep.',21 },22 finella: {23 id: 'finella',24 name: 'Finella',25 title: 'Assassin',26 team: 'allies',27 health: 165,28 damage: 18,29 armor: 4,30 initiative: 10,31 movement: 4,32 range: 1,33 color: 0xe0b15a,34 portrait: 'assets/game_icons/hooded-assassin.svg',35 blurb: 'A knife in the dark. She strikes first, strikes hard, and steps out of reach.',36 },37 atlanta: {38 id: 'atlanta',39 name: 'Atlanta',40 title: 'Huntress',41 team: 'allies',42 health: 135,43 damage: 15,44 armor: 1,45 initiative: 8,46 movement: 3,47 range: 4,48 color: 0x63c98f,49 portrait: 'assets/game_icons/archer.svg',50 blurb: 'The swift huntress of the wild. Her arrows find every opening in the Torment.',51 },52 silencer: {53 id: 'silencer',54 name: 'Silencer',55 title: 'Torment footman',56 team: ENEMY_TEAM,57 health: 85,58 damage: 12,59 armor: 2,60 initiative: 6,61 movement: 3,62 range: 1,63 color: 0x8f2b3c,64 shape: 'spike',65 portrait: 'assets/game_icons/brutal-helm.svg',66 },67 spitebound: {68 id: 'spitebound',69 name: 'Spitebound',70 title: 'Torment archer',71 team: ENEMY_TEAM,72 health: 65,73 damage: 11,74 armor: 0,75 initiative: 5,76 movement: 2,77 range: 3,78 color: 0x7a2f86,79 shape: 'spire',80 portrait: 'assets/game_icons/devil-mask.svg',81 },82 brute: {83 id: 'brute',84 name: 'Sorrowbrute',85 title: 'Torment bulwark',86 team: ENEMY_TEAM,87 health: 150,88 damage: 20,89 armor: 4,90 initiative: 4,91 movement: 2,92 range: 1,93 color: 0x5a1f2a,94 shape: 'brute',95 portrait: 'assets/game_icons/horned-skull.svg',96 },97};9899export const HEROINE_IDS = ['aislinn', 'finella', 'atlanta'];100101102103export const STARTING_CARDS = {104 aislinn: ['mist-lance', 'veil-of-bran', 'dream-snare'],105 finella: ['crooked-blade', 'venom-kiss', 'blood-for-blood'],106 atlanta: ['hunters-mark', 'snare', 'golden-stag'],107};108109110111export const RECRUIT_HONOR = {112 aislinn: 40,113 finella: 60,114 atlanta: 50,115};116117export function cardPrice(card) {118 return card.cost * 30;119}120121122123export const CARDS = [124 {125 id: 'mist-lance',126 heroine: 'aislinn',127 name: 'Mist Lance',128 cost: 1,129 icon: 'assets/game_icons/bolt-spell-cast.svg',130 rule: { kind: 'enemy', min: 2, max: 5 },131 effects: [{ type: 'damage', amount: 16, ignoreArmor: true }],132 text: 'Deal 16 damage at range 2–5, ignoring armour and wards.',133 },134 {135 id: 'veil-of-bran',136 heroine: 'aislinn',137 name: 'Veil of Bran',138 cost: 2,139 icon: 'assets/game_icons/magic-shield.svg',140 rule: { kind: 'ally', min: 0, max: 3 },141 effects: [{ type: 'ward', amount: 9, rounds: 2 }],142 text: 'An ally within 3 gains a 9-point ward for 2 rounds.',143 },144 {145 id: 'dream-snare',146 heroine: 'aislinn',147 name: 'Dream Snare',148 cost: 2,149 icon: 'assets/game_icons/dream-catcher.svg',150 rule: { kind: 'enemy', min: 2, max: 4 },151 effects: [152 { type: 'damage', amount: 6, ignoreArmor: false },153 { type: 'root', rounds: 1 },154 ],155 text: 'Deal 6 damage at range 2–4 and root the target for a turn.',156 },157 {158 id: 'wind-tales',159 heroine: 'aislinn',160 name: 'Wind Tales',161 cost: 1,162 icon: 'assets/game_icons/arrow-wings.svg',163 rule: { kind: 'ally', min: 1, max: 4 },164 effects: [{ type: 'haste', movement: 2 }],165 text: 'An ally within 4 gains 2 extra movement.',166 },167 {168 id: 'lullaby',169 heroine: 'aislinn',170 name: 'Lullaby',171 cost: 3,172 icon: 'assets/game_icons/sleepy.svg',173 rule: { kind: 'enemy', min: 1, max: 4 },174 effects: [{ type: 'volley', amount: 12, radius: 1 }],175 text: 'Deal 12 damage to the target and every enemy beside it.',176 },177 {178 id: 'crooked-blade',179 heroine: 'finella',180 name: 'Crooked Blade',181 cost: 1,182 icon: 'assets/game_icons/bowie-knife.svg',183 rule: { kind: 'enemy', min: 1, max: 1 },184 effects: [{ type: 'damage', amount: 22, ignoreArmor: false }],185 text: 'Deal 22 damage to an adjacent enemy.',186 },187 {188 id: 'step-between',189 heroine: 'finella',190 name: 'Step Between',191 cost: 1,192 icon: 'assets/game_icons/boot-prints.svg',193 rule: { kind: 'empty', min: 1, max: 3 },194 effects: [{ type: 'blink', distance: 3 }],195 text: 'Step to any empty hex within 3, ignoring the path.',196 },197 {198 id: 'venom-kiss',199 heroine: 'finella',200 name: 'Venom Kiss',201 cost: 2,202 icon: 'assets/game_icons/snake-bite.svg',203 rule: { kind: 'enemy', min: 1, max: 1 },204 effects: [205 { type: 'damage', amount: 8, ignoreArmor: false },206 { type: 'poison', damage: 6, rounds: 2 },207 ],208 text: 'Deal 8 damage and poison an adjacent enemy for 6 a turn for 2 rounds.',209 },210 {211 id: 'widows-due',212 heroine: 'finella',213 name: "Widow's Due",214 cost: 3,215 icon: 'assets/game_icons/hooded-assassin.svg',216 rule: { kind: 'enemy', min: 1, max: 1 },217 effects: [{ type: 'assassinate', healthy: 14, wounded: 30, threshold: 50 }],218 text: 'Deal 30 damage to an adjacent wounded enemy, or 14 if they are above half health.',219 },220 {221 id: 'blood-for-blood',222 heroine: 'finella',223 name: 'Blood for Blood',224 cost: 2,225 icon: 'assets/game_icons/bleeding-heart.svg',226 rule: { kind: 'self', min: 0, max: 0 },227 effects: [228 { type: 'heal', amount: 25 },229 { type: 'ward', amount: 5, rounds: 2 },230 ],231 text: 'Heal 25 health and gain a 5-point ward for 2 rounds.',232 },233 {234 id: 'piercing-shot',235 heroine: 'atlanta',236 name: 'Piercing Shot',237 cost: 2,238 icon: 'assets/game_icons/barbed-arrow.svg',239 rule: { kind: 'enemy', min: 2, max: 6 },240 effects: [{ type: 'line', amount: 14 }],241 text: 'Fire through an enemy at range 2–6, hitting every enemy on the line for 14.',242 },243 {244 id: 'hunters-mark',245 heroine: 'atlanta',246 name: "Hunter's Mark",247 cost: 1,248 icon: 'assets/game_icons/eye-target.svg',249 rule: { kind: 'enemy', min: 1, max: 6 },250 effects: [{ type: 'mark', bonus: 6, rounds: 2 }],251 text: 'Mark an enemy at range 1–6: they take 6 extra damage for 2 rounds.',252 },253 {254 id: 'snare',255 heroine: 'atlanta',256 name: 'Snare',257 cost: 1,258 icon: 'assets/game_icons/box-trap.svg',259 rule: { kind: 'enemy', min: 1, max: 4 },260 effects: [261 { type: 'damage', amount: 5, ignoreArmor: false },262 { type: 'root', rounds: 1 },263 ],264 text: 'Deal 5 damage at range 1–4 and root the target for a turn.',265 },266 {267 id: 'volley',268 heroine: 'atlanta',269 name: 'Volley',270 cost: 3,271 icon: 'assets/game_icons/arrow-flights.svg',272 rule: { kind: 'enemy', min: 2, max: 5 },273 effects: [{ type: 'volley', amount: 12, radius: 1 }],274 text: 'Deal 12 damage to an enemy at range 2–5 and every enemy beside them.',275 },276 {277 id: 'golden-stag',278 heroine: 'atlanta',279 name: 'Golden Stag',280 cost: 2,281 icon: 'assets/game_icons/deer-head.svg',282 rule: { kind: 'ally', min: 0, max: 4 },283 effects: [284 { type: 'heal', amount: 20 },285 { type: 'haste', movement: 1 },286 ],287 text: 'Heal an ally within 4 for 20 and grant 1 extra movement.',288 },289];290291const CARD_BY_ID = new Map(CARDS.map((card) => [card.id, card]));292293export function cardById(id) {294 const card = CARD_BY_ID.get(id);295 if (!card) throw new Error(`Unknown card: ${id}`);296 return card;297}298299export function heroineDeck(character) {300 return CARDS.filter((card) => card.heroine === character).map((card) => card.id);301}302303304export const ENCOUNTERS = [305 {306 index: 0,307 name: 'Their Hatred Takes Form',308 approach: 'The gate',309 subtitle:310 'The mist gathers beyond the wall, and the Torment comes to the gate. A Sorrowbrute wades out of it, and arrows follow. The village must hold.',311 enemies: [312 ['silencer', { column: 8, row: 3 }],313 ['silencer', { column: 10, row: 6 }],314 ['spitebound', { column: 10, row: 1 }],315 ['spitebound', { column: 10, row: 7 }],316 ['brute', { column: 9, row: 4 }],317 ],318 },319];320321export const ALLY_STARTING_HEXES = [322 { column: 2, row: 2 },323 { column: 2, row: 4 },324 { column: 2, row: 6 },325];326327export function encounterByIndex(index) {328 const encounter = ENCOUNTERS[index];329 if (!encounter) throw new Error(`Unknown encounter: ${index}`);330 return encounter;331}332333334335336337export function battleSpec(index, party = HEROINE_IDS) {338 const encounter = encounterByIndex(index);339 return {340 encounter: index,341 name: encounter.name,342 allies: party.map((entry, position) => {343 const { character, cards } =344 typeof entry === 'string' ? { character: entry, cards: undefined } : entry;345 return {346 character,347 cards,348 hex: { ...ALLY_STARTING_HEXES[position] },349 };350 }),351 enemies: encounter.enemies.map(([character, hex]) => ({352 character,353 hex: { ...hex },354 })),355 };356}