@sia.soul/sia-react-ui 0.1.108 → 0.1.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/game.js CHANGED
@@ -7,13 +7,165 @@ import {
7
7
  } from "./chunk-CZ2ITBRW.js";
8
8
  import "./chunk-NZMUW5XI.js";
9
9
 
10
+ // src/game/hex-rules.ts
11
+ var DEFAULT_GAME_ABILITIES = [
12
+ { id: "bolt", name: "\u7B26\u7B93", kind: "attack", effect: "damage", range: 2, scale: 1, cooldown: 1, description: "\u4E24\u683C\u5185\u5355\u4F53\u653B\u51FB\u3002" },
13
+ { id: "blade", name: "\u5251\u51FB", kind: "attack", effect: "damage", range: 1, scale: 1.3, cooldown: 1, description: "\u81EA\u52A8\u63A5\u8FD1\u76EE\u6807\uFF0C\u4E00\u683C\u5185\u9020\u6210\u8F83\u9AD8\u4F24\u5BB3\u3002" },
14
+ { id: "thunder", name: "\u5F15\u96F7", kind: "skill", effect: "damage", range: 3, scale: 1.8, cooldown: 3, description: "\u6BCF\u4E09\u56DE\u5408\uFF0C\u4E09\u683C\u5185\u5355\u4F53\u7206\u53D1\u3002" },
15
+ { id: "flame", name: "\u706B\u9635", kind: "skill", effect: "blast", range: 2, scale: 1.15, cooldown: 3, description: "\u6BCF\u4E09\u56DE\u5408\uFF0C\u653B\u51FB\u76EE\u6807\u53CA\u5176\u5468\u56F4\u4E00\u683C\u654C\u4EBA\u3002" },
16
+ { id: "mend", name: "\u56DE\u6625", kind: "power", effect: "heal", range: 1, scale: 0.12, cooldown: 5, description: "\u6BCF\u4E94\u56DE\u5408\uFF0C\u6062\u590D\u6700\u5927\u6C14\u8840\u7684 12%\u3002" },
17
+ { id: "ward", name: "\u62A4\u4F53", kind: "power", effect: "shield", range: 1, scale: 0.4, cooldown: 5, description: "\u6BCF\u4E94\u56DE\u5408\uFF0C\u672C\u56DE\u5408\u51CF\u4F24 40%\u3002" },
18
+ { id: "bell", name: "\u9547\u5996\u94C3", kind: "treasure", effect: "blast", range: 3, scale: 1.5, cooldown: 8, description: "\u6BCF\u516B\u56DE\u5408\uFF0C\u9707\u51FB\u76EE\u6807\u5468\u56F4\u4E00\u683C\u654C\u4EBA\u3002" },
19
+ { id: "seal", name: "\u4F0F\u9B54\u5370", kind: "treasure", effect: "damage", range: 3, scale: 2.5, cooldown: 8, description: "\u6BCF\u516B\u56DE\u5408\uFF0C\u5BF9\u4E00\u4E2A\u76EE\u6807\u9020\u6210\u5F3A\u529B\u4F24\u5BB3\u3002" }
20
+ ];
21
+ function gameAbilities(definition) {
22
+ return definition.abilities ?? DEFAULT_GAME_ABILITIES;
23
+ }
24
+ function hexDistance(a, b) {
25
+ return Math.max(Math.abs(a.q - b.q), Math.abs(a.r - b.r), Math.abs(a.q + a.r - b.q - b.r));
26
+ }
27
+ function gameHexCells() {
28
+ const cells = [];
29
+ for (let q = -3; q <= 3; q++) for (let r = -3; r <= 3; r++) if (hexDistance({ q, r }, { q: 0, r: 0 }) <= 3) cells.push({ q, r });
30
+ return cells;
31
+ }
32
+ var directions = [{ q: 1, r: 0 }, { q: 1, r: -1 }, { q: 0, r: -1 }, { q: -1, r: 0 }, { q: -1, r: 1 }, { q: 0, r: 1 }];
33
+ var key = (cell) => `${cell.q},${cell.r}`;
34
+ var living = (unit) => unit.hp > 0;
35
+ function advance(unit, target, range, units, cues, at) {
36
+ if (hexDistance(unit, target) <= range) return;
37
+ const blocked = new Set(units.filter((u) => u.id !== unit.id && living(u)).map(key));
38
+ const queue = [{ cell: { q: unit.q, r: unit.r }, first: null }], seen = /* @__PURE__ */ new Set([key(unit)]);
39
+ while (queue.length) {
40
+ const current = queue.shift();
41
+ if (current.first && hexDistance(current.cell, target) <= range) {
42
+ const from = { q: unit.q, r: unit.r };
43
+ unit.q = current.first.q;
44
+ unit.r = current.first.r;
45
+ cues.push({ at, kind: "move", actor: unit.id, from, to: { ...current.first } });
46
+ return;
47
+ }
48
+ for (const d of directions) {
49
+ const cell = { q: current.cell.q + d.q, r: current.cell.r + d.r }, id = key(cell);
50
+ if (hexDistance(cell, { q: 0, r: 0 }) > 3 || blocked.has(id) || seen.has(id)) continue;
51
+ seen.add(id);
52
+ queue.push({ cell, first: current.first ?? cell });
53
+ }
54
+ }
55
+ }
56
+ function spawnHexEnemy(fight, hp, seed) {
57
+ const edge = gameHexCells().filter((c) => hexDistance(c, { q: 0, r: 0 }) === 3).sort((a, b) => Math.atan2(a.r + a.q / 2, a.q) - Math.atan2(b.r + b.q / 2, b.q));
58
+ const start = ((seed + fight.spawned * 5) % edge.length + edge.length) % edge.length;
59
+ const cell = edge.slice(start).concat(edge.slice(0, start)).find((c) => !fight.units.some((u) => living(u) && key(u) === key(c)));
60
+ if (!cell) return void 0;
61
+ const enemy = { ...cell, id: `enemy-${fight.spawned++}`, side: "enemy", hp, maxHp: hp };
62
+ fight.units.push(enemy);
63
+ return enemy;
64
+ }
65
+ function resolveHexRound(definition, state, stats, rng) {
66
+ const f = state.fight, map = definition.maps[state.map], pet = definition.pets.find((p) => p.id === state.pet);
67
+ const hero = f.units.find((u) => u.id === "hero"), companion = f.units.find((u) => u.id === "pet");
68
+ const cues = [], before = f.units.filter(living).map((u) => ({ ...u }));
69
+ hero.hp = f.hp;
70
+ hero.maxHp = f.maxHp;
71
+ const beforeHero = before.find((u) => u.id === "hero");
72
+ if (beforeHero) beforeHero.hp = f.hp;
73
+ f.turn++;
74
+ if (!f.boss && f.spawned < 4 && f.turn % 2 === 1) {
75
+ const unit = spawnHexEnemy(f, map.hp, state.kills * 3);
76
+ if (unit) {
77
+ before.push({ ...unit });
78
+ cues.push({ at: 0.02, kind: "spawn", actor: unit.id, label: "\u5996\u6C14\u6765\u88AD" });
79
+ }
80
+ }
81
+ const enemies = () => f.units.filter((u) => u.side === "enemy" && living(u));
82
+ const target = enemies().sort((a, b) => hexDistance(hero, a) - hexDistance(hero, b) || a.hp - b.hp)[0];
83
+ const cycle = f.turn % 5, move = !f.boss || cycle === 1 || cycle === 2 ? "strike" : cycle === 3 ? "charge" : cycle === 4 ? "heavy" : "recover";
84
+ const playback = { units: before, cues, turn: f.turn, boss: f.boss, move, heroBefore: hero.hp, heroAfterImpact: hero.hp, heroAfter: hero.hp, enemyBefore: target?.hp ?? 0, enemyAfterHero: target?.hp ?? 0, enemyAfter: target?.hp ?? 0, healed: 0, guarded: pet.effect === "guard", won: false, xp: 0, gold: 0 };
85
+ const event = { damage: 0, petDamage: 0, crit: rng() < 0.13, skill: false, incoming: 0, playback };
86
+ const abilities = gameAbilities(definition), equipped = (kind) => abilities.find((a) => a.id === state.loadout[kind]) ?? abilities.find((a) => a.kind === kind);
87
+ const attack = equipped("attack"), skill = equipped("skill"), power = equipped("power"), treasure = equipped("treasure");
88
+ const offensive = f.turn % treasure.cooldown === 0 ? treasure : f.turn % skill.cooldown === 0 ? skill : attack;
89
+ event.skill = offensive.kind !== "attack";
90
+ if (target) {
91
+ advance(hero, target, offensive.range, f.units, cues, 0.04);
92
+ if (hexDistance(hero, target) <= offensive.range) {
93
+ cues.push({ at: 0.18, kind: "cast", actor: "hero", target: target.id, label: offensive.name });
94
+ const victims = offensive.effect === "blast" ? enemies().filter((u) => hexDistance(target, u) <= 1) : [target];
95
+ for (const enemy of victims) {
96
+ const damage = Math.round(stats.atk * offensive.scale * (event.crit ? 1.5 : 1));
97
+ enemy.hp = Math.max(0, enemy.hp - damage);
98
+ event.damage += damage;
99
+ cues.push({ at: 0.35, kind: "hit", actor: "hero", target: enemy.id, value: damage, hp: enemy.hp, label: event.crit ? "\u66B4\u51FB" : offensive.name });
100
+ }
101
+ }
102
+ playback.enemyAfterHero = target.hp;
103
+ }
104
+ let shield = pet.effect === "guard" ? 0.25 : 0;
105
+ if (f.turn % power.cooldown === 0 && power.effect === "shield") {
106
+ shield = Math.max(shield, power.scale);
107
+ cues.push({ at: 0.4, kind: "shield", actor: "hero", target: "hero", label: power.name });
108
+ }
109
+ const petTarget = enemies().sort((a, b) => hexDistance(companion, a) - hexDistance(companion, b))[0];
110
+ advance(companion, pet.effect === "attack" && petTarget ? petTarget : hero, pet.effect === "attack" ? 2 : 1, f.units, cues, 0.4);
111
+ if (pet.effect === "attack" && petTarget && hexDistance(companion, petTarget) <= 2) {
112
+ const damage = pet.base + ((state.pets[state.pet] || 1) - 1) * 3;
113
+ petTarget.hp = Math.max(0, petTarget.hp - damage);
114
+ event.petDamage = damage;
115
+ cues.push({ at: 0.44, kind: "cast", actor: "pet", target: petTarget.id, label: "\u7075\u5BA0\u8FFD\u51FB" });
116
+ cues.push({ at: 0.53, kind: "hit", actor: "pet", target: petTarget.id, value: damage, hp: petTarget.hp });
117
+ }
118
+ enemies().forEach((enemy, i) => {
119
+ advance(enemy, hero, 1, f.units, cues, 0.43);
120
+ if (hero.hp <= 0 || hexDistance(enemy, hero) > 1 || move === "charge" || move === "recover") return;
121
+ const damage = Math.max(1, Math.round(((f.boss ? map.bossAtk : map.atk) * (move === "heavy" ? 2 : 1) - stats.def) * (1 - shield)));
122
+ cues.push({ at: 0.57 + i * 0.035, kind: "cast", actor: enemy.id, target: "hero", label: move === "heavy" ? map.bossSkillName ?? "\u84C4\u529B\u91CD\u51FB" : "\u8FD1\u8EAB\u653B\u51FB" });
123
+ hero.hp = Math.max(0, hero.hp - damage);
124
+ event.incoming += damage;
125
+ cues.push({ at: 0.63 + i * 0.035, kind: "hit", actor: enemy.id, target: "hero", value: damage, hp: hero.hp });
126
+ });
127
+ playback.heroAfterImpact = hero.hp;
128
+ if (hero.hp > 0) {
129
+ const amount = pet.effect === "heal" ? 7 + (state.pets[state.pet] || 1) * 3 : 0;
130
+ const heal = Math.min(hero.maxHp - hero.hp, amount);
131
+ if (heal > 0) {
132
+ hero.hp += heal;
133
+ playback.healed += heal;
134
+ cues.push({ at: 0.79, kind: "heal", actor: "pet", target: "hero", value: heal, hp: hero.hp, label: "\u6708\u534E\u51DD\u9732" });
135
+ }
136
+ if (f.turn % power.cooldown === 0 && power.effect === "heal") {
137
+ const value = Math.min(hero.maxHp - hero.hp, Math.round(hero.maxHp * power.scale));
138
+ hero.hp += value;
139
+ playback.healed += value;
140
+ cues.push({ at: 0.82, kind: "heal", actor: "hero", target: "hero", value, hp: hero.hp, label: power.name });
141
+ }
142
+ }
143
+ for (const unit of f.units) if (unit.hp === 0 && before.some((u) => u.id === unit.id && u.hp > 0)) cues.push({ at: 0.84, kind: "death", actor: unit.id });
144
+ playback.heroAfter = hero.hp;
145
+ playback.enemyAfter = target?.hp ?? 0;
146
+ f.hp = hero.hp;
147
+ f.enemyHp = enemies().reduce((total, u) => total + u.hp, 0);
148
+ f.enemyMax = f.units.filter((u) => u.side === "enemy").reduce((total, u) => total + u.maxHp, 0);
149
+ if (hero.hp === 0 || f.turn >= 60) {
150
+ f.status = "lost";
151
+ event.lost = true;
152
+ } else if (!enemies().length && (f.boss || f.spawned >= 4)) {
153
+ f.status = "won";
154
+ playback.won = true;
155
+ }
156
+ cues.sort((a, b) => a.at - b.at);
157
+ return event;
158
+ }
159
+
10
160
  // src/game/engine.ts
11
161
  function createIdleEngine(definition) {
12
162
  const MAPS = definition.maps, PETS = definition.pets, slots = definition.slots, RARITIES = definition.rarities;
13
- const slotKeys = Object.keys(slots), SLOTS = Object.fromEntries(slotKeys.map((key) => [key, slots[key].name]));
163
+ const slotKeys = Object.keys(slots), SLOTS = Object.fromEntries(slotKeys.map((key2) => [key2, slots[key2].name]));
14
164
  const positive = (value) => Number.isFinite(value) && value > 0;
15
165
  if (!MAPS.length || !PETS.length || !slotKeys.length || RARITIES.length < 3 || new Set(PETS.map((p) => p.id)).size !== PETS.length || MAPS.some((m, i) => m.id !== i || !slots[m.rewardSlot] || !positive(m.hp) || !positive(m.bossHp) || [m.atk, m.bossAtk, m.xp, m.gold].some((n) => !Number.isFinite(n) || n < 0)) || PETS.some((p) => !p.id || !Number.isFinite(p.cost) || p.cost < 0 || !Number.isFinite(p.base) || p.base < 0) || slotKeys.some((k) => slots[k].names.length !== RARITIES.length || Object.values(slots[k].base).some((n) => !Number.isFinite(n) || n < 0)) || definition.turnDurationMs !== void 0 && (!Number.isInteger(definition.turnDurationMs) || definition.turnDurationMs < 1e3 || definition.turnDurationMs > 5e3) || definition.offlineCapSeconds !== void 0 && (!Number.isInteger(definition.offlineCapSeconds) || definition.offlineCapSeconds < 0 || definition.offlineCapSeconds > 43200))
16
166
  throw new Error("\u6E38\u620F\u5185\u5BB9\u914D\u7F6E\u4E0D\u6B63\u786E");
167
+ const abilities = gameAbilities(definition);
168
+ if (new Set(abilities.map((a) => a.id)).size !== abilities.length || ["attack", "skill", "power", "treasure"].some((kind) => !abilities.some((a) => a.kind === kind)) || abilities.some((a) => !a.id || !["attack", "skill", "power", "treasure"].includes(a.kind) || !["damage", "blast", "heal", "shield"].includes(a.effect) || !Number.isInteger(a.range) || a.range < 1 || a.range > 3 || !Number.isFinite(a.scale) || a.scale <= 0 || a.effect === "shield" && a.scale > 0.8 || (a.kind === "power" ? !["heal", "shield"].includes(a.effect) : !["damage", "blast"].includes(a.effect)) || !Number.isInteger(a.cooldown) || (a.kind === "attack" ? a.cooldown !== 1 : a.cooldown < 2))) throw new Error("\u81EA\u52A8\u6218\u6597\u80FD\u529B\u914D\u7F6E\u4E0D\u6B63\u786E");
17
169
  const busy2 = (s) => Boolean(s.fight?.boss && s.fight.status === "active");
18
170
  const copy = (value) => JSON.parse(JSON.stringify(value));
19
171
  function makeGear(slot, tier = 0, rank = 0, id = Date.now()) {
@@ -21,7 +173,7 @@ function createIdleEngine(definition) {
21
173
  return { id: String(id), slot, tier, rank, name: slots[slot].names[tier], atk: Math.round(slots[slot].base.atk * scale), def: Math.round(slots[slot].base.def * scale), hp: Math.round(slots[slot].base.hp * scale), locked: false };
22
174
  }
23
175
  function freshState(now = Date.now()) {
24
- return { version: 1, name: definition.heroName, level: 1, xp: 0, gold: 120, essence: 30, material: 0, map: 0, unlocked: 0, cleared: [], idle: false, kills: 0, bossWins: 0, inventory: [], equipment: Object.fromEntries(slotKeys.map((key) => [key, slots[key].starter ? makeGear(key, 0, 0, `starter-${key}`) : null])), upgrades: Object.fromEntries(slotKeys.map((key) => [key, 0])), pet: PETS[0].id, pets: { [PETS[0].id]: 1 }, nextId: 1, savedAt: now, sessionGold: 0, sessionXp: 0, sessionDrops: 0, logs: [], fight: null };
176
+ return { version: 1, name: definition.heroName, level: 1, xp: 0, gold: 120, essence: 30, material: 0, map: 0, unlocked: 0, cleared: [], idle: false, kills: 0, bossWins: 0, inventory: [], equipment: Object.fromEntries(slotKeys.map((key2) => [key2, slots[key2].starter ? makeGear(key2, 0, 0, `starter-${key2}`) : null])), upgrades: Object.fromEntries(slotKeys.map((key2) => [key2, 0])), pet: PETS[0].id, pets: { [PETS[0].id]: 1 }, nextId: 1, savedAt: now, sessionGold: 0, sessionXp: 0, sessionDrops: 0, logs: [], fight: null, loadout: Object.fromEntries(["attack", "skill", "power", "treasure"].map((kind) => [kind, abilities.find((a) => a.kind === kind).id])) };
25
177
  }
26
178
  const xpNeeded = (s) => 50 + s.level * 30;
27
179
  function stats(s) {
@@ -29,14 +181,14 @@ function createIdleEngine(definition) {
29
181
  for (const [slot, item] of Object.entries(s.equipment))
30
182
  if (item) {
31
183
  const multiplier = 1 + s.upgrades[slot] * 0.16;
32
- for (const key of ["atk", "def", "hp"])
33
- result[key] += Math.round(item[key] * multiplier);
184
+ for (const key2 of ["atk", "def", "hp"])
185
+ result[key2] += Math.round(item[key2] * multiplier);
34
186
  }
35
187
  result.power = result.atk * 5 + result.def * 3 + Math.round(result.hp / 5) + (s.pets[s.pet] || 0) * 18;
36
188
  return result;
37
189
  }
38
- function addLog(s, text, type = "info") {
39
- s.logs.unshift({ text, type, time: Date.now() });
190
+ function addLog(s, text2, type = "info") {
191
+ s.logs.unshift({ text: text2, type, time: Date.now() });
40
192
  s.logs = s.logs.slice(0, 60);
41
193
  }
42
194
  function addDrop(s, item) {
@@ -60,22 +212,30 @@ function createIdleEngine(definition) {
60
212
  }
61
213
  }
62
214
  function beginFight(s, boss = false) {
63
- if (boss && busy2(s))
64
- return;
215
+ if (boss && busy2(s)) return;
65
216
  const m = MAPS[s.map], st = stats(s);
66
- s.fight = { boss, hp: st.hp, maxHp: st.hp, enemyHp: boss ? m.bossHp : m.hp, enemyMax: boss ? m.bossHp : m.hp, turn: 0, status: "active", recovery: 0 };
67
- if (boss)
68
- addLog(s, `\u5411 ${m.boss} \u53D1\u8D77\u6311\u6218\u3002`, "boss");
217
+ s.fight = {
218
+ boss,
219
+ hp: st.hp,
220
+ maxHp: st.hp,
221
+ enemyHp: 0,
222
+ enemyMax: 0,
223
+ turn: 0,
224
+ status: "active",
225
+ recovery: 0,
226
+ spawned: 0,
227
+ units: [{ id: "hero", side: "hero", q: 0, r: 0, hp: st.hp, maxHp: st.hp }, { id: "pet", side: "pet", q: -1, r: 1, hp: 1, maxHp: 1 }]
228
+ };
229
+ for (let i = 0; i < (boss ? 1 : 2); i++) spawnHexEnemy(s.fight, boss ? m.bossHp : m.hp, s.kills * 3);
230
+ s.fight.enemyHp = s.fight.enemyMax = boss ? m.bossHp : m.hp * 2;
231
+ if (boss) addLog(s, `\u573A\u4E0A\u5C0F\u5996\u5DF2\u6E05\u9000\uFF0C${m.boss}\u8FDB\u5165\u68CB\u76D8\u3002`, "boss");
69
232
  }
70
233
  function tick(s, rng = Math.random) {
71
- if (!s.idle && !s.fight?.boss)
72
- return null;
73
- if (!s.fight)
74
- beginFight(s);
234
+ if (!s.idle && !s.fight?.boss) return null;
235
+ if (!s.fight) beginFight(s);
75
236
  let f = s.fight;
76
237
  if (f.status !== "active") {
77
- if (++f.recovery < 2)
78
- return null;
238
+ if (++f.recovery < 2) return null;
79
239
  if (!s.idle) {
80
240
  s.fight = null;
81
241
  return null;
@@ -83,69 +243,42 @@ function createIdleEngine(definition) {
83
243
  beginFight(s);
84
244
  f = s.fight;
85
245
  }
86
- const st = stats(s), m = MAPS[s.map];
87
- f.turn++;
88
- const skill = f.turn % 3 === 0, crit = rng() < 0.13;
89
- const damage = Math.round(st.atk * (skill ? 1.65 : 1) * (crit ? 1.5 : 1));
90
- const pet = PETS.find((p) => p.id === s.pet), petLevel = s.pets[s.pet] || 1;
91
- const enemyBefore = f.enemyHp, heroBefore = f.hp;
92
- const enemyAfterHero = Math.max(0, f.enemyHp - damage);
93
- const petDamage = pet.effect === "attack" && enemyAfterHero > 0 ? pet.base + (petLevel - 1) * 3 : 0;
94
- f.enemyHp = Math.max(0, enemyAfterHero - petDamage);
95
- const cycle = f.turn % 5;
96
- const move = !f.boss || cycle === 1 || cycle === 2 ? "strike" : cycle === 3 ? "charge" : cycle === 4 ? "heavy" : "recover";
97
- const playback = { turn: f.turn, boss: f.boss, move, heroBefore, heroAfterImpact: heroBefore, heroAfter: heroBefore, enemyBefore, enemyAfterHero, enemyAfter: f.enemyHp, healed: 0, guarded: pet.effect === "guard", won: false, xp: 0, gold: 0 };
98
- const event = { damage, petDamage, crit, skill, incoming: 0, playback };
99
- if (f.enemyHp === 0) {
100
- f.status = "won";
101
- playback.won = true;
246
+ const m = MAPS[s.map], event = resolveHexRound(definition, s, stats(s), rng), playback = event.playback;
247
+ const dead = playback.cues.filter((c) => c.kind === "death" && c.actor.startsWith("enemy-"));
248
+ for (const cue of dead) {
102
249
  s.kills++;
250
+ let xp = m.xp, gold = m.gold, drop = "";
103
251
  if (f.boss) {
104
252
  s.bossWins++;
105
253
  const first = !s.cleared.includes(s.map);
106
- grant(s, m.xp * (first ? 6 : 2), m.gold * (first ? 8 : 3));
107
- playback.xp = m.xp * (first ? 6 : 2);
108
- playback.gold = m.gold * (first ? 8 : 3);
254
+ xp *= first ? 6 : 2;
255
+ gold *= first ? 8 : 3;
109
256
  s.essence += first ? 50 : 12;
110
257
  if (first) {
111
258
  s.cleared.push(s.map);
112
259
  s.unlocked = Math.min(MAPS.length - 1, Math.max(s.unlocked, s.map + 1));
113
260
  const item = makeGear(m.rewardSlot, 1, s.map, `drop-${s.nextId++}`);
114
261
  addDrop(s, item);
115
- event.reward = item.name;
116
- addLog(s, `\u9996\u901A ${m.boss}\uFF01\u83B7\u5F97 ${item.name}\uFF0C${s.map < MAPS.length - 1 ? "\u65B0\u7684\u897F\u884C\u5730\u56FE\u5DF2\u89E3\u9501\u3002" : "\u5168\u90E8\u7AE0\u8282\u8BD5\u70BC\u5B8C\u6210\uFF01"}`, "rare");
117
- } else
118
- addLog(s, `\u518D\u6B21\u51FB\u8D25 ${m.boss}\uFF0C\u83B7\u5F97\u4FEE\u884C\u5956\u52B1\u3002`, "rare");
262
+ event.reward = drop = item.name;
263
+ addLog(s, `\u9996\u901A ${m.boss}\uFF01\u83B7\u5F97 ${item.name}\u3002`, "rare");
264
+ } else addLog(s, `\u518D\u6B21\u51FB\u8D25 ${m.boss}\uFF0C\u83B7\u5F97\u4FEE\u884C\u5956\u52B1\u3002`, "rare");
119
265
  event.bossWin = true;
120
266
  event.first = first;
121
267
  } else {
122
- grant(s, m.xp, m.gold);
123
- playback.xp = m.xp;
124
- playback.gold = m.gold;
125
268
  s.essence += 2;
126
269
  if (rng() < 0.38) {
127
- const item = makeGear(Object.keys(SLOTS)[Math.min(slotKeys.length - 1, Math.floor(rng() * slotKeys.length))], rng() < 0.12 ? 2 : rng() < 0.45 ? 1 : 0, s.map, `drop-${s.nextId++}`);
270
+ const item = makeGear(slotKeys[Math.min(slotKeys.length - 1, Math.floor(rng() * slotKeys.length))], rng() < 0.12 ? 2 : rng() < 0.45 ? 1 : 0, s.map, `drop-${s.nextId++}`);
128
271
  const kept = addDrop(s, item);
272
+ event.drop = drop = item.name;
129
273
  addLog(s, kept ? `\u62FE\u5F97 ${RARITIES[item.tier]} \xB7 ${item.name}` : "\u80CC\u5305\u5DF2\u6EE1\uFF0C\u65B0\u6389\u843D\u5DF2\u8F6C\u4E3A\u953B\u6750\u3002", "loot");
130
- event.drop = item.name;
131
274
  }
132
275
  }
133
- return event;
134
- }
135
- const incoming = move === "charge" || move === "recover" ? 0 : Math.max(1, Math.round(((f.boss ? m.bossAtk : m.atk) * (move === "heavy" ? 2 : 1) - st.def) * (pet.effect === "guard" ? 0.75 : 1)));
136
- f.hp = Math.max(0, f.hp - incoming);
137
- event.incoming = incoming;
138
- playback.heroAfterImpact = f.hp;
139
- if (pet.effect === "heal" && f.hp > 0) {
140
- playback.healed = Math.min(f.maxHp - f.hp, 7 + petLevel * 3);
141
- f.hp += playback.healed;
142
- }
143
- playback.heroAfter = f.hp;
144
- if (f.hp === 0 || f.turn >= 60) {
145
- f.status = "lost";
146
- event.lost = true;
147
- addLog(s, `${f.boss ? m.boss : m.enemy}\u6311\u6218\u5931\u5229\uFF1A${f.hp === 0 ? "\u6C14\u8840\u8017\u5C3D\uFF0C\u53EF\u5F3A\u5316\u8863\u888D\u6216\u57F9\u517B\u7075\u5BA0\u3002" : "\u8F93\u51FA\u4E0D\u8DB3\uFF0C\u53EF\u66F4\u6362\u6B66\u5668\u3002"}\u4F11\u6574\u540E\u7EE7\u7EED\u3002`, "boss");
276
+ grant(s, xp, gold);
277
+ playback.xp += xp;
278
+ playback.gold += gold;
279
+ playback.cues.push({ at: 0.9, kind: "loot", actor: cue.actor, value: gold, label: drop || `\u7ECF\u9A8C +${xp}` });
148
280
  }
281
+ if (event.lost) addLog(s, "\u5386\u7EC3\u5931\u5229\uFF0C\u4F11\u6574\u540E\u518D\u6218\uFF1B\u53EF\u66F4\u6362\u80FD\u529B\u3001\u88C5\u5907\u6216\u7075\u5BA0\u3002", "boss");
149
282
  return event;
150
283
  }
151
284
  function equip(s, id) {
@@ -221,8 +354,8 @@ function createIdleEngine(definition) {
221
354
  if (!raw || raw.version !== 1 || !Array.isArray(raw.inventory) || !raw.equipment || !raw.pets)
222
355
  throw new Error("\u5B58\u6863\u683C\u5F0F\u4E0D\u6B63\u786E");
223
356
  const s = freshState(now), number = (v, min, max) => typeof v === "number" && Number.isFinite(v) ? Math.max(min, Math.min(max, Math.floor(v))) : min;
224
- for (const key of ["gold", "xp", "essence", "material", "kills", "bossWins", "sessionGold", "sessionXp", "sessionDrops"])
225
- s[key] = number(raw[key], 0, 1e9);
357
+ for (const key2 of ["gold", "xp", "essence", "material", "kills", "bossWins", "sessionGold", "sessionXp", "sessionDrops"])
358
+ s[key2] = number(raw[key2], 0, 1e9);
226
359
  s.level = number(raw.level, 1, 60);
227
360
  s.unlocked = number(raw.unlocked, 0, MAPS.length - 1);
228
361
  s.map = number(raw.map, 0, s.unlocked);
@@ -241,6 +374,10 @@ function createIdleEngine(definition) {
241
374
  if (raw.pets[pet.id])
242
375
  s.pets[pet.id] = number(raw.pets[pet.id], 1, 20);
243
376
  s.pet = Object.hasOwn(s.pets, raw.pet) ? raw.pet : PETS[0].id;
377
+ for (const kind of ["attack", "skill", "power", "treasure"]) {
378
+ const chosen = abilities.find((a) => a.id === raw.loadout?.[kind] && a.kind === kind);
379
+ if (chosen) s.loadout[kind] = chosen.id;
380
+ }
244
381
  return s;
245
382
  }
246
383
  function settleOffline(s, now = Date.now(), rng = Math.random) {
@@ -268,37 +405,356 @@ function createIdleEngine(definition) {
268
405
  }
269
406
 
270
407
  // src/game/components.tsx
271
- import { useRef, useState } from "react";
272
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
408
+ import { useRef as useRef2, useState as useState2 } from "react";
409
+
410
+ // src/game/HexBattlefield.tsx
411
+ import { useEffect, useRef, useState } from "react";
412
+
413
+ // src/game/hex-playback.ts
414
+ function sampleHexPlayback(playback, progress) {
415
+ const t = Math.max(0, Math.min(1, progress)), units = playback.units.map((unit) => ({ ...unit }));
416
+ for (const cue of playback.cues) {
417
+ if (t < cue.at) continue;
418
+ const unit = units.find((u) => u.id === (cue.target ?? cue.actor));
419
+ if (cue.kind === "move" && cue.from && cue.to) {
420
+ const moving = units.find((u) => u.id === cue.actor);
421
+ if (moving) {
422
+ const p = Math.min(1, (t - cue.at) / 0.12), eased = p * p * (3 - 2 * p);
423
+ moving.q = cue.from.q + (cue.to.q - cue.from.q) * eased;
424
+ moving.r = cue.from.r + (cue.to.r - cue.from.r) * eased;
425
+ }
426
+ }
427
+ if (unit && (cue.kind === "hit" || cue.kind === "heal") && cue.hp !== void 0) unit.hp = cue.hp;
428
+ }
429
+ return { units, progress: t };
430
+ }
431
+
432
+ // src/game/HexBattlefield.tsx
433
+ import { jsx, jsxs } from "react/jsx-runtime";
434
+ var images = /* @__PURE__ */ new Map();
435
+ function bitmap(src) {
436
+ let img = images.get(src);
437
+ if (!img) {
438
+ img = new Image();
439
+ img.src = src;
440
+ images.set(src, img);
441
+ }
442
+ return img.complete && img.naturalWidth ? img : null;
443
+ }
444
+ var tilt = Math.SQRT1_2;
445
+ var point = (cell) => ({ x: 450 + 78 * cell.q, y: 304 + Math.sqrt(3) * 52 * (cell.r + cell.q / 2) * tilt });
446
+ function hexPath(ctx, x, y, radius) {
447
+ ctx.beginPath();
448
+ for (let i = 0; i < 6; i++) {
449
+ const a = i * Math.PI / 3, px = x + Math.cos(a) * radius, py = y + Math.sin(a) * radius * tilt;
450
+ if (!i) ctx.moveTo(px, py);
451
+ else ctx.lineTo(px, py);
452
+ }
453
+ ctx.closePath();
454
+ }
455
+ function polygon(ctx, points, color, stroke = "#101a27") {
456
+ ctx.beginPath();
457
+ points.forEach(([x, y], i) => i ? ctx.lineTo(x, y) : ctx.moveTo(x, y));
458
+ ctx.closePath();
459
+ ctx.fillStyle = color;
460
+ ctx.fill();
461
+ ctx.strokeStyle = stroke;
462
+ ctx.lineWidth = 1.5;
463
+ ctx.stroke();
464
+ }
465
+ function tile(ctx, x, y, radius, depth, top, border) {
466
+ const dy = radius * Math.sqrt(3) / 2 * tilt;
467
+ polygon(ctx, [[x - radius, y], [x - radius / 2, y + dy], [x - radius / 2, y + dy + depth], [x - radius, y + depth]], "#182433");
468
+ polygon(ctx, [[x - radius / 2, y + dy], [x + radius / 2, y + dy], [x + radius / 2, y + dy + depth], [x - radius / 2, y + dy + depth]], "#223348");
469
+ polygon(ctx, [[x + radius / 2, y + dy], [x + radius, y], [x + radius, y + depth], [x + radius / 2, y + dy + depth]], "#2b4054");
470
+ hexPath(ctx, x, y, radius);
471
+ ctx.fillStyle = top;
472
+ ctx.fill();
473
+ ctx.strokeStyle = border;
474
+ ctx.lineWidth = 1.5;
475
+ ctx.stroke();
476
+ }
477
+ function text(ctx, value, x, y, color = "#dce9f4", size = 13) {
478
+ ctx.font = `600 ${size}px "Microsoft YaHei",sans-serif`;
479
+ ctx.textAlign = "center";
480
+ ctx.textBaseline = "middle";
481
+ ctx.fillStyle = color;
482
+ ctx.fillText(value, x, y);
483
+ }
484
+ function plate(ctx, value, x, y, color) {
485
+ ctx.font = '12px "Microsoft YaHei",sans-serif';
486
+ const w = ctx.measureText(value).width + 16;
487
+ ctx.fillStyle = "#111d2eef";
488
+ ctx.fillRect(x - w / 2, y - 10, w, 20);
489
+ ctx.strokeStyle = "#435971";
490
+ ctx.strokeRect(x - w / 2, y - 10, w, 20);
491
+ text(ctx, value, x, y, color, 12);
492
+ }
493
+ function GameHexBattlefield({ engine, state, event, sequence = 0 }) {
494
+ const canvas = useRef(null), [phase, setPhase] = useState("\u7B49\u5F85\u51FA\u53D1"), [assetFailed, setAssetFailed] = useState(false), [visibleEnemies, setVisibleEnemies] = useState(0);
495
+ const map = engine.definition.maps[state.map], pet = engine.definition.pets.find((p) => p.id === state.pet);
496
+ const fight = state.fight, boss = Boolean(fight?.boss), duration = engine.definition.turnDurationMs ?? 1e3;
497
+ const reduced = useRef(false);
498
+ useEffect(() => {
499
+ const media = matchMedia("(prefers-reduced-motion: reduce)");
500
+ reduced.current = media.matches;
501
+ const change = () => {
502
+ reduced.current = media.matches;
503
+ };
504
+ media.addEventListener("change", change);
505
+ return () => media.removeEventListener("change", change);
506
+ }, []);
507
+ useEffect(() => {
508
+ const element = canvas.current, ctx = element?.getContext("2d");
509
+ if (!element || !ctx) return;
510
+ let frame = 0, disposed = false, lastPhase = "", lastCount = -1, started = performance.now();
511
+ const replay = event?.playback;
512
+ const idleUnits = fight?.units.map((u) => ({ ...u })) ?? [{ id: "hero", side: "hero", q: 0, r: 0, hp: engine.stats(state).hp, maxHp: engine.stats(state).hp }, { id: "pet", side: "pet", q: -1, r: 1, hp: 1, maxHp: 1 }];
513
+ const roster = (unit) => unit.side === "hero" ? { name: state.name, asset: engine.definition.hero, color: "#8bdcff" } : unit.side === "pet" ? { name: pet.name, asset: pet.art, color: "#8ae2b9" } : { name: boss ? map.boss : map.enemy, asset: boss ? map.bossArt : map.enemyArt, color: boss ? "#efb779" : "#e69386" };
514
+ const assets = [engine.definition.hero.src, pet.art.src, (boss ? map.bossArt : map.enemyArt).src];
515
+ assets.forEach(bitmap);
516
+ const fit = () => {
517
+ const dpr = Math.min(devicePixelRatio || 1, 2);
518
+ element.width = 900 * dpr;
519
+ element.height = 580 * dpr;
520
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
521
+ };
522
+ fit();
523
+ const draw = (now) => {
524
+ if (disposed) return;
525
+ const t = replay ? Math.min(1, (now - started) / duration) : 1, visual = replay ? sampleHexPlayback(replay, t) : { units: idleUnits, progress: t };
526
+ const cues = replay?.cues ?? [], active = cues.filter((c) => t >= c.at && t < c.at + 0.17);
527
+ const count = visual.units.filter((u) => u.side === "enemy" && u.hp > 0).length;
528
+ if (count !== lastCount) {
529
+ lastCount = count;
530
+ setVisibleEnemies(count);
531
+ }
532
+ const phaseLabel = !fight ? "\u7B49\u5F85\u51FA\u53D1 \xB7 \u81EA\u52A8\u5BFB\u654C" : !replay ? fight.status === "won" ? "\u6E05\u7406\u6218\u573A \xB7 \u4E0B\u4E00\u6CE2\u5373\u5C06\u6765\u88AD" : fight.status === "lost" ? "\u6682\u4F5C\u4F11\u6574" : "\u5996\u6C14\u6765\u88AD" : t < 0.18 ? "\u9010\u683C\u63A5\u8FD1 \xB7 \u81EA\u52A8\u5BFB\u654C" : t < 0.35 ? "\u51C6\u5907\u51FA\u624B" : t < 0.55 ? "\u547D\u4E2D \xB7 \u8FFD\u51FB" : t < 0.78 ? replay.move === "charge" ? `${map.boss}\u6B63\u5728\u84C4\u529B` : replay.move === "recover" ? "\u9996\u9886\u5598\u606F" : "\u654C\u65B9\u884C\u52A8" : t < 0.88 ? "\u7075\u5BA0\u652F\u63F4" : replay.gold ? "\u62FE\u53D6\u6218\u5229\u54C1" : "\u56DE\u5408\u7ED3\u675F";
533
+ if (phaseLabel !== lastPhase) {
534
+ lastPhase = phaseLabel;
535
+ setPhase(phaseLabel);
536
+ }
537
+ ctx.clearRect(0, 0, 900, 580);
538
+ ctx.fillStyle = "#111d2a";
539
+ ctx.fillRect(0, 0, 900, 580);
540
+ polygon(ctx, [[0, 100], [92, 62], [145, 113], [178, 79], [235, 130], [0, 215]], "#1a3040", "#253c4c");
541
+ polygon(ctx, [[900, 80], [803, 112], [751, 60], [720, 136], [665, 161], [900, 202]], "#1b3240", "#2b4654");
542
+ polygon(ctx, [[0, 499], [122, 447], [173, 494], [236, 475], [282, 580], [0, 580]], "#1a2c38", "#2a4250");
543
+ polygon(ctx, [[900, 459], [824, 428], [778, 474], [716, 465], [663, 580], [900, 580]], "#192c39", "#2b4253");
544
+ const cells = gameHexCells().sort((a, b) => point(a).y - point(b).y);
545
+ for (const cell of cells) {
546
+ const p = point(cell), edge = hexDistance(cell, { q: 0, r: 0 }) === 3, occupied = visual.units.find((u) => u.hp > 0 && hexDistance(u, cell) < 0.1);
547
+ const color = occupied?.side === "hero" ? "#314b61" : occupied?.side === "enemy" ? "#493b3b" : (cell.q - cell.r + 12) % 3 === 0 ? "#304554" : "#2a3c4b";
548
+ tile(ctx, p.x, p.y, 50, 8, color, edge ? "#53666c" : "#465d70");
549
+ if (edge) {
550
+ text(ctx, "\xB7", p.x, p.y, "#9caa91", 20);
551
+ }
552
+ }
553
+ for (const cue of cues.filter((c) => c.kind === "move" && c.from && c.to && t >= c.at && t < c.at + 0.2)) {
554
+ const a = point(cue.from), b = point(cue.to);
555
+ ctx.beginPath();
556
+ ctx.moveTo(a.x, a.y);
557
+ ctx.lineTo(b.x, b.y);
558
+ ctx.strokeStyle = cue.actor.startsWith("enemy") ? "#bd766b" : "#6bbddd";
559
+ ctx.lineWidth = 3;
560
+ ctx.setLineDash([5, 5]);
561
+ ctx.stroke();
562
+ ctx.setLineDash([]);
563
+ }
564
+ const ordered = [...visual.units].sort((a, b) => point(a).y - point(b).y);
565
+ for (const unit of ordered) {
566
+ const spawn = cues.find((c) => c.kind === "spawn" && c.actor === unit.id);
567
+ if (spawn && t < spawn.at) continue;
568
+ const dead = cues.find((c) => c.kind === "death" && c.actor === unit.id);
569
+ if (unit.hp === 0 && (!dead || t > dead.at + 0.1)) continue;
570
+ const p = point(unit), info = roster(unit), hit = active.find((c) => c.kind === "hit" && c.target === unit.id), cast = active.find((c) => c.kind === "cast" && c.actor === unit.id), heal = active.find((c) => c.kind === "heal" && c.target === unit.id);
571
+ let x = p.x, y = p.y - 15;
572
+ if (!reduced.current && hit) x += Math.sin((t - hit.at) * 110) * 5;
573
+ if (!reduced.current && cast) y -= Math.sin(Math.min(1, (t - cast.at) / 0.15) * Math.PI) * 8;
574
+ ctx.save();
575
+ if (dead && t >= dead.at) ctx.globalAlpha = Math.max(0, 1 - (t - dead.at) / 0.1);
576
+ const radius = boss && unit.side === "enemy" ? 50 : 44;
577
+ tile(ctx, x, y, radius, 15, unit.side === "hero" ? "#355771" : unit.side === "pet" ? "#2f554b" : "#674b42", heal ? "#96f5c2" : hit ? "#ffe2be" : info.color);
578
+ ctx.save();
579
+ hexPath(ctx, x, y, radius - 4);
580
+ ctx.clip();
581
+ ctx.translate(x, y);
582
+ ctx.scale(info.asset.flip ? -1 : 1, tilt);
583
+ const img = bitmap(info.asset.src);
584
+ if (img) {
585
+ const crop = Math.min(img.naturalWidth, img.naturalHeight * 0.76);
586
+ ctx.drawImage(img, (img.naturalWidth - crop) / 2, 0, crop, crop, -radius, -radius, radius * 2, radius * 2);
587
+ } else {
588
+ text(ctx, info.name.slice(0, 2), 0, 0, info.color, 20);
589
+ if (images.get(info.asset.src)?.complete) setAssetFailed(true);
590
+ }
591
+ ctx.restore();
592
+ hexPath(ctx, x, y, radius - 3);
593
+ ctx.strokeStyle = info.color;
594
+ ctx.lineWidth = 2;
595
+ ctx.stroke();
596
+ if (hit) {
597
+ hexPath(ctx, x, y, radius);
598
+ ctx.strokeStyle = "#fff3c4";
599
+ ctx.lineWidth = 4;
600
+ ctx.stroke();
601
+ for (let ray = 0; ray < 6; ray++) {
602
+ const angle = ray * Math.PI / 3;
603
+ ctx.beginPath();
604
+ ctx.moveTo(x + Math.cos(angle) * (radius + 3), y + Math.sin(angle) * (radius + 3) * tilt);
605
+ ctx.lineTo(x + Math.cos(angle) * (radius + 12), y + Math.sin(angle) * (radius + 12) * tilt);
606
+ ctx.stroke();
607
+ }
608
+ }
609
+ if (heal) {
610
+ hexPath(ctx, x, y, radius + 5);
611
+ ctx.strokeStyle = "#8ee9b2";
612
+ ctx.lineWidth = 3;
613
+ ctx.stroke();
614
+ }
615
+ if (replay?.guarded && unit.side === "hero") {
616
+ hexPath(ctx, x, y, radius + 5);
617
+ ctx.strokeStyle = "#97bde5";
618
+ ctx.lineWidth = 2;
619
+ ctx.stroke();
620
+ }
621
+ if (boss && unit.side === "enemy" && replay?.move === "charge") {
622
+ hexPath(ctx, x, y, radius + 8);
623
+ ctx.strokeStyle = "#f3aa68";
624
+ ctx.lineWidth = 3;
625
+ ctx.stroke();
626
+ }
627
+ const nameY = p.y + 43;
628
+ plate(ctx, info.name, x, nameY, info.color);
629
+ if (unit.side !== "pet") {
630
+ ctx.fillStyle = "#101723";
631
+ ctx.fillRect(x - 31, nameY + 14, 62, 5);
632
+ ctx.fillStyle = unit.side === "hero" ? "#7ac7d9" : "#d58270";
633
+ ctx.fillRect(x - 31, nameY + 14, 62 * Math.max(0, unit.hp / unit.maxHp), 5);
634
+ text(ctx, `${unit.hp}/${unit.maxHp}`, x, nameY + 29, "#c5d4e4", 10);
635
+ }
636
+ ctx.restore();
637
+ }
638
+ for (const cue of active) {
639
+ const source = visual.units.find((u) => u.id === cue.actor), target = visual.units.find((u) => u.id === cue.target);
640
+ if (!source) continue;
641
+ const a = point(source), b = target ? point(target) : a;
642
+ if (cue.kind === "cast" && target) {
643
+ const impact = cues.find((c) => c.kind === "hit" && c.actor === cue.actor && c.target === cue.target && c.at > cue.at);
644
+ const p = Math.min(1, (t - cue.at) / Math.max(0.02, (impact?.at ?? cue.at + 0.14) - cue.at));
645
+ const x = a.x + (b.x - a.x) * p, y = a.y + (b.y - a.y) * p - 25;
646
+ tile(ctx, x, y, 9, 3, cue.actor.startsWith("enemy") ? "#d19a75" : "#e3c37e", "#f4e3b7");
647
+ plate(ctx, cue.label ?? "\u51FA\u624B", a.x, a.y - 69, cue.actor.startsWith("enemy") ? "#f1ba91" : "#ead694");
648
+ }
649
+ if (cue.kind === "heal" && target) {
650
+ ctx.strokeStyle = "#7ce3ad";
651
+ ctx.lineWidth = 3;
652
+ ctx.beginPath();
653
+ ctx.moveTo(a.x, a.y - 20);
654
+ ctx.lineTo(b.x, b.y - 20);
655
+ ctx.stroke();
656
+ hexPath(ctx, b.x, b.y - 15, 53);
657
+ ctx.stroke();
658
+ }
659
+ if (cue.kind === "shield") {
660
+ hexPath(ctx, a.x, a.y - 15, 55);
661
+ ctx.strokeStyle = "#a7d7fa";
662
+ ctx.lineWidth = 3;
663
+ ctx.stroke();
664
+ }
665
+ if (cue.kind === "hit" || cue.kind === "heal") {
666
+ const y = b.y - 63 - (reduced.current ? 0 : (t - cue.at) * 70);
667
+ ctx.strokeStyle = "#102034";
668
+ ctx.lineWidth = 4;
669
+ ctx.font = "bold 20px sans-serif";
670
+ ctx.textAlign = "center";
671
+ const label = `${cue.kind === "heal" ? "+" : "\u2212"}${cue.value}`;
672
+ ctx.strokeText(label, b.x, y);
673
+ text(ctx, label, b.x, y, cue.kind === "heal" ? "#9bffd0" : cue.actor.startsWith("enemy") ? "#ffc0a3" : "#ffe39c", 20);
674
+ }
675
+ }
676
+ for (const cue of cues.filter((c) => c.kind === "loot" && t >= c.at)) {
677
+ const unit = visual.units.find((u) => u.id === cue.actor);
678
+ if (!unit) continue;
679
+ const p = point(unit);
680
+ tile(ctx, p.x, p.y - 9, 15, 5, "#d8b65e", "#ffdf92");
681
+ text(ctx, "\u94B1", p.x, p.y - 9, "#49391d", 11);
682
+ plate(ctx, `+${cue.value} \u94DC\u94B1`, p.x, p.y + 25, "#f4d18c");
683
+ text(ctx, cue.label ?? "", p.x, p.y + 47, "#d6dbe0", 11);
684
+ }
685
+ text(ctx, `${map.name} \xB7 \u68CB\u5883`, 100, 31, "#c6bb95", 17);
686
+ text(ctx, "\u516D\u65B9\u6765\u654C \xB7 \u81EA\u52A8\u8FCE\u6218", 777, 31, "#8aa7bd", 12);
687
+ if (t < 1 || assets.some((src) => !images.get(src)?.complete)) frame = requestAnimationFrame(draw);
688
+ };
689
+ frame = requestAnimationFrame(draw);
690
+ const resume = () => {
691
+ if (!document.hidden) {
692
+ cancelAnimationFrame(frame);
693
+ frame = requestAnimationFrame(draw);
694
+ }
695
+ };
696
+ document.addEventListener("visibilitychange", resume);
697
+ return () => {
698
+ disposed = true;
699
+ cancelAnimationFrame(frame);
700
+ document.removeEventListener("visibilitychange", resume);
701
+ };
702
+ }, [engine, state, event, sequence, fight, map, pet, duration, boss]);
703
+ return /* @__PURE__ */ jsxs("section", { className: "hex-battlefield", "aria-label": "\u516D\u8FB9\u5F62\u81EA\u52A8\u6218\u573A", children: [
704
+ /* @__PURE__ */ jsxs("div", { className: "hex-stage-head", children: [
705
+ /* @__PURE__ */ jsx("span", { children: boss ? "\u9996\u9886\u73B0\u8EAB \xB7 \u5C0F\u5996\u5DF2\u6E05\u9000" : "\u516D\u65B9\u6765\u654C \xB7 \u9010\u683C\u63A5\u8FD1" }),
706
+ /* @__PURE__ */ jsxs("span", { children: [
707
+ "\u7B2C ",
708
+ fight?.turn ?? 0,
709
+ " \u56DE\u5408 \xB7 \u654C\u65B9 ",
710
+ visibleEnemies
711
+ ] })
712
+ ] }),
713
+ /* @__PURE__ */ jsx("canvas", { ref: canvas, className: "hex-canvas", role: "img", "aria-label": `${map.name}\uFF0C45\u5EA6\u4FEF\u89C6\u516D\u8FB9\u5F62\u68CB\u76D8\uFF0C${state.name}\u4E0E${pet.name}\u81EA\u52A8\u8FCE\u6218${boss ? map.boss : "\u56DB\u65B9\u5C0F\u5996"}` }),
714
+ boss && /* @__PURE__ */ jsxs("div", { className: `hex-boss-intent ${event?.playback?.move === "charge" ? "charging" : ""}`, children: [
715
+ /* @__PURE__ */ jsx("span", { children: map.boss }),
716
+ /* @__PURE__ */ jsx("b", { children: event?.playback?.move === "charge" ? `\u84C4\u529B \xB7 \u4E0B\u56DE\u5408${map.bossSkillName ?? "\u91CD\u51FB"}` : event?.playback?.move === "heavy" ? map.bossSkillName ?? "\u91CD\u51FB" : event?.playback?.move === "recover" ? "\u5598\u606F \xB7 \u672C\u56DE\u5408\u4E0D\u653B\u51FB" : "\u903C\u8FD1 \xB7 \u8FD1\u8EAB\u6325\u780D" }),
717
+ /* @__PURE__ */ jsx("span", { children: "\u6325\u780D \u2192 \u84C4\u529B \u2192 \u91CD\u65A9 \u2192 \u5598\u606F" })
718
+ ] }),
719
+ /* @__PURE__ */ jsxs("div", { className: "hex-stage-foot", children: [
720
+ /* @__PURE__ */ jsx("span", { children: phase }),
721
+ /* @__PURE__ */ jsx("span", { children: "\u9752 \xB7 \u73A9\u5BB6\u3000\u7EFF \xB7 \u7075\u5BA0\u3000\u8D64 \xB7 \u5996\u602A" })
722
+ ] }),
723
+ assetFailed && /* @__PURE__ */ jsx("p", { className: "hex-asset-warning", children: "\u90E8\u5206\u8D34\u56FE\u52A0\u8F7D\u5931\u8D25\uFF0C\u6682\u4EE5\u5355\u4F4D\u540D\u6807\u8BC6\u68CB\u5B50\u3002" })
724
+ ] });
725
+ }
726
+
727
+ // src/game/components.tsx
728
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
273
729
  function GameSprite({ asset, className = "" }) {
274
- return /* @__PURE__ */ jsx("img", { className: `unit-art ${asset.flip ? "face-left" : ""} ${className}`, src: asset.src, alt: "", "aria-hidden": "true", draggable: false, decoding: "async" });
730
+ return /* @__PURE__ */ jsx2("img", { className: `unit-art ${asset.flip ? "face-left" : ""} ${className}`, src: asset.src, alt: "", "aria-hidden": "true", draggable: false, decoding: "async" });
275
731
  }
276
732
  function GameButton({ className = "", ...props }) {
277
- return /* @__PURE__ */ jsx(Button, { ...props, className: `game-button ${className}` });
733
+ return /* @__PURE__ */ jsx2(Button, { ...props, className: `game-button ${className}` });
278
734
  }
279
735
  var fmt = (n) => Math.floor(n).toLocaleString("zh-CN");
280
736
  var busy = (s) => Boolean(s.fight?.boss && s.fight.status === "active");
281
737
  var command = (fn, type, id) => () => fn({ type, id });
282
738
  function Title({ kicker, title, children }) {
283
- return /* @__PURE__ */ jsxs("div", { className: "view-title", children: [
284
- /* @__PURE__ */ jsxs("div", { children: [
285
- /* @__PURE__ */ jsx("span", { className: "eyebrow", children: kicker }),
286
- /* @__PURE__ */ jsx("h1", { children: title })
739
+ return /* @__PURE__ */ jsxs2("div", { className: "view-title", children: [
740
+ /* @__PURE__ */ jsxs2("div", { children: [
741
+ /* @__PURE__ */ jsx2("span", { className: "eyebrow", children: kicker }),
742
+ /* @__PURE__ */ jsx2("h1", { children: title })
287
743
  ] }),
288
744
  children
289
745
  ] });
290
746
  }
291
747
  function ItemStats({ item }) {
292
- return /* @__PURE__ */ jsxs("div", { className: "item-stats", children: [
293
- /* @__PURE__ */ jsxs("span", { children: [
748
+ return /* @__PURE__ */ jsxs2("div", { className: "item-stats", children: [
749
+ /* @__PURE__ */ jsxs2("span", { children: [
294
750
  "\u653B\u51FB +",
295
751
  item.atk
296
752
  ] }),
297
- /* @__PURE__ */ jsxs("span", { children: [
753
+ /* @__PURE__ */ jsxs2("span", { children: [
298
754
  "\u9632\u5FA1 +",
299
755
  item.def
300
756
  ] }),
301
- /* @__PURE__ */ jsxs("span", { children: [
757
+ /* @__PURE__ */ jsxs2("span", { children: [
302
758
  "\u6C14\u8840 +",
303
759
  item.hp
304
760
  ] })
@@ -306,203 +762,158 @@ function ItemStats({ item }) {
306
762
  }
307
763
  function GameShell({ engine, state, onAction, page, children }) {
308
764
  const d = engine.definition, view = { engine, state, onAction };
309
- return /* @__PURE__ */ jsxs(Fragment, { children: [
310
- /* @__PURE__ */ jsxs("header", { className: "topbar", children: [
311
- /* @__PURE__ */ jsxs("div", { className: "brand", children: [
312
- /* @__PURE__ */ jsx("span", { className: "brand-seal", children: d.title[0] }),
313
- /* @__PURE__ */ jsxs("span", { className: "brand-title", children: [
765
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
766
+ /* @__PURE__ */ jsxs2("header", { className: "topbar", children: [
767
+ /* @__PURE__ */ jsxs2("div", { className: "brand", children: [
768
+ /* @__PURE__ */ jsx2("span", { className: "brand-seal", children: d.title[0] }),
769
+ /* @__PURE__ */ jsxs2("span", { className: "brand-title", children: [
314
770
  d.title,
315
- /* @__PURE__ */ jsx("small", { children: d.subtitle })
771
+ /* @__PURE__ */ jsx2("small", { children: d.subtitle })
316
772
  ] })
317
773
  ] }),
318
- /* @__PURE__ */ jsxs("div", { className: "realm", children: [
319
- /* @__PURE__ */ jsx("span", { className: "live-dot" }),
774
+ /* @__PURE__ */ jsxs2("div", { className: "realm", children: [
775
+ /* @__PURE__ */ jsx2("span", { className: "live-dot" }),
320
776
  "\u5355\u4EBA\u4FEE\u884C / \u653E\u7F6E\u5386\u7EC3"
321
777
  ] }),
322
- /* @__PURE__ */ jsxs("div", { className: "top-actions", children: [
323
- /* @__PURE__ */ jsx("span", { className: "version", children: "Sia Game \xB7 v0.3" }),
324
- /* @__PURE__ */ jsx(GameButton, { className: "icon-button", "aria-label": "\u8BBE\u7F6E\u4E0E\u5B58\u6863", onClick: command(onAction, "settings"), children: "\u2699" })
778
+ /* @__PURE__ */ jsxs2("div", { className: "top-actions", children: [
779
+ /* @__PURE__ */ jsx2("span", { className: "version", children: "Sia Game \xB7 v0.3" }),
780
+ /* @__PURE__ */ jsx2(GameButton, { className: "icon-button", "aria-label": "\u8BBE\u7F6E\u4E0E\u5B58\u6863", onClick: command(onAction, "settings"), children: "\u2699" })
325
781
  ] })
326
782
  ] }),
327
- /* @__PURE__ */ jsxs("nav", { className: "navigation", "aria-label": "\u4E3B\u5BFC\u822A", children: [
328
- [["battle", "\u2694", "\u6302\u673A\u5386\u7EC3"], ["maps", "\u25A7", "\u4E16\u754C\u5730\u56FE"], ["gear", "\u25A3", "\u88C5\u5907\u80CC\u5305"], ["pets", "\u2667", "\u4F19\u4F34\u56FE\u9274"]].map(([id, icon, text]) => /* @__PURE__ */ jsxs(GameButton, { className: `nav-item ${page === id ? "active" : ""}`, "aria-current": page === id ? "page" : void 0, onClick: command(onAction, "page", id), children: [
329
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: icon }),
330
- d.labels?.[id] || text,
331
- id === "gear" && /* @__PURE__ */ jsx("span", { className: "nav-count", children: state.inventory.length })
783
+ /* @__PURE__ */ jsxs2("nav", { className: "navigation", "aria-label": "\u4E3B\u5BFC\u822A", children: [
784
+ [["battle", "\u2694", "\u6302\u673A\u5386\u7EC3"], ["maps", "\u25A7", "\u4E16\u754C\u5730\u56FE"], ["gear", "\u25A3", "\u88C5\u5907\u80CC\u5305"], ["pets", "\u2667", "\u4F19\u4F34\u56FE\u9274"]].map(([id, icon, text2]) => /* @__PURE__ */ jsxs2(GameButton, { className: `nav-item ${page === id ? "active" : ""}`, "aria-current": page === id ? "page" : void 0, onClick: command(onAction, "page", id), children: [
785
+ /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", children: icon }),
786
+ d.labels?.[id] || text2,
787
+ id === "gear" && /* @__PURE__ */ jsx2("span", { className: "nav-count", children: state.inventory.length })
332
788
  ] }, id)),
333
- /* @__PURE__ */ jsx("span", { className: "nav-verse", children: d.subtitle })
789
+ /* @__PURE__ */ jsx2("span", { className: "nav-verse", children: d.subtitle })
334
790
  ] }),
335
- /* @__PURE__ */ jsxs("div", { className: "workspace", children: [
336
- /* @__PURE__ */ jsx("aside", { className: "character-panel", children: /* @__PURE__ */ jsx(GameCharacterPanel, { ...view }) }),
337
- /* @__PURE__ */ jsx("main", { children }),
338
- /* @__PURE__ */ jsxs("aside", { className: "right-panel", children: [
339
- /* @__PURE__ */ jsx(GameBossPanel, { ...view }),
340
- /* @__PURE__ */ jsx(GameLogPanel, { ...view }),
341
- /* @__PURE__ */ jsxs("div", { className: "save-state", children: [
791
+ /* @__PURE__ */ jsxs2("div", { className: "workspace", children: [
792
+ /* @__PURE__ */ jsx2("aside", { className: "character-panel", children: /* @__PURE__ */ jsx2(GameCharacterPanel, { ...view }) }),
793
+ /* @__PURE__ */ jsx2("main", { children }),
794
+ /* @__PURE__ */ jsxs2("aside", { className: "right-panel", children: [
795
+ /* @__PURE__ */ jsx2(GameBossPanel, { ...view }),
796
+ /* @__PURE__ */ jsx2(GameLogPanel, { ...view }),
797
+ /* @__PURE__ */ jsxs2("div", { className: "save-state", children: [
342
798
  "\u672C\u5730\u81EA\u52A8\u5B58\u6863 \xB7 \u79BB\u7EBF\u4E0A\u9650 ",
343
799
  (d.offlineCapSeconds ?? 43200) / 3600,
344
800
  " \u5C0F\u65F6"
345
801
  ] })
346
802
  ] })
347
803
  ] }),
348
- /* @__PURE__ */ jsxs("footer", { children: [
804
+ /* @__PURE__ */ jsxs2("footer", { children: [
349
805
  d.title,
350
806
  " / ",
351
807
  d.subtitle,
352
- /* @__PURE__ */ jsx("span", { children: "\u7531 SiaWebUI Game Framework \u9A71\u52A8" })
808
+ /* @__PURE__ */ jsx2("span", { children: "\u7531 SiaWebUI Game Framework \u9A71\u52A8" })
353
809
  ] })
354
810
  ] });
355
811
  }
356
812
  function GameCharacterPanel({ engine, state: s, onAction }) {
357
813
  const d = engine.definition, st = engine.stats(s), pet = d.pets.find((p) => p.id === s.pet);
358
- return /* @__PURE__ */ jsxs(Fragment, { children: [
359
- /* @__PURE__ */ jsxs("div", { className: "profile-top", children: [
360
- /* @__PURE__ */ jsx("div", { className: "avatar", children: /* @__PURE__ */ jsx(GameSprite, { asset: d.hero }) }),
361
- /* @__PURE__ */ jsxs("div", { children: [
362
- /* @__PURE__ */ jsx("span", { className: "eyebrow", children: d.hero.identity }),
363
- /* @__PURE__ */ jsx("h2", { children: s.name }),
364
- /* @__PURE__ */ jsxs("span", { className: "level-tag", children: [
814
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
815
+ /* @__PURE__ */ jsxs2("div", { className: "profile-top", children: [
816
+ /* @__PURE__ */ jsx2("div", { className: "avatar", children: /* @__PURE__ */ jsx2(GameSprite, { asset: d.hero }) }),
817
+ /* @__PURE__ */ jsxs2("div", { children: [
818
+ /* @__PURE__ */ jsx2("span", { className: "eyebrow", children: d.hero.identity }),
819
+ /* @__PURE__ */ jsx2("h2", { children: s.name }),
820
+ /* @__PURE__ */ jsxs2("span", { className: "level-tag", children: [
365
821
  "Lv.",
366
822
  s.level,
367
823
  " ",
368
- /* @__PURE__ */ jsx("span", { children: "\u4FEE\u884C\u8005" })
824
+ /* @__PURE__ */ jsx2("span", { children: "\u4FEE\u884C\u8005" })
369
825
  ] })
370
826
  ] })
371
827
  ] }),
372
- /* @__PURE__ */ jsxs("div", { className: "power", children: [
373
- /* @__PURE__ */ jsx("span", { children: "\u7EFC\u5408\u6218\u529B" }),
374
- /* @__PURE__ */ jsx("strong", { children: fmt(st.power) })
828
+ /* @__PURE__ */ jsxs2("div", { className: "power", children: [
829
+ /* @__PURE__ */ jsx2("span", { children: "\u7EFC\u5408\u6218\u529B" }),
830
+ /* @__PURE__ */ jsx2("strong", { children: fmt(st.power) })
375
831
  ] }),
376
- /* @__PURE__ */ jsxs("div", { className: "experience", children: [
377
- /* @__PURE__ */ jsxs("div", { children: [
378
- /* @__PURE__ */ jsx("span", { children: "\u4FEE\u884C\u7ECF\u9A8C" }),
379
- /* @__PURE__ */ jsxs("span", { children: [
832
+ /* @__PURE__ */ jsxs2("div", { className: "experience", children: [
833
+ /* @__PURE__ */ jsxs2("div", { children: [
834
+ /* @__PURE__ */ jsx2("span", { children: "\u4FEE\u884C\u7ECF\u9A8C" }),
835
+ /* @__PURE__ */ jsxs2("span", { children: [
380
836
  fmt(s.xp),
381
837
  " / ",
382
838
  engine.xpNeeded(s)
383
839
  ] })
384
840
  ] }),
385
- /* @__PURE__ */ jsx("div", { className: "progress", role: "progressbar", "aria-label": "\u4FEE\u884C\u7ECF\u9A8C", "aria-valuenow": s.xp, "aria-valuemin": 0, "aria-valuemax": engine.xpNeeded(s), children: /* @__PURE__ */ jsx("i", { style: { width: `${Math.min(100, s.xp / engine.xpNeeded(s) * 100)}%` } }) })
841
+ /* @__PURE__ */ jsx2("div", { className: "progress", role: "progressbar", "aria-label": "\u4FEE\u884C\u7ECF\u9A8C", "aria-valuenow": s.xp, "aria-valuemin": 0, "aria-valuemax": engine.xpNeeded(s), children: /* @__PURE__ */ jsx2("i", { style: { width: `${Math.min(100, s.xp / engine.xpNeeded(s) * 100)}%` } }) })
386
842
  ] }),
387
- /* @__PURE__ */ jsx("div", { className: "attributes", children: [["\u6C14\u8840", st.hp], ["\u653B\u51FB", st.atk], ["\u9632\u5FA1", st.def], ["\u66B4\u51FB", "13%"]].map(([name, value]) => /* @__PURE__ */ jsxs("div", { children: [
388
- /* @__PURE__ */ jsx("span", { children: name }),
389
- /* @__PURE__ */ jsx("b", { children: value })
843
+ /* @__PURE__ */ jsx2("div", { className: "attributes", children: [["\u6C14\u8840", st.hp], ["\u653B\u51FB", st.atk], ["\u9632\u5FA1", st.def], ["\u66B4\u51FB", "13%"]].map(([name, value]) => /* @__PURE__ */ jsxs2("div", { children: [
844
+ /* @__PURE__ */ jsx2("span", { children: name }),
845
+ /* @__PURE__ */ jsx2("b", { children: value })
390
846
  ] }, name)) }),
391
- /* @__PURE__ */ jsx("div", { className: "line-heading", children: "\u968F\u8EAB\u8D44\u8D22" }),
392
- /* @__PURE__ */ jsx("div", { className: "wallet", children: [["\u94DC\u94B1", s.gold], ["\u7075\u8574", s.essence], ["\u953B\u6750", s.material]].map(([name, value]) => /* @__PURE__ */ jsxs("div", { children: [
393
- /* @__PURE__ */ jsx("span", { children: name }),
394
- /* @__PURE__ */ jsx("b", { children: fmt(Number(value)) })
847
+ /* @__PURE__ */ jsx2("div", { className: "line-heading", children: "\u968F\u8EAB\u8D44\u8D22" }),
848
+ /* @__PURE__ */ jsx2("div", { className: "wallet", children: [["\u94DC\u94B1", s.gold], ["\u7075\u8574", s.essence], ["\u953B\u6750", s.material]].map(([name, value]) => /* @__PURE__ */ jsxs2("div", { children: [
849
+ /* @__PURE__ */ jsx2("span", { children: name }),
850
+ /* @__PURE__ */ jsx2("b", { children: fmt(Number(value)) })
395
851
  ] }, name)) }),
396
- /* @__PURE__ */ jsxs("div", { className: "line-heading", children: [
397
- /* @__PURE__ */ jsx("span", { children: "\u8EAB\u4E0A\u88C5\u5907" }),
398
- /* @__PURE__ */ jsx(GameButton, { className: "text-button", onClick: command(onAction, "page", "gear"), children: "\u7BA1\u7406 \u203A" })
852
+ /* @__PURE__ */ jsxs2("div", { className: "line-heading", children: [
853
+ /* @__PURE__ */ jsx2("span", { children: "\u8EAB\u4E0A\u88C5\u5907" }),
854
+ /* @__PURE__ */ jsx2(GameButton, { className: "text-button", onClick: command(onAction, "page", "gear"), children: "\u7BA1\u7406 \u203A" })
399
855
  ] }),
400
- /* @__PURE__ */ jsx("div", { className: "equipped-list", children: Object.entries(d.slots).map(([key, slot]) => /* @__PURE__ */ jsxs(GameButton, { className: "equipped-item", onClick: command(onAction, "page", "gear"), children: [
401
- /* @__PURE__ */ jsx("span", { className: "slot-symbol", children: "\u25C7" }),
402
- /* @__PURE__ */ jsxs("span", { children: [
403
- /* @__PURE__ */ jsx("small", { children: slot.name }),
404
- /* @__PURE__ */ jsx("b", { children: s.equipment[key]?.name || "\u5C1A\u672A\u88C5\u5907" })
856
+ /* @__PURE__ */ jsx2("div", { className: "equipped-list", children: Object.entries(d.slots).map(([key2, slot]) => /* @__PURE__ */ jsxs2(GameButton, { className: "equipped-item", onClick: command(onAction, "page", "gear"), children: [
857
+ /* @__PURE__ */ jsx2("span", { className: "slot-symbol", children: "\u25C7" }),
858
+ /* @__PURE__ */ jsxs2("span", { children: [
859
+ /* @__PURE__ */ jsx2("small", { children: slot.name }),
860
+ /* @__PURE__ */ jsx2("b", { children: s.equipment[key2]?.name || "\u5C1A\u672A\u88C5\u5907" })
405
861
  ] }),
406
- /* @__PURE__ */ jsx("em", { children: s.upgrades[key] ? `+${s.upgrades[key]}` : "\u203A" })
407
- ] }, key)) }),
408
- /* @__PURE__ */ jsxs(GameButton, { className: "pet-mini", onClick: command(onAction, "page", "pets"), children: [
409
- /* @__PURE__ */ jsx("span", { className: "pet-mini-art", children: /* @__PURE__ */ jsx(GameSprite, { asset: pet.art }) }),
410
- /* @__PURE__ */ jsxs("span", { children: [
411
- /* @__PURE__ */ jsx("small", { children: "\u51FA\u6218\u7075\u5BA0" }),
412
- /* @__PURE__ */ jsxs("b", { children: [
862
+ /* @__PURE__ */ jsx2("em", { children: s.upgrades[key2] ? `+${s.upgrades[key2]}` : "\u203A" })
863
+ ] }, key2)) }),
864
+ /* @__PURE__ */ jsxs2(GameButton, { className: "pet-mini", onClick: command(onAction, "page", "pets"), children: [
865
+ /* @__PURE__ */ jsx2("span", { className: "pet-mini-art", children: /* @__PURE__ */ jsx2(GameSprite, { asset: pet.art }) }),
866
+ /* @__PURE__ */ jsxs2("span", { children: [
867
+ /* @__PURE__ */ jsx2("small", { children: "\u51FA\u6218\u7075\u5BA0" }),
868
+ /* @__PURE__ */ jsxs2("b", { children: [
413
869
  pet.name,
414
870
  " ",
415
- /* @__PURE__ */ jsxs("em", { children: [
871
+ /* @__PURE__ */ jsxs2("em", { children: [
416
872
  "Lv.",
417
873
  s.pets[s.pet]
418
874
  ] })
419
875
  ] })
420
876
  ] })
421
877
  ] }),
422
- /* @__PURE__ */ jsx("div", { className: "character-bottom", children: s.idle ? "\u25CF \u6B63\u5728\u6302\u673A\u4FEE\u884C" : "\u25CB \u95F2\u5EAD\u4FE1\u6B65 \xB7 \u7B49\u5F85\u5386\u7EC3" })
878
+ /* @__PURE__ */ jsx2("div", { className: "character-bottom", children: s.idle ? "\u25CF \u6B63\u5728\u6302\u673A\u4FEE\u884C" : "\u25CB \u95F2\u5EAD\u4FE1\u6B65 \xB7 \u7B49\u5F85\u5386\u7EC3" })
423
879
  ] });
424
880
  }
425
881
  function GameBattleStage({ engine, state: s, onAction, event, sequence = 0 }) {
426
- const d = engine.definition, m = d.maps[s.map], f = s.fight, st = engine.stats(s), isBoss = Boolean(f?.boss), pet = d.pets.find((p) => p.id === s.pet);
427
- const units = [{ side: "hero", name: s.name, identity: d.hero.identity, asset: d.hero, hp: f?.hp ?? st.hp, max: f?.maxHp ?? st.hp, damage: event?.incoming }, { side: "enemy", name: isBoss ? `\u5996\u738B \xB7 ${m.boss}` : m.enemy, identity: (isBoss ? m.bossArt : m.enemyArt).identity, asset: isBoss ? m.bossArt : m.enemyArt, hp: f?.enemyHp ?? m.hp, max: f?.enemyMax ?? m.hp, damage: event ? event.damage + event.petDamage : 0 }];
428
- return /* @__PURE__ */ jsxs(Fragment, { children: [
429
- /* @__PURE__ */ jsx(Title, { kicker: `\u897F\u884C\u5386\u7EC3 / \u7B2C ${s.map + 1} \u7AE0`, title: m.name, children: /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", disabled: busy(s), onClick: command(onAction, "page", "maps"), children: "\u25A7 \u5207\u6362\u5730\u56FE" }) }),
430
- /* @__PURE__ */ jsxs("div", { className: `scene ${isBoss ? "boss-fight" : ""}`, children: [
431
- /* @__PURE__ */ jsx("div", { className: "scene-art", children: /* @__PURE__ */ jsx("img", { className: "landscape", src: m.scene, alt: "" }) }),
432
- /* @__PURE__ */ jsxs("div", { className: "scene-top", children: [
433
- /* @__PURE__ */ jsxs("span", { className: "scene-label", children: [
434
- "\u263C ",
435
- m.subtitle
436
- ] }),
437
- /* @__PURE__ */ jsx("span", { className: "scene-label", children: busy(s) ? "\u5996\u738B\u6311\u6218\u4E2D" : s.idle ? "\u6302\u673A\u4FEE\u884C\u4E2D" : "\u5C1A\u672A\u5F00\u59CB" })
438
- ] }),
439
- /* @__PURE__ */ jsxs("div", { className: "scene-inscription", children: [
440
- /* @__PURE__ */ jsx("span", { children: m.name }),
441
- /* @__PURE__ */ jsx("small", { children: "\u5C71 \u6D77 \u6709 \u7075 \xB7 \u897F \u884C \u65E0 \u5C3D" })
442
- ] }),
443
- units.map((u) => /* @__PURE__ */ jsxs("div", { className: `fighter ${u.side}`, children: [
444
- /* @__PURE__ */ jsxs("div", { className: "unit-label", children: [
445
- u.name,
446
- u.side === "hero" && /* @__PURE__ */ jsxs("em", { children: [
447
- " Lv.",
448
- s.level
449
- ] })
450
- ] }),
451
- /* @__PURE__ */ jsx("div", { className: "unit-identity", children: u.identity }),
452
- /* @__PURE__ */ jsx("div", { className: `unit-health ${u.side === "enemy" ? "red" : ""}`, children: /* @__PURE__ */ jsx("i", { style: { width: `${u.hp / u.max * 100}%` } }) }),
453
- /* @__PURE__ */ jsxs("div", { className: "health-text", children: [
454
- u.hp,
455
- " / ",
456
- u.max
457
- ] }),
458
- /* @__PURE__ */ jsx("div", { className: `sprite ${event ? u.side === "hero" ? "attack" : "hit" : ""}`, children: /* @__PURE__ */ jsx(GameSprite, { asset: u.asset }) }, sequence),
459
- Boolean(u.damage) && /* @__PURE__ */ jsxs("div", { className: "damage float", children: [
460
- u.side === "enemy" && event?.skill ? d.skillName + " " : "",
461
- "\u2212",
462
- u.damage
463
- ] }, `damage-${sequence}`)
464
- ] }, u.side)),
465
- /* @__PURE__ */ jsxs("div", { className: "companion", children: [
466
- /* @__PURE__ */ jsx(GameSprite, { asset: pet.art }),
467
- /* @__PURE__ */ jsx("span", { children: pet.name })
468
- ] }),
469
- event?.skill && /* @__PURE__ */ jsx("div", { className: "attack-flash cast", children: "\u6555" }, sequence),
470
- /* @__PURE__ */ jsxs("div", { className: "scene-bottom", children: [
471
- /* @__PURE__ */ jsx("span", { children: "\u25C7 \u81EA\u52A8\u62FE\u53D6\u5DF2\u5F00\u542F" }),
472
- /* @__PURE__ */ jsx("span", { children: f ? `\u7B2C ${f.turn} \u56DE\u5408 / 60` : "\u9759\u5019\u51FA\u53D1" })
473
- ] })
474
- ] }),
475
- /* @__PURE__ */ jsxs("div", { className: "battle-controls", children: [
476
- /* @__PURE__ */ jsxs("div", { children: [
477
- /* @__PURE__ */ jsx("div", { className: "status-label", children: s.idle ? "\u884C\u8DEF\u4E0D\u6B47\uFF0C\u4FEE\u4E3A\u6E10\u957F" : "\u4E07\u91CC\u897F\u884C\uFF0C\u4ECE\u8FD9\u91CC\u5F00\u59CB" }),
478
- /* @__PURE__ */ jsx("small", { children: "\u81EA\u52A8\u6218\u6597 \xB7 \u81EA\u52A8\u62FE\u53D6 \xB7 \u6301\u7EED\u6210\u957F" })
882
+ const d = engine.definition, m = d.maps[s.map];
883
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
884
+ /* @__PURE__ */ jsx2(Title, { kicker: `\u897F\u884C\u5386\u7EC3 / \u7B2C ${s.map + 1} \u7AE0`, title: m.name, children: /* @__PURE__ */ jsx2(GameButton, { className: "subtle-button", onClick: command(onAction, "loadout"), children: "\u914D\u7F6E\u6218\u6597" }) }),
885
+ /* @__PURE__ */ jsx2(GameHexBattlefield, { engine, state: s, onAction, event, sequence }),
886
+ /* @__PURE__ */ jsxs2("div", { className: "battle-controls", children: [
887
+ /* @__PURE__ */ jsxs2("div", { className: "status-label", children: [
888
+ busy(s) ? "\u9996\u9886\u6311\u6218 \xB7 \u81EA\u52A8\u8FCE\u6218" : s.idle ? "\u516D\u65B9\u6765\u654C\uFF0C\u81EA\u52A8\u4FEE\u884C" : "\u6574\u5907\u68CB\u9635\uFF0C\u9759\u5019\u51FA\u53D1",
889
+ /* @__PURE__ */ jsx2("small", { children: "\u9010\u683C\u79FB\u52A8 \xB7 \u6309\u914D\u7F6E\u65BD\u6CD5 \xB7 \u81EA\u52A8\u62FE\u53D6" })
479
890
  ] }),
480
- /* @__PURE__ */ jsx(GameButton, { className: "primary-button", disabled: busy(s), onClick: command(onAction, "idle"), children: s.idle ? "\u2161 \u6682\u505C\u6302\u673A" : "\u25B6 \u5F00\u59CB\u6302\u673A" })
891
+ /* @__PURE__ */ jsx2(GameButton, { className: "primary-button", disabled: busy(s), onClick: command(onAction, "idle"), children: s.idle ? "\u6682\u505C\u6302\u673A" : "\u5F00\u59CB\u6302\u673A" })
481
892
  ] }),
482
- /* @__PURE__ */ jsx(GameResourceSummary, { state: s }),
483
- /* @__PURE__ */ jsxs("div", { className: "tip", children: [
484
- /* @__PURE__ */ jsxs("p", { children: [
485
- "\u6BCF\u4E09\u6B21\u51FA\u624B\u81EA\u52A8\u65BD\u653E\u300C",
486
- d.skillName,
487
- "\u300D\u3002\u88C5\u5907\u4E0E\u7075\u5BA0\u7684\u63D0\u5347\uFF0C\u4E5F\u4F1A\u8BA1\u5165\u79BB\u7EBF\u4FEE\u884C\u3002"
488
- ] }),
489
- /* @__PURE__ */ jsx(GameButton, { className: "text-button", onClick: command(onAction, "help"), children: "\u73A9\u6CD5\u8BF4\u660E \u203A" })
893
+ /* @__PURE__ */ jsx2("div", { className: "hex-build-bar", children: [["attack", "\u653B\u51FB"], ["skill", "\u6280\u80FD"], ["power", "\u795E\u901A"], ["treasure", "\u6CD5\u5B9D"]].map(([kind, label]) => /* @__PURE__ */ jsxs2("span", { children: [
894
+ /* @__PURE__ */ jsx2("b", { children: label }),
895
+ gameAbilities(d).find((a) => a.id === s.loadout[kind])?.name
896
+ ] }, kind)) }),
897
+ /* @__PURE__ */ jsx2(GameResourceSummary, { state: s }),
898
+ /* @__PURE__ */ jsxs2("div", { className: "tip", children: [
899
+ /* @__PURE__ */ jsx2("p", { children: "\u5C0F\u5996\u4ECE\u8FB9\u7F18\u683C\u9760\u8FD1\uFF0C\u8FDB\u5165\u90BB\u683C\u624D\u653B\u51FB\u3002\u9996\u9886\u73B0\u8EAB\u4F1A\u6E05\u9000\u6240\u6709\u5C0F\u5996\u3002" }),
900
+ /* @__PURE__ */ jsx2(GameButton, { className: "text-button", disabled: busy(s), onClick: command(onAction, "page", "maps"), children: "\u5207\u6362\u5730\u56FE \u203A" })
490
901
  ] })
491
902
  ] });
492
903
  }
493
904
  function GameResourceSummary({ state: s }) {
494
- return /* @__PURE__ */ jsxs("section", { className: "income", children: [
495
- /* @__PURE__ */ jsxs("div", { className: "panel-heading", children: [
496
- /* @__PURE__ */ jsx("h3", { children: "\u4FEE\u884C\u7D2F\u8BA1\u6240\u5F97" }),
497
- /* @__PURE__ */ jsxs("span", { children: [
905
+ return /* @__PURE__ */ jsxs2("section", { className: "income", children: [
906
+ /* @__PURE__ */ jsxs2("div", { className: "panel-heading", children: [
907
+ /* @__PURE__ */ jsx2("h3", { children: "\u4FEE\u884C\u7D2F\u8BA1\u6240\u5F97" }),
908
+ /* @__PURE__ */ jsxs2("span", { children: [
498
909
  "\u7D2F\u8BA1\u51FB\u8D25 ",
499
910
  fmt(s.kills),
500
911
  " \u4E2A\u654C\u4EBA"
501
912
  ] })
502
913
  ] }),
503
- /* @__PURE__ */ jsx("div", { className: "income-grid", children: [["\u7ECF\u9A8C", s.sessionXp], ["\u94DC\u94B1", s.sessionGold], ["\u88C5\u5907", s.sessionDrops]].map(([label, value]) => /* @__PURE__ */ jsxs("div", { children: [
504
- /* @__PURE__ */ jsx("span", { children: label }),
505
- /* @__PURE__ */ jsxs("b", { children: [
914
+ /* @__PURE__ */ jsx2("div", { className: "income-grid", children: [["\u7ECF\u9A8C", s.sessionXp], ["\u94DC\u94B1", s.sessionGold], ["\u88C5\u5907", s.sessionDrops]].map(([label, value]) => /* @__PURE__ */ jsxs2("div", { children: [
915
+ /* @__PURE__ */ jsx2("span", { children: label }),
916
+ /* @__PURE__ */ jsxs2("b", { children: [
506
917
  fmt(Number(value)),
507
918
  label === "\u88C5\u5907" ? " \u4EF6" : ""
508
919
  ] })
@@ -511,10 +922,10 @@ function GameResourceSummary({ state: s }) {
511
922
  }
512
923
  function GameBossPanel({ engine, state: s, onAction }) {
513
924
  const d = engine.definition, m = d.maps[s.map], cleared = s.cleared.includes(s.map);
514
- return /* @__PURE__ */ jsxs("section", { id: "quest", children: [
515
- /* @__PURE__ */ jsxs("div", { className: "panel-heading", children: [
516
- /* @__PURE__ */ jsx("h3", { children: "\u2694 \u7AE0\u8282\u5996\u738B" }),
517
- /* @__PURE__ */ jsxs("span", { children: [
925
+ return /* @__PURE__ */ jsxs2("section", { id: "quest", children: [
926
+ /* @__PURE__ */ jsxs2("div", { className: "panel-heading", children: [
927
+ /* @__PURE__ */ jsx2("h3", { children: "\u2694 \u7AE0\u8282\u5996\u738B" }),
928
+ /* @__PURE__ */ jsxs2("span", { children: [
518
929
  "\u7B2C ",
519
930
  s.map + 1,
520
931
  " / ",
@@ -522,58 +933,58 @@ function GameBossPanel({ engine, state: s, onAction }) {
522
933
  " \u7AE0"
523
934
  ] })
524
935
  ] }),
525
- /* @__PURE__ */ jsxs("div", { className: "boss-portrait", children: [
526
- /* @__PURE__ */ jsx(GameSprite, { asset: m.bossArt }),
527
- /* @__PURE__ */ jsx("span", { className: "boss-seal", children: cleared ? "\u5DF2\u7834" : "\u5996\u738B" })
936
+ /* @__PURE__ */ jsxs2("div", { className: "boss-portrait", children: [
937
+ /* @__PURE__ */ jsx2(GameSprite, { asset: m.bossArt }),
938
+ /* @__PURE__ */ jsx2("span", { className: "boss-seal", children: cleared ? "\u5DF2\u7834" : "\u5996\u738B" })
528
939
  ] }),
529
- /* @__PURE__ */ jsxs("div", { className: "boss-title", children: [
530
- /* @__PURE__ */ jsx("h2", { children: m.boss }),
531
- /* @__PURE__ */ jsx("span", { children: m.bossArt.identity })
940
+ /* @__PURE__ */ jsxs2("div", { className: "boss-title", children: [
941
+ /* @__PURE__ */ jsx2("h2", { children: m.boss }),
942
+ /* @__PURE__ */ jsx2("span", { children: m.bossArt.identity })
532
943
  ] }),
533
- /* @__PURE__ */ jsx("p", { className: "identity-traits", children: m.bossArt.traits }),
534
- /* @__PURE__ */ jsxs("div", { className: "boss-stats", children: [
535
- /* @__PURE__ */ jsxs("span", { children: [
944
+ /* @__PURE__ */ jsx2("p", { className: "identity-traits", children: m.bossArt.traits }),
945
+ /* @__PURE__ */ jsxs2("div", { className: "boss-stats", children: [
946
+ /* @__PURE__ */ jsxs2("span", { children: [
536
947
  "\u6C14\u8840 ",
537
948
  fmt(m.bossHp)
538
949
  ] }),
539
- /* @__PURE__ */ jsxs("span", { children: [
950
+ /* @__PURE__ */ jsxs2("span", { children: [
540
951
  "\u653B\u51FB ",
541
952
  m.bossAtk
542
953
  ] })
543
954
  ] }),
544
- /* @__PURE__ */ jsxs("div", { className: "boss-reward", children: [
545
- /* @__PURE__ */ jsx("small", { children: cleared ? "\u518D\u6B21\u6311\u6218\u5956\u52B1" : "\u9996\u6B21\u51FB\u8D25\u5956\u52B1" }),
546
- /* @__PURE__ */ jsx("div", { children: cleared ? "\u94DC\u94B1\u3001\u7ECF\u9A8C\u3001\u7075\u8574" : d.slots[m.rewardSlot].names[1] + " \xB7 \u7075\u8574 \xD750" })
955
+ /* @__PURE__ */ jsxs2("div", { className: "boss-reward", children: [
956
+ /* @__PURE__ */ jsx2("small", { children: cleared ? "\u518D\u6B21\u6311\u6218\u5956\u52B1" : "\u9996\u6B21\u51FB\u8D25\u5956\u52B1" }),
957
+ /* @__PURE__ */ jsx2("div", { children: cleared ? "\u94DC\u94B1\u3001\u7ECF\u9A8C\u3001\u7075\u8574" : d.slots[m.rewardSlot].names[1] + " \xB7 \u7075\u8574 \xD750" })
547
958
  ] }),
548
- /* @__PURE__ */ jsx(GameButton, { className: "boss-button", disabled: busy(s), onClick: command(onAction, "boss"), children: busy(s) ? "\u6B63\u5728\u6311\u6218\u2026" : cleared ? "\u518D\u6B21\u6311\u6218" : "\u6311\u6218\u5996\u738B" }),
549
- /* @__PURE__ */ jsx("p", { className: "boss-hint", children: s.map < d.maps.length - 1 ? `\u9996\u6B21\u51FB\u8D25\uFF0C\u89E3\u9501\u300C${d.maps[s.map + 1].name}\u300D` : "\u5B8C\u6210\u6311\u6218\uFF0C\u901A\u5173\u5168\u90E8\u7AE0\u8282\u8BD5\u70BC" })
959
+ /* @__PURE__ */ jsx2(GameButton, { className: "boss-button", disabled: busy(s), onClick: command(onAction, "boss"), children: busy(s) ? "\u6B63\u5728\u6311\u6218\u2026" : cleared ? "\u518D\u6B21\u6311\u6218" : "\u6311\u6218\u5996\u738B" }),
960
+ /* @__PURE__ */ jsx2("p", { className: "boss-hint", children: s.map < d.maps.length - 1 ? `\u9996\u6B21\u51FB\u8D25\uFF0C\u89E3\u9501\u300C${d.maps[s.map + 1].name}\u300D` : "\u5B8C\u6210\u6311\u6218\uFF0C\u901A\u5173\u5168\u90E8\u7AE0\u8282\u8BD5\u70BC" })
550
961
  ] });
551
962
  }
552
963
  function GameLogPanel({ state: s }) {
553
- return /* @__PURE__ */ jsxs("section", { className: "journal", children: [
554
- /* @__PURE__ */ jsxs("div", { className: "panel-heading", children: [
555
- /* @__PURE__ */ jsx("h3", { children: "\u25A4 \u4E09\u754C\u89C1\u95FB" }),
556
- /* @__PURE__ */ jsx("span", { children: "\u5B9E\u65F6\u6218\u62A5" })
964
+ return /* @__PURE__ */ jsxs2("section", { className: "journal", children: [
965
+ /* @__PURE__ */ jsxs2("div", { className: "panel-heading", children: [
966
+ /* @__PURE__ */ jsx2("h3", { children: "\u25A4 \u4E09\u754C\u89C1\u95FB" }),
967
+ /* @__PURE__ */ jsx2("span", { children: "\u5B9E\u65F6\u6218\u62A5" })
557
968
  ] }),
558
- /* @__PURE__ */ jsx("div", { id: "logs", role: "log", "aria-label": "\u6218\u6597\u8BB0\u5F55", children: s.logs.map((log, i) => /* @__PURE__ */ jsxs("div", { className: `log-line ${log.type}`, children: [
559
- /* @__PURE__ */ jsx("time", { children: new Date(log.time).toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" }) }),
560
- /* @__PURE__ */ jsx("span", { children: log.text })
969
+ /* @__PURE__ */ jsx2("div", { id: "logs", role: "log", "aria-label": "\u6218\u6597\u8BB0\u5F55", children: s.logs.map((log, i) => /* @__PURE__ */ jsxs2("div", { className: `log-line ${log.type}`, children: [
970
+ /* @__PURE__ */ jsx2("time", { children: new Date(log.time).toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" }) }),
971
+ /* @__PURE__ */ jsx2("span", { children: log.text })
561
972
  ] }, `${log.time}-${i}`)) })
562
973
  ] });
563
974
  }
564
975
  function GameMapPanel({ engine, state: s, onAction }) {
565
976
  const d = engine.definition;
566
- return /* @__PURE__ */ jsxs(Fragment, { children: [
567
- /* @__PURE__ */ jsx(Title, { kicker: "\u4E09\u754C\u8206\u56FE / \u897F\u884C\u4E4B\u8DEF", title: d.labels?.mapsTitle || "\u63A2\u7D22\u65B0\u7684\u65C5\u7A0B" }),
568
- /* @__PURE__ */ jsx("p", { className: "view-description", children: "\u8E0F\u8FC7\u4E00\u91CD\u5C71\uFF0C\u518D\u8D74\u4E0B\u4E00\u7A0B\u3002\u51FB\u8D25\u7AE0\u8282\u5996\u738B\uFF0C\u5373\u53EF\u5F00\u542F\u65B0\u7684\u5386\u7EC3\u3002" }),
569
- /* @__PURE__ */ jsx("div", { className: "map-list", children: d.maps.map((m, i) => /* @__PURE__ */ jsxs(GameButton, { className: `map-card ${s.map === i ? "current" : ""}`, disabled: i > s.unlocked || busy(s), onClick: command(onAction, "map", String(i)), children: [
570
- /* @__PURE__ */ jsx("div", { className: "map-art", children: /* @__PURE__ */ jsx("img", { className: "landscape", src: m.scene, alt: "" }) }),
571
- /* @__PURE__ */ jsx("span", { className: "map-number", children: String(i + 1).padStart(2, "0") }),
572
- /* @__PURE__ */ jsxs("div", { className: "map-content", children: [
573
- /* @__PURE__ */ jsx("span", { className: "eyebrow", children: m.subtitle }),
574
- /* @__PURE__ */ jsx("h2", { children: m.name }),
575
- /* @__PURE__ */ jsx("p", { children: m.desc }),
576
- /* @__PURE__ */ jsxs("div", { className: "map-meta", children: [
977
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
978
+ /* @__PURE__ */ jsx2(Title, { kicker: "\u4E09\u754C\u8206\u56FE / \u897F\u884C\u4E4B\u8DEF", title: d.labels?.mapsTitle || "\u63A2\u7D22\u65B0\u7684\u65C5\u7A0B" }),
979
+ /* @__PURE__ */ jsx2("p", { className: "view-description", children: "\u8E0F\u8FC7\u4E00\u91CD\u5C71\uFF0C\u518D\u8D74\u4E0B\u4E00\u7A0B\u3002\u51FB\u8D25\u7AE0\u8282\u5996\u738B\uFF0C\u5373\u53EF\u5F00\u542F\u65B0\u7684\u5386\u7EC3\u3002" }),
980
+ /* @__PURE__ */ jsx2("div", { className: "map-list", children: d.maps.map((m, i) => /* @__PURE__ */ jsxs2(GameButton, { className: `map-card ${s.map === i ? "current" : ""}`, disabled: i > s.unlocked || busy(s), onClick: command(onAction, "map", String(i)), children: [
981
+ /* @__PURE__ */ jsx2("div", { className: "map-art", children: /* @__PURE__ */ jsx2("img", { className: "landscape", src: m.scene, alt: "" }) }),
982
+ /* @__PURE__ */ jsx2("span", { className: "map-number", children: String(i + 1).padStart(2, "0") }),
983
+ /* @__PURE__ */ jsxs2("div", { className: "map-content", children: [
984
+ /* @__PURE__ */ jsx2("span", { className: "eyebrow", children: m.subtitle }),
985
+ /* @__PURE__ */ jsx2("h2", { children: m.name }),
986
+ /* @__PURE__ */ jsx2("p", { children: m.desc }),
987
+ /* @__PURE__ */ jsxs2("div", { className: "map-meta", children: [
577
988
  "\u5EFA\u8BAE\u7B49\u7EA7 ",
578
989
  m.level,
579
990
  " \xB7 \u51FB\u8D25\u5956\u52B1 ",
@@ -583,9 +994,9 @@ function GameMapPanel({ engine, state: s, onAction }) {
583
994
  " \u94DC\u94B1"
584
995
  ] })
585
996
  ] }),
586
- /* @__PURE__ */ jsx("span", { className: "map-state", children: i > s.unlocked ? "\u51FB\u8D25\u4E0A\u4E00\u7AE0\u5996\u738B\u89E3\u9501" : s.map === i ? "\u5F53\u524D\u5386\u7EC3" : "\u524D\u5F80\u5386\u7EC3" })
997
+ /* @__PURE__ */ jsx2("span", { className: "map-state", children: i > s.unlocked ? "\u51FB\u8D25\u4E0A\u4E00\u7AE0\u5996\u738B\u89E3\u9501" : s.map === i ? "\u5F53\u524D\u5386\u7EC3" : "\u524D\u5F80\u5386\u7EC3" })
587
998
  ] }, m.id)) }),
588
- /* @__PURE__ */ jsxs("div", { className: "tip", children: [
999
+ /* @__PURE__ */ jsxs2("div", { className: "tip", children: [
589
1000
  "\u5F53\u524D\u5DF2\u89E3\u9501 ",
590
1001
  s.unlocked + 1,
591
1002
  " / ",
@@ -596,170 +1007,192 @@ function GameMapPanel({ engine, state: s, onAction }) {
596
1007
  }
597
1008
  function GamePetPanel({ engine, state: s, onAction }) {
598
1009
  const d = engine.definition;
599
- return /* @__PURE__ */ jsxs(Fragment, { children: [
600
- /* @__PURE__ */ jsx(Title, { kicker: "\u7075\u5BA0\u6D1E\u5929 / \u6709\u7075\u76F8\u4F34", title: d.labels?.petsTitle || "\u4F19\u4F34\u540C\u884C", children: /* @__PURE__ */ jsxs("span", { className: "capacity", children: [
1010
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
1011
+ /* @__PURE__ */ jsx2(Title, { kicker: "\u7075\u5BA0\u6D1E\u5929 / \u6709\u7075\u76F8\u4F34", title: d.labels?.petsTitle || "\u4F19\u4F34\u540C\u884C", children: /* @__PURE__ */ jsxs2("span", { className: "capacity", children: [
601
1012
  "\u7075\u8574 ",
602
1013
  fmt(s.essence)
603
1014
  ] }) }),
604
- /* @__PURE__ */ jsx("p", { className: "view-description", children: "\u7075\u5BA0\u968F\u4F60\u81EA\u52A8\u51FA\u6218\u3002\u4E0D\u540C\u7684\u4F19\u4F34\uFF0C\u8BA9\u6BCF\u4E00\u6BB5\u4FEE\u884C\u5404\u6709\u7AE0\u6CD5\u3002" }),
605
- /* @__PURE__ */ jsx("div", { className: "pet-cards", children: d.pets.map((p) => /* @__PURE__ */ jsxs("article", { className: `pet-card ${s.pet === p.id ? "selected" : ""}`, children: [
606
- /* @__PURE__ */ jsxs("div", { className: "pet-card-head", children: [
607
- /* @__PURE__ */ jsx("span", { className: "pet-kind", children: p.kind }),
608
- /* @__PURE__ */ jsx("span", { children: s.pets[p.id] ? `Lv.${s.pets[p.id]}` : "\u5C1A\u672A\u7ED3\u7F18" })
1015
+ /* @__PURE__ */ jsx2("p", { className: "view-description", children: "\u7075\u5BA0\u968F\u4F60\u81EA\u52A8\u51FA\u6218\u3002\u4E0D\u540C\u7684\u4F19\u4F34\uFF0C\u8BA9\u6BCF\u4E00\u6BB5\u4FEE\u884C\u5404\u6709\u7AE0\u6CD5\u3002" }),
1016
+ /* @__PURE__ */ jsx2("div", { className: "pet-cards", children: d.pets.map((p) => /* @__PURE__ */ jsxs2("article", { className: `pet-card ${s.pet === p.id ? "selected" : ""}`, children: [
1017
+ /* @__PURE__ */ jsxs2("div", { className: "pet-card-head", children: [
1018
+ /* @__PURE__ */ jsx2("span", { className: "pet-kind", children: p.kind }),
1019
+ /* @__PURE__ */ jsx2("span", { children: s.pets[p.id] ? `Lv.${s.pets[p.id]}` : "\u5C1A\u672A\u7ED3\u7F18" })
609
1020
  ] }),
610
- /* @__PURE__ */ jsx("div", { className: "pet-art", children: /* @__PURE__ */ jsx(GameSprite, { asset: p.art }) }),
611
- /* @__PURE__ */ jsx("h2", { children: p.name }),
612
- /* @__PURE__ */ jsx("p", { className: "identity-traits", children: p.art.traits }),
613
- /* @__PURE__ */ jsx("p", { children: p.desc }),
614
- /* @__PURE__ */ jsxs("div", { className: "pet-stat", children: [
615
- "\u51FA\u624B\u4F24\u5BB3 ",
616
- /* @__PURE__ */ jsx("b", { children: p.base + ((s.pets[p.id] || 1) - 1) * 3 })
1021
+ /* @__PURE__ */ jsx2("div", { className: "pet-art", children: /* @__PURE__ */ jsx2(GameSprite, { asset: p.art }) }),
1022
+ /* @__PURE__ */ jsx2("h2", { children: p.name }),
1023
+ /* @__PURE__ */ jsx2("p", { className: "identity-traits", children: p.art.traits }),
1024
+ /* @__PURE__ */ jsx2("p", { children: p.desc }),
1025
+ /* @__PURE__ */ jsxs2("div", { className: "pet-stat", children: [
1026
+ p.effect === "heal" ? "\u6BCF\u56DE\u5408\u6CBB\u7597" : p.effect === "guard" ? "\u53D7\u5230\u4F24\u5BB3\u964D\u4F4E" : "\u8FFD\u51FB\u4F24\u5BB3",
1027
+ " ",
1028
+ /* @__PURE__ */ jsx2("b", { children: p.effect === "guard" ? "25%" : p.effect === "heal" ? 7 + (s.pets[p.id] || 1) * 3 : p.base + ((s.pets[p.id] || 1) - 1) * 3 })
617
1029
  ] }),
618
- s.pets[p.id] ? /* @__PURE__ */ jsxs(Fragment, { children: [
619
- /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", disabled: busy(s) || s.pet === p.id, onClick: command(onAction, "deploy", p.id), children: s.pet === p.id ? "\u6B63\u5728\u51FA\u6218" : "\u8BBE\u4E3A\u51FA\u6218" }),
620
- /* @__PURE__ */ jsx(GameButton, { className: "primary-button", disabled: busy(s) || s.pets[p.id] >= 20 || s.essence < s.pets[p.id] * 15, onClick: command(onAction, "train", p.id), children: s.pets[p.id] >= 20 ? "\u5DF2\u8FBE\u6700\u9AD8\u7B49\u7EA7" : `\u57F9\u517B \xB7 ${s.pets[p.id] * 15} \u7075\u8574` })
621
- ] }) : /* @__PURE__ */ jsxs(GameButton, { className: "primary-button", disabled: busy(s) || s.essence < p.cost, onClick: command(onAction, "unlock", p.id), children: [
1030
+ s.pets[p.id] ? /* @__PURE__ */ jsxs2(Fragment, { children: [
1031
+ /* @__PURE__ */ jsx2(GameButton, { className: "subtle-button", disabled: busy(s) || s.pet === p.id, onClick: command(onAction, "deploy", p.id), children: s.pet === p.id ? "\u6B63\u5728\u51FA\u6218" : "\u8BBE\u4E3A\u51FA\u6218" }),
1032
+ /* @__PURE__ */ jsx2(GameButton, { className: "primary-button", disabled: busy(s) || s.pets[p.id] >= 20 || s.essence < s.pets[p.id] * 15, onClick: command(onAction, "train", p.id), children: s.pets[p.id] >= 20 ? "\u5DF2\u8FBE\u6700\u9AD8\u7B49\u7EA7" : `\u57F9\u517B \xB7 ${s.pets[p.id] * 15} \u7075\u8574` })
1033
+ ] }) : /* @__PURE__ */ jsxs2(GameButton, { className: "primary-button", disabled: busy(s) || s.essence < p.cost, onClick: command(onAction, "unlock", p.id), children: [
622
1034
  "\u7ED3\u7F18 \xB7 ",
623
1035
  p.cost,
624
1036
  " \u7075\u8574"
625
1037
  ] })
626
1038
  ] }, p.id)) }),
627
- /* @__PURE__ */ jsx("div", { className: "tip", children: "\u666E\u901A\u6218\u6597\u83B7\u5F97 2 \u7075\u8574\uFF0C\u9996\u9886\u9996\u901A\u83B7\u5F97 50 \u7075\u8574\u3002\u57F9\u517B\u63D0\u5347\u8FFD\u51FB\u4F24\u5BB3\u3002" })
1039
+ /* @__PURE__ */ jsx2("div", { className: "tip", children: "\u666E\u901A\u6218\u6597\u83B7\u5F97 2 \u7075\u8574\uFF0C\u9996\u9886\u9996\u901A\u83B7\u5F97 50 \u7075\u8574\u3002\u57F9\u517B\u63D0\u5347\u8FFD\u51FB\u4F24\u5BB3\u3002" })
628
1040
  ] });
629
1041
  }
630
1042
  function GameEquipmentPanel({ engine, state: s, onAction }) {
631
- const [filter, setFilter] = useState("all");
1043
+ const [filter, setFilter] = useState2("all");
632
1044
  const d = engine.definition;
633
1045
  const inventory = s.inventory.filter((item) => filter === "all" || item.slot === filter);
634
- return /* @__PURE__ */ jsxs(Fragment, { children: [
635
- /* @__PURE__ */ jsx(Title, { kicker: "\u884C\u56CA\u88C5\u5907 / \u767E\u70BC\u6210\u5668", title: d.labels?.gearTitle || "\u6574\u7406\u88C5\u5907\uFF0C\u63D0\u5347\u5B9E\u529B", children: /* @__PURE__ */ jsxs("span", { className: "capacity", children: [
1046
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
1047
+ /* @__PURE__ */ jsx2(Title, { kicker: "\u884C\u56CA\u88C5\u5907 / \u767E\u70BC\u6210\u5668", title: d.labels?.gearTitle || "\u6574\u7406\u88C5\u5907\uFF0C\u63D0\u5347\u5B9E\u529B", children: /* @__PURE__ */ jsxs2("span", { className: "capacity", children: [
636
1048
  "\u884C\u56CA ",
637
1049
  s.inventory.length,
638
1050
  " / 80"
639
1051
  ] }) }),
640
- /* @__PURE__ */ jsx("div", { className: "gear-slots", children: Object.entries(d.slots).map(([key, slot]) => /* @__PURE__ */ jsxs("section", { className: "gear-slot", children: [
641
- /* @__PURE__ */ jsxs("div", { className: "gear-info", children: [
642
- /* @__PURE__ */ jsxs("span", { className: "eyebrow", children: [
1052
+ /* @__PURE__ */ jsx2("div", { className: "gear-slots", children: Object.entries(d.slots).map(([key2, slot]) => /* @__PURE__ */ jsxs2("section", { className: "gear-slot", children: [
1053
+ /* @__PURE__ */ jsxs2("div", { className: "gear-info", children: [
1054
+ /* @__PURE__ */ jsxs2("span", { className: "eyebrow", children: [
643
1055
  slot.name,
644
1056
  " \xB7 \u5F3A\u5316 +",
645
- s.upgrades[key]
1057
+ s.upgrades[key2]
646
1058
  ] }),
647
- /* @__PURE__ */ jsx("h3", { children: s.equipment[key]?.name || "\u5C1A\u672A\u88C5\u5907" }),
648
- s.equipment[key] && /* @__PURE__ */ jsx(ItemStats, { item: s.equipment[key] })
1059
+ /* @__PURE__ */ jsx2("h3", { children: s.equipment[key2]?.name || "\u5C1A\u672A\u88C5\u5907" }),
1060
+ s.equipment[key2] && /* @__PURE__ */ jsx2(ItemStats, { item: s.equipment[key2] })
649
1061
  ] }),
650
- /* @__PURE__ */ jsx(GameButton, { className: "small-button", disabled: busy(s) || !s.equipment[key] || s.upgrades[key] >= 10 || s.gold < engine.upgradeCost(s, key), onClick: command(onAction, "upgrade", key), children: s.upgrades[key] >= 10 ? "\u5DF2\u5F3A\u5316\u81F3\u4E0A\u9650" : `\u5F3A\u5316 \xB7 ${engine.upgradeCost(s, key)} \u94DC\u94B1` })
651
- ] }, key)) }),
652
- /* @__PURE__ */ jsxs("div", { className: "inventory-toolbar", children: [
653
- /* @__PURE__ */ jsx("div", { className: "filters", children: [["all", "\u5168\u90E8"], ...Object.entries(d.slots).map(([key, slot]) => [key, slot.name])].map(([key, name]) => /* @__PURE__ */ jsx(GameButton, { className: `filter ${filter === key ? "active" : ""}`, "aria-pressed": filter === key, onClick: () => setFilter(key), children: name }, key)) }),
654
- /* @__PURE__ */ jsxs("span", { children: [
1062
+ /* @__PURE__ */ jsx2(GameButton, { className: "small-button", disabled: busy(s) || !s.equipment[key2] || s.upgrades[key2] >= 10 || s.gold < engine.upgradeCost(s, key2), onClick: command(onAction, "upgrade", key2), children: s.upgrades[key2] >= 10 ? "\u5DF2\u5F3A\u5316\u81F3\u4E0A\u9650" : `\u5F3A\u5316 \xB7 ${engine.upgradeCost(s, key2)} \u94DC\u94B1` })
1063
+ ] }, key2)) }),
1064
+ /* @__PURE__ */ jsxs2("div", { className: "inventory-toolbar", children: [
1065
+ /* @__PURE__ */ jsx2("div", { className: "filters", children: [["all", "\u5168\u90E8"], ...Object.entries(d.slots).map(([key2, slot]) => [key2, slot.name])].map(([key2, name]) => /* @__PURE__ */ jsx2(GameButton, { className: `filter ${filter === key2 ? "active" : ""}`, "aria-pressed": filter === key2, onClick: () => setFilter(key2), children: name }, key2)) }),
1066
+ /* @__PURE__ */ jsxs2("span", { children: [
655
1067
  "\u953B\u6750 ",
656
1068
  s.material
657
1069
  ] }),
658
- /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", disabled: busy(s) || s.material < 12, onClick: command(onAction, "forge"), children: "\u953B\u9020\u4E0A\u54C1 \xB7 12 \u953B\u6750" })
1070
+ /* @__PURE__ */ jsx2(GameButton, { className: "subtle-button", disabled: busy(s) || s.material < 12, onClick: command(onAction, "forge"), children: "\u953B\u9020\u4E0A\u54C1 \xB7 12 \u953B\u6750" })
659
1071
  ] }),
660
- /* @__PURE__ */ jsx("div", { className: "inventory-list", children: inventory.length ? inventory.map((item) => /* @__PURE__ */ jsxs("article", { className: "item-row", children: [
661
- /* @__PURE__ */ jsx("span", { className: `item-icon rarity-${item.tier}`, children: "\u25C7" }),
662
- /* @__PURE__ */ jsxs("div", { className: "item-detail", children: [
663
- /* @__PURE__ */ jsxs("strong", { children: [
1072
+ /* @__PURE__ */ jsx2("div", { className: "inventory-list", children: inventory.length ? inventory.map((item) => /* @__PURE__ */ jsxs2("article", { className: "item-row", children: [
1073
+ /* @__PURE__ */ jsx2("span", { className: `item-icon rarity-${item.tier}`, children: "\u25C7" }),
1074
+ /* @__PURE__ */ jsxs2("div", { className: "item-detail", children: [
1075
+ /* @__PURE__ */ jsxs2("strong", { children: [
664
1076
  item.name,
665
1077
  " ",
666
- /* @__PURE__ */ jsxs("small", { children: [
1078
+ /* @__PURE__ */ jsxs2("small", { children: [
667
1079
  d.rarities[item.tier],
668
1080
  " \xB7 ",
669
1081
  d.slots[item.slot].name
670
1082
  ] })
671
1083
  ] }),
672
- /* @__PURE__ */ jsx(ItemStats, { item })
1084
+ /* @__PURE__ */ jsx2(ItemStats, { item })
673
1085
  ] }),
674
- /* @__PURE__ */ jsx(GameButton, { className: "small-button", onClick: command(onAction, "inspect", item.id), children: "\u5BF9\u6BD4" }),
675
- /* @__PURE__ */ jsx(GameButton, { className: "small-button jade-button", disabled: busy(s), onClick: command(onAction, "equip", item.id), children: "\u88C5\u5907" }),
676
- /* @__PURE__ */ jsx(GameButton, { className: "text-button", disabled: busy(s), onClick: command(onAction, "lock", item.id), children: item.locked ? "\u89E3\u9501" : "\u9501\u5B9A" }),
677
- /* @__PURE__ */ jsx(GameButton, { className: "text-button", disabled: busy(s) || item.locked, onClick: command(onAction, "dismantle", item.id), children: "\u5206\u89E3" })
678
- ] }, item.id)) : /* @__PURE__ */ jsxs("div", { className: "empty-state", children: [
679
- /* @__PURE__ */ jsx("h3", { children: "\u884C\u56CA\u5C1A\u6709\u4F59\u5730" }),
680
- /* @__PURE__ */ jsx("p", { children: "\u6302\u673A\u51FB\u8D25\u5996\u602A\uFF0C\u6709\u673A\u4F1A\u62FE\u5F97\u88C5\u5907\u3002" }),
681
- /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", onClick: command(onAction, "page", "battle"), children: "\u524D\u5F80\u5386\u7EC3" })
1086
+ /* @__PURE__ */ jsx2(GameButton, { className: "small-button", onClick: command(onAction, "inspect", item.id), children: "\u5BF9\u6BD4" }),
1087
+ /* @__PURE__ */ jsx2(GameButton, { className: "small-button jade-button", disabled: busy(s), onClick: command(onAction, "equip", item.id), children: "\u88C5\u5907" }),
1088
+ /* @__PURE__ */ jsx2(GameButton, { className: "text-button", disabled: busy(s), onClick: command(onAction, "lock", item.id), children: item.locked ? "\u89E3\u9501" : "\u9501\u5B9A" }),
1089
+ /* @__PURE__ */ jsx2(GameButton, { className: "text-button", disabled: busy(s) || item.locked, onClick: command(onAction, "dismantle", item.id), children: "\u5206\u89E3" })
1090
+ ] }, item.id)) : /* @__PURE__ */ jsxs2("div", { className: "empty-state", children: [
1091
+ /* @__PURE__ */ jsx2("h3", { children: "\u884C\u56CA\u5C1A\u6709\u4F59\u5730" }),
1092
+ /* @__PURE__ */ jsx2("p", { children: "\u6302\u673A\u51FB\u8D25\u5996\u602A\uFF0C\u6709\u673A\u4F1A\u62FE\u5F97\u88C5\u5907\u3002" }),
1093
+ /* @__PURE__ */ jsx2(GameButton, { className: "subtle-button", onClick: command(onAction, "page", "battle"), children: "\u524D\u5F80\u5386\u7EC3" })
682
1094
  ] }) }),
683
- /* @__PURE__ */ jsx("div", { className: "tip", children: "\u5F3A\u5316\u968F\u90E8\u4F4D\u7EE7\u627F\u3002\u80CC\u5305\u6EE1\u540E\uFF0C\u65B0\u6389\u843D\u8F6C\u4E3A\u953B\u6750\uFF1B\u9501\u5B9A\u88C5\u5907\u4E0D\u80FD\u5206\u89E3\u3002" })
1095
+ /* @__PURE__ */ jsx2("div", { className: "tip", children: "\u5F3A\u5316\u968F\u90E8\u4F4D\u7EE7\u627F\u3002\u80CC\u5305\u6EE1\u540E\uFF0C\u65B0\u6389\u843D\u8F6C\u4E3A\u953B\u6750\uFF1B\u9501\u5B9A\u88C5\u5907\u4E0D\u80FD\u5206\u89E3\u3002" })
684
1096
  ] });
685
1097
  }
686
1098
  function GameSavePanel({ onExport, onImport }) {
687
- const input = useRef(null);
688
- return /* @__PURE__ */ jsxs("div", { className: "help-content", children: [
689
- /* @__PURE__ */ jsx("p", { children: "\u8FDB\u5EA6\u81EA\u52A8\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\u3002\u5BFC\u5165\u901A\u8FC7\u6821\u9A8C\u540E\uFF0C\u9700\u8981\u518D\u6B21\u786E\u8BA4\u624D\u80FD\u66FF\u6362\u5F53\u524D\u8FDB\u5EA6\u3002" }),
690
- /* @__PURE__ */ jsxs("div", { className: "settings-actions", children: [
691
- /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", onClick: onExport, children: "\u5BFC\u51FA\u5B58\u6863" }),
692
- /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", onClick: () => input.current?.click(), children: "\u5BFC\u5165\u5B58\u6863" }),
693
- /* @__PURE__ */ jsx("input", { ref: input, type: "file", accept: ".json,application/json", hidden: true, onChange: (e) => {
1099
+ const input = useRef2(null);
1100
+ return /* @__PURE__ */ jsxs2("div", { className: "help-content", children: [
1101
+ /* @__PURE__ */ jsx2("p", { children: "\u8FDB\u5EA6\u81EA\u52A8\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\u3002\u5BFC\u5165\u901A\u8FC7\u6821\u9A8C\u540E\uFF0C\u9700\u8981\u518D\u6B21\u786E\u8BA4\u624D\u80FD\u66FF\u6362\u5F53\u524D\u8FDB\u5EA6\u3002" }),
1102
+ /* @__PURE__ */ jsxs2("div", { className: "settings-actions", children: [
1103
+ /* @__PURE__ */ jsx2(GameButton, { className: "subtle-button", onClick: onExport, children: "\u5BFC\u51FA\u5B58\u6863" }),
1104
+ /* @__PURE__ */ jsx2(GameButton, { className: "subtle-button", onClick: () => input.current?.click(), children: "\u5BFC\u5165\u5B58\u6863" }),
1105
+ /* @__PURE__ */ jsx2("input", { ref: input, type: "file", accept: ".json,application/json", hidden: true, onChange: (e) => {
694
1106
  const file = e.target.files?.[0];
695
1107
  e.target.value = "";
696
1108
  if (file)
697
1109
  void onImport(file);
698
1110
  } })
699
1111
  ] }),
700
- /* @__PURE__ */ jsx("p", { children: "\u5B58\u6863\u4FDD\u5B58\u5728\u672C\u673A\uFF0C\u4E0D\u5305\u542B\u8D26\u53F7\u540C\u6B65\u548C\u591A\u4EBA\u8054\u7F51\u3002" })
1112
+ /* @__PURE__ */ jsx2("p", { children: "\u5B58\u6863\u4FDD\u5B58\u5728\u672C\u673A\uFF0C\u4E0D\u5305\u542B\u8D26\u53F7\u540C\u6B65\u548C\u591A\u4EBA\u8054\u7F51\u3002" })
701
1113
  ] });
702
1114
  }
703
1115
  function GameDialog({ open, title, children, onClose, container }) {
704
- return /* @__PURE__ */ jsx(Modal, { open, title, footer: null, centered: true, className: "sia-game-dialog", onCancel: onClose, getContainer: container, children });
1116
+ return /* @__PURE__ */ jsx2(Modal, { open, title, footer: null, centered: true, className: "sia-game-dialog", onCancel: onClose, getContainer: container, children });
705
1117
  }
706
1118
  function GameEquipmentComparison({ engine, state: s, onAction, itemId }) {
707
1119
  const item = s.inventory.find((i) => i.id === itemId);
708
1120
  if (!item)
709
- return /* @__PURE__ */ jsx("p", { children: "\u7269\u54C1\u5DF2\u4E0D\u5728\u80CC\u5305\u4E2D\u3002" });
1121
+ return /* @__PURE__ */ jsx2("p", { children: "\u7269\u54C1\u5DF2\u4E0D\u5728\u80CC\u5305\u4E2D\u3002" });
710
1122
  const old = s.equipment[item.slot];
711
- return /* @__PURE__ */ jsxs(Fragment, { children: [
712
- /* @__PURE__ */ jsxs("div", { className: "compare", children: [
713
- /* @__PURE__ */ jsxs("section", { children: [
714
- /* @__PURE__ */ jsx("span", { className: "eyebrow", children: "\u5F53\u524D\u88C5\u5907" }),
715
- /* @__PURE__ */ jsx("h3", { children: old?.name || "\u672A\u88C5\u5907" }),
716
- old && /* @__PURE__ */ jsx(ItemStats, { item: old })
1123
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
1124
+ /* @__PURE__ */ jsxs2("div", { className: "compare", children: [
1125
+ /* @__PURE__ */ jsxs2("section", { children: [
1126
+ /* @__PURE__ */ jsx2("span", { className: "eyebrow", children: "\u5F53\u524D\u88C5\u5907" }),
1127
+ /* @__PURE__ */ jsx2("h3", { children: old?.name || "\u672A\u88C5\u5907" }),
1128
+ old && /* @__PURE__ */ jsx2(ItemStats, { item: old })
717
1129
  ] }),
718
- /* @__PURE__ */ jsxs("section", { children: [
719
- /* @__PURE__ */ jsxs("span", { className: "eyebrow", children: [
1130
+ /* @__PURE__ */ jsxs2("section", { children: [
1131
+ /* @__PURE__ */ jsxs2("span", { className: "eyebrow", children: [
720
1132
  "\u5F85\u88C5\u5907 \xB7 ",
721
1133
  engine.definition.rarities[item.tier]
722
1134
  ] }),
723
- /* @__PURE__ */ jsx("h3", { children: item.name }),
724
- /* @__PURE__ */ jsx(ItemStats, { item })
1135
+ /* @__PURE__ */ jsx2("h3", { children: item.name }),
1136
+ /* @__PURE__ */ jsx2(ItemStats, { item })
725
1137
  ] })
726
1138
  ] }),
727
- /* @__PURE__ */ jsxs("p", { children: [
1139
+ /* @__PURE__ */ jsxs2("p", { children: [
728
1140
  "\u540C\u90E8\u4F4D\u5F3A\u5316 +",
729
1141
  s.upgrades[item.slot],
730
1142
  " \u5B8C\u6574\u7EE7\u627F\u3002"
731
1143
  ] }),
732
- /* @__PURE__ */ jsx("div", { className: "compare-delta", children: ["atk", "def", "hp"].map((key, i) => {
733
- const delta = item[key] - (old?.[key] || 0);
734
- return /* @__PURE__ */ jsxs("span", { className: delta >= 0 ? "jade" : "red-text", children: [
1144
+ /* @__PURE__ */ jsx2("div", { className: "compare-delta", children: ["atk", "def", "hp"].map((key2, i) => {
1145
+ const delta = item[key2] - (old?.[key2] || 0);
1146
+ return /* @__PURE__ */ jsxs2("span", { className: delta >= 0 ? "jade" : "red-text", children: [
735
1147
  ["\u653B\u51FB", "\u9632\u5FA1", "\u6C14\u8840"][i],
736
1148
  " ",
737
1149
  delta >= 0 ? "+" : "",
738
1150
  delta
739
- ] }, key);
1151
+ ] }, key2);
740
1152
  }) }),
741
- /* @__PURE__ */ jsx(GameButton, { className: "primary-button full", disabled: busy(s), onClick: command(onAction, "equip", item.id), children: "\u88C5\u5907" })
1153
+ /* @__PURE__ */ jsx2(GameButton, { className: "primary-button full", disabled: busy(s), onClick: command(onAction, "equip", item.id), children: "\u88C5\u5907" })
1154
+ ] });
1155
+ }
1156
+
1157
+ // src/game/IdleGameApp.tsx
1158
+ import { useEffect as useEffect2, useReducer, useRef as useRef3, useState as useState3 } from "react";
1159
+
1160
+ // src/game/LoadoutPanel.tsx
1161
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1162
+ function GameLoadoutPanel({ engine, state, onAction }) {
1163
+ const groups = [["attack", "\u653B\u51FB"], ["skill", "\u6280\u80FD"], ["power", "\u795E\u901A"], ["treasure", "\u6CD5\u5B9D"]];
1164
+ const locked = Boolean(state.fight?.boss && state.fight.status === "active");
1165
+ return /* @__PURE__ */ jsxs3("div", { className: "hex-loadout", children: [
1166
+ /* @__PURE__ */ jsx3("p", { children: "\u81EA\u52A8\u5BFB\u654C\u3001\u9010\u683C\u79FB\u52A8\u3002\u653B\u51FB\u6BCF\u56DE\u5408\u65BD\u653E\uFF1B\u6280\u80FD\u4E0E\u6CD5\u5B9D\u540C\u56DE\u5408\u53EF\u7528\u65F6\uFF0C\u4F18\u5148\u4F7F\u7528\u6CD5\u5B9D\uFF1B\u795E\u901A\u72EC\u7ACB\u751F\u6548\u3002\u66F4\u6362\u914D\u7F6E\u540E\u4ECE\u65B0\u4E00\u6CE2\u5F00\u59CB\u3002" }),
1167
+ groups.map(([kind, label]) => /* @__PURE__ */ jsxs3("section", { children: [
1168
+ /* @__PURE__ */ jsx3("h3", { children: label }),
1169
+ /* @__PURE__ */ jsx3("div", { className: "hex-ability-options", children: gameAbilities(engine.definition).filter((a) => a.kind === kind).map((a) => /* @__PURE__ */ jsxs3(GameButton, { className: `hex-ability ${state.loadout[kind] === a.id ? "selected" : ""}`, "aria-pressed": state.loadout[kind] === a.id, disabled: locked, onClick: () => onAction({ type: "configure", id: a.id }), children: [
1170
+ /* @__PURE__ */ jsx3("strong", { children: a.name }),
1171
+ /* @__PURE__ */ jsx3("small", { children: a.kind === "attack" ? `\u5C04\u7A0B ${a.range} \u683C` : `\u6BCF ${a.cooldown} \u56DE\u5408` }),
1172
+ /* @__PURE__ */ jsx3("span", { children: a.description })
1173
+ ] }, a.id)) })
1174
+ ] }, kind)),
1175
+ locked && /* @__PURE__ */ jsx3("p", { children: "\u9996\u9886\u6311\u6218\u671F\u95F4\u4E0D\u80FD\u66F4\u6362\u914D\u7F6E\uFF0C\u7ED3\u675F\u540E\u53EF\u8C03\u6574\u3002" })
742
1176
  ] });
743
1177
  }
744
1178
 
745
1179
  // src/game/IdleGameApp.tsx
746
- import { useEffect, useReducer, useRef as useRef2, useState as useState2 } from "react";
747
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1180
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
748
1181
  function IdleGameApp({ definition, className = "", style, onStateChange }) {
749
- const engineRef = useRef2();
1182
+ const engineRef = useRef3();
750
1183
  if (!engineRef.current)
751
1184
  engineRef.current = createIdleEngine(definition);
752
1185
  const engine = engineRef.current;
753
- const stateRef = useRef2();
1186
+ const stateRef = useRef3();
754
1187
  if (!stateRef.current)
755
1188
  stateRef.current = engine.freshState();
756
1189
  const s = stateRef.current;
757
1190
  const [, refresh] = useReducer((n) => n + 1, 0);
758
- const [page, setPage] = useState2("battle"), [dialog, setDialog] = useState2(""), [message, setMessage] = useState2("");
759
- const [event, setEvent] = useState2(null), [sequence, setSequence] = useState2(0);
760
- const [report, setReport] = useState2(null), [pending, setPending] = useState2(null), [itemId, setItemId] = useState2("");
761
- const host = useRef2(null), lastTick = useRef2(Date.now()), initialized = useRef2(false), saveWarning = useRef2(false);
762
- const observe = useRef2(onStateChange);
1191
+ const [page, setPage] = useState3("battle"), [dialog, setDialog] = useState3(""), [message, setMessage] = useState3("");
1192
+ const [event, setEvent] = useState3(null), [sequence, setSequence] = useState3(0);
1193
+ const [report, setReport] = useState3(null), [pending, setPending] = useState3(null), [itemId, setItemId] = useState3("");
1194
+ const host = useRef3(null), lastTick = useRef3(Date.now()), initialized = useRef3(false), saveWarning = useRef3(false);
1195
+ const observe = useRef3(onStateChange);
763
1196
  observe.current = onStateChange;
764
1197
  function save() {
765
1198
  const current = stateRef.current;
@@ -779,13 +1212,18 @@ function IdleGameApp({ definition, className = "", style, onStateChange }) {
779
1212
  refresh();
780
1213
  observe.current?.(stateRef.current);
781
1214
  }
782
- useEffect(() => {
1215
+ useEffect2(() => {
1216
+ if (!event?.bossWin) return;
1217
+ const timer = setTimeout(() => setMessage(event.first ? `\u9996\u901A\u6210\u529F\uFF01${event.reward}\u5DF2\u6536\u5165\u884C\u56CA\u3002` : "\u9996\u9886\u6311\u6218\u6210\u529F\uFF01"), (definition.turnDurationMs ?? 1e3) * 0.93);
1218
+ return () => clearTimeout(timer);
1219
+ }, [event, definition]);
1220
+ useEffect2(() => {
783
1221
  if (message) {
784
1222
  const timer = setTimeout(() => setMessage(""), 3200);
785
1223
  return () => clearTimeout(timer);
786
1224
  }
787
1225
  }, [message]);
788
- useEffect(() => {
1226
+ useEffect2(() => {
789
1227
  if (!initialized.current) {
790
1228
  try {
791
1229
  const raw = localStorage.getItem(definition.saveKey);
@@ -805,10 +1243,11 @@ function IdleGameApp({ definition, className = "", style, onStateChange }) {
805
1243
  lastTick.current = Date.now();
806
1244
  refresh();
807
1245
  }
1246
+ const roundMs = definition.turnDurationMs ?? 1e3;
808
1247
  const timer = setInterval(() => {
809
1248
  if (document.hidden)
810
1249
  return;
811
- const now = Date.now(), elapsed = Math.floor((now - lastTick.current) / 1e3);
1250
+ const now = Date.now(), elapsed = Math.floor((now - lastTick.current) / roundMs);
812
1251
  if (elapsed < 1)
813
1252
  return;
814
1253
  const current = stateRef.current;
@@ -818,16 +1257,15 @@ function IdleGameApp({ definition, className = "", style, onStateChange }) {
818
1257
  setEvent(null);
819
1258
  } else {
820
1259
  const next = engine.tick(current);
821
- setEvent(next);
1260
+ if (next) setEvent(next);
1261
+ else if (!current.fight || current.fight.status === "active") setEvent(null);
822
1262
  if (next) {
823
1263
  setSequence((n) => n + 1);
824
- if (next.bossWin)
825
- setMessage(next.first ? `\u9996\u901A\u6210\u529F\uFF01${next.reward}\u5DF2\u6536\u5165\u884C\u56CA\u3002` : "\u9996\u9886\u6311\u6218\u6210\u529F\uFF01");
826
1264
  }
827
1265
  }
828
1266
  lastTick.current = now;
829
1267
  changed();
830
- }, 1e3);
1268
+ }, roundMs);
831
1269
  const visibility = () => {
832
1270
  if (document.hidden) {
833
1271
  save();
@@ -859,7 +1297,7 @@ function IdleGameApp({ definition, className = "", style, onStateChange }) {
859
1297
  setPage(id);
860
1298
  return;
861
1299
  }
862
- if (type === "settings" || type === "help") {
1300
+ if (type === "settings" || type === "help" || type === "loadout") {
863
1301
  setDialog(type);
864
1302
  return;
865
1303
  }
@@ -873,6 +1311,15 @@ function IdleGameApp({ definition, className = "", style, onStateChange }) {
873
1311
  return;
874
1312
  }
875
1313
  let success = true;
1314
+ if (type === "configure") {
1315
+ const ability = gameAbilities(definition).find((a) => a.id === id);
1316
+ if (!ability) return;
1317
+ current.loadout[ability.kind] = ability.id;
1318
+ current.fight = null;
1319
+ setMessage(`\u5DF2\u88C5\u914D${ability.name}\uFF0C\u4E0B\u6B21\u51FA\u624B\u751F\u6548\u3002`);
1320
+ }
1321
+ setEvent(null);
1322
+ lastTick.current = Date.now();
876
1323
  if (type === "idle") {
877
1324
  current.idle = !current.idle;
878
1325
  if (!current.idle)
@@ -953,54 +1400,55 @@ function IdleGameApp({ definition, className = "", style, onStateChange }) {
953
1400
  setTimeout(() => URL.revokeObjectURL(url), 1e3);
954
1401
  }
955
1402
  const view = { engine, state: s, onAction: action };
956
- const titles = { settings: "\u4FEE\u884C\u8BBE\u7F6E \xB7 \u5B58\u6863", help: "\u4FEE\u884C\u5165\u95E8", compare: "\u88C5\u5907\u5BF9\u6BD4", offline: "\u4E45\u522B\u5F52\u6765\uFF0C\u4FEE\u884C\u672A\u6B47", import: "\u786E\u8BA4\u5BFC\u5165\u5B58\u6863" };
957
- return /* @__PURE__ */ jsxs2("div", { ref: host, className: `sia-game ${className}`, style, "data-sia-theme": "dark", children: [
958
- /* @__PURE__ */ jsx2(GameShell, { ...view, page, children: page === "battle" ? /* @__PURE__ */ jsx2(GameBattleStage, { ...view, event, sequence }) : page === "maps" ? /* @__PURE__ */ jsx2(GameMapPanel, { ...view }) : page === "gear" ? /* @__PURE__ */ jsx2(GameEquipmentPanel, { ...view }) : /* @__PURE__ */ jsx2(GamePetPanel, { ...view }) }),
959
- /* @__PURE__ */ jsxs2(GameDialog, { open: Boolean(dialog), title: titles[dialog] || "", onClose: () => setDialog(""), container: () => host.current, children: [
960
- dialog === "settings" && /* @__PURE__ */ jsx2(GameSavePanel, { onExport: exportFile, onImport: importFile }),
961
- dialog === "compare" && /* @__PURE__ */ jsx2(GameEquipmentComparison, { ...view, itemId }),
962
- dialog === "help" && /* @__PURE__ */ jsxs2("div", { className: "help-content", children: [
963
- /* @__PURE__ */ jsxs2("p", { children: [
964
- "\u5F00\u59CB\u6302\u673A\u540E\uFF0C\u6BCF\u79D2\u81EA\u52A8\u51FA\u624B\u5E76\u62FE\u53D6\u5956\u52B1\u3002\u5173\u95ED\u9875\u9762\u540E\uFF0C\u4E0B\u6B21\u8FDB\u5165\u7ED3\u7B97\u6700\u591A ",
1403
+ const titles = { loadout: "\u81EA\u52A8\u6218\u6597 \xB7 \u80FD\u529B\u914D\u7F6E", settings: "\u4FEE\u884C\u8BBE\u7F6E \xB7 \u5B58\u6863", help: "\u4FEE\u884C\u5165\u95E8", compare: "\u88C5\u5907\u5BF9\u6BD4", offline: "\u4E45\u522B\u5F52\u6765\uFF0C\u4FEE\u884C\u672A\u6B47", import: "\u786E\u8BA4\u5BFC\u5165\u5B58\u6863" };
1404
+ return /* @__PURE__ */ jsxs4("div", { ref: host, className: `sia-game ${className}`, style, "data-sia-theme": "dark", children: [
1405
+ /* @__PURE__ */ jsx4(GameShell, { ...view, page, children: page === "battle" ? /* @__PURE__ */ jsx4(GameBattleStage, { ...view, event, sequence }) : page === "maps" ? /* @__PURE__ */ jsx4(GameMapPanel, { ...view }) : page === "gear" ? /* @__PURE__ */ jsx4(GameEquipmentPanel, { ...view }) : /* @__PURE__ */ jsx4(GamePetPanel, { ...view }) }),
1406
+ /* @__PURE__ */ jsxs4(GameDialog, { open: Boolean(dialog), title: titles[dialog] || "", onClose: () => setDialog(""), container: () => host.current, children: [
1407
+ dialog === "loadout" && /* @__PURE__ */ jsx4(GameLoadoutPanel, { ...view }),
1408
+ dialog === "settings" && /* @__PURE__ */ jsx4(GameSavePanel, { onExport: exportFile, onImport: importFile }),
1409
+ dialog === "compare" && /* @__PURE__ */ jsx4(GameEquipmentComparison, { ...view, itemId }),
1410
+ dialog === "help" && /* @__PURE__ */ jsxs4("div", { className: "help-content", children: [
1411
+ /* @__PURE__ */ jsxs4("p", { children: [
1412
+ "\u5F00\u59CB\u6302\u673A\u540E\uFF0C\u6309\u6240\u914D\u7F6E\u7684\u56DE\u5408\u95F4\u9694\u81EA\u52A8\u5BFB\u654C\u3001\u79FB\u52A8\u3001\u51FA\u624B\u5E76\u62FE\u53D6\u5956\u52B1\u3002\u5173\u95ED\u9875\u9762\u540E\uFF0C\u4E0B\u6B21\u8FDB\u5165\u7ED3\u7B97\u6700\u591A ",
965
1413
  (definition.offlineCapSeconds ?? 43200) / 3600,
966
1414
  " \u5C0F\u65F6\u7684\u666E\u901A\u6218\u6597\u6536\u76CA\u3002"
967
1415
  ] }),
968
- /* @__PURE__ */ jsxs2("ol", { children: [
969
- /* @__PURE__ */ jsx2("li", { children: "\u6302\u673A\u83B7\u5F97\u7ECF\u9A8C\u3001\u94DC\u94B1\u3001\u88C5\u5907\u548C\u7075\u8574\u3002" }),
970
- /* @__PURE__ */ jsx2("li", { children: "\u66F4\u6362\u88C5\u5907\uFF0C\u5F3A\u5316\u90E8\u4F4D\uFF1B\u5F3A\u5316\u4E0D\u4F1A\u968F\u6362\u88C5\u4E22\u5931\u3002" }),
971
- /* @__PURE__ */ jsx2("li", { children: "\u7ED3\u7F18\u5E76\u57F9\u517B\u4F19\u4F34\uFF0C\u6539\u53D8\u8FFD\u51FB\u3001\u6CBB\u7597\u4E0E\u51CF\u4F24\u6548\u679C\u3002" }),
972
- /* @__PURE__ */ jsx2("li", { children: "\u6311\u6218\u9996\u9886\uFF0C\u9996\u901A\u83B7\u5F97\u88C5\u5907\u5E76\u89E3\u9501\u4E0B\u4E00\u7AE0\u3002" })
1416
+ /* @__PURE__ */ jsxs4("ol", { children: [
1417
+ /* @__PURE__ */ jsx4("li", { children: "\u6302\u673A\u83B7\u5F97\u7ECF\u9A8C\u3001\u94DC\u94B1\u3001\u88C5\u5907\u548C\u7075\u8574\u3002" }),
1418
+ /* @__PURE__ */ jsx4("li", { children: "\u66F4\u6362\u88C5\u5907\uFF0C\u5F3A\u5316\u90E8\u4F4D\uFF1B\u5F3A\u5316\u4E0D\u4F1A\u968F\u6362\u88C5\u4E22\u5931\u3002" }),
1419
+ /* @__PURE__ */ jsx4("li", { children: "\u7ED3\u7F18\u5E76\u57F9\u517B\u4F19\u4F34\uFF0C\u6539\u53D8\u8FFD\u51FB\u3001\u6CBB\u7597\u4E0E\u51CF\u4F24\u6548\u679C\u3002" }),
1420
+ /* @__PURE__ */ jsx4("li", { children: "\u6311\u6218\u9996\u9886\uFF0C\u9996\u901A\u83B7\u5F97\u88C5\u5907\u5E76\u89E3\u9501\u4E0B\u4E00\u7AE0\u3002" })
973
1421
  ] }),
974
- /* @__PURE__ */ jsx2("p", { children: "\u6311\u6218\u5931\u8D25\u4E0D\u6263\u8D44\u6E90\u3002\u9996\u9886\u6218\u671F\u95F4\u6682\u65F6\u4E0D\u80FD\u6362\u88C5\u3001\u57F9\u517B\u6216\u5207\u6362\u5730\u56FE\u3002" })
1422
+ /* @__PURE__ */ jsx4("p", { children: "\u6311\u6218\u5931\u8D25\u4E0D\u6263\u8D44\u6E90\u3002\u9996\u9886\u6218\u671F\u95F4\u6682\u65F6\u4E0D\u80FD\u6362\u88C5\u3001\u57F9\u517B\u6216\u5207\u6362\u5730\u56FE\u3002" })
975
1423
  ] }),
976
- dialog === "offline" && report && /* @__PURE__ */ jsxs2(Fragment2, { children: [
977
- /* @__PURE__ */ jsxs2("p", { children: [
1424
+ dialog === "offline" && report && /* @__PURE__ */ jsxs4(Fragment2, { children: [
1425
+ /* @__PURE__ */ jsxs4("p", { children: [
978
1426
  "\u79BB\u5F00 ",
979
1427
  Math.floor(report.seconds / 3600),
980
1428
  " \u5C0F\u65F6 ",
981
1429
  Math.floor(report.seconds % 3600 / 60),
982
1430
  " \u5206\u949F\uFF0C\u6536\u76CA\u5DF2\u81EA\u52A8\u5165\u8D26\u3002"
983
1431
  ] }),
984
- /* @__PURE__ */ jsx2("div", { className: "offline-grid", children: [["\u7ECF\u9A8C", report.xp], ["\u94DC\u94B1", report.gold], ["\u7075\u8574", report.essence], ["\u88C5\u5907\u6389\u843D", report.drops]].map(([label, value]) => /* @__PURE__ */ jsxs2("div", { children: [
985
- /* @__PURE__ */ jsx2("span", { children: label }),
986
- /* @__PURE__ */ jsx2("b", { children: value })
1432
+ /* @__PURE__ */ jsx4("div", { className: "offline-grid", children: [["\u7ECF\u9A8C", report.xp], ["\u94DC\u94B1", report.gold], ["\u7075\u8574", report.essence], ["\u88C5\u5907\u6389\u843D", report.drops]].map(([label, value]) => /* @__PURE__ */ jsxs4("div", { children: [
1433
+ /* @__PURE__ */ jsx4("span", { children: label }),
1434
+ /* @__PURE__ */ jsx4("b", { children: value })
987
1435
  ] }, label)) }),
988
- /* @__PURE__ */ jsxs2("p", { children: [
1436
+ /* @__PURE__ */ jsxs4("p", { children: [
989
1437
  "\u51FB\u8D25 ",
990
1438
  report.kills,
991
1439
  " \u4E2A\u654C\u4EBA\uFF0C\u80CC\u5305\u6EA2\u51FA\u6389\u843D\u5DF2\u8F6C\u4E3A\u953B\u6750\u3002"
992
1440
  ] }),
993
- /* @__PURE__ */ jsx2(GameButton, { className: "primary-button full", onClick: () => setDialog(""), children: "\u7EE7\u7EED\u5386\u7EC3" })
1441
+ /* @__PURE__ */ jsx4(GameButton, { className: "primary-button full", onClick: () => setDialog(""), children: "\u7EE7\u7EED\u5386\u7EC3" })
994
1442
  ] }),
995
- dialog === "import" && pending && /* @__PURE__ */ jsxs2(Fragment2, { children: [
996
- /* @__PURE__ */ jsxs2("p", { children: [
1443
+ dialog === "import" && pending && /* @__PURE__ */ jsxs4(Fragment2, { children: [
1444
+ /* @__PURE__ */ jsxs4("p", { children: [
997
1445
  "\u5373\u5C06\u8F7D\u5165 Lv.",
998
1446
  pending.level,
999
1447
  " \u7684\u89D2\u8272\uFF0C\u5DF2\u89E3\u9501 ",
1000
1448
  pending.unlocked + 1,
1001
1449
  " \u7AE0\u3002\u786E\u8BA4\u540E\u5C06\u66FF\u6362\u5F53\u524D\u5B58\u6863\u3002"
1002
1450
  ] }),
1003
- /* @__PURE__ */ jsx2(GameButton, { className: "primary-button full", disabled: Boolean(s.fight?.boss && s.fight.status === "active"), onClick: () => {
1451
+ /* @__PURE__ */ jsx4(GameButton, { className: "primary-button full", disabled: Boolean(s.fight?.boss && s.fight.status === "active"), onClick: () => {
1004
1452
  stateRef.current = pending;
1005
1453
  setPending(null);
1006
1454
  setDialog("");
@@ -1011,7 +1459,7 @@ function IdleGameApp({ definition, className = "", style, onStateChange }) {
1011
1459
  }, children: "\u786E\u8BA4\u66FF\u6362\u5F53\u524D\u5B58\u6863" })
1012
1460
  ] })
1013
1461
  ] }),
1014
- /* @__PURE__ */ jsx2("div", { className: `game-toast ${message ? "visible" : ""}`, role: "status", children: message })
1462
+ /* @__PURE__ */ jsx4("div", { className: `game-toast ${message ? "visible" : ""}`, role: "status", children: message })
1015
1463
  ] });
1016
1464
  }
1017
1465
  export {
@@ -1022,6 +1470,8 @@ export {
1022
1470
  GameDialog,
1023
1471
  GameEquipmentComparison,
1024
1472
  GameEquipmentPanel,
1473
+ GameHexBattlefield,
1474
+ GameLoadoutPanel,
1025
1475
  GameLogPanel,
1026
1476
  GameMapPanel,
1027
1477
  GamePetPanel,
@@ -1030,5 +1480,9 @@ export {
1030
1480
  GameShell,
1031
1481
  GameSprite,
1032
1482
  IdleGameApp,
1033
- createIdleEngine
1483
+ createIdleEngine,
1484
+ gameAbilities,
1485
+ gameHexCells,
1486
+ hexDistance,
1487
+ sampleHexPlayback
1034
1488
  };