Add exhaust pile and restore keyword tooltips

This commit is contained in:
2026-06-15 23:34:26 +09:00
parent 72370aab23
commit bda35eefc7
6 changed files with 840 additions and 52 deletions

View File

@@ -108,6 +108,7 @@ export function simulateCombat(data, rng, stats) {
if (monsters.length === 0) return { win: true, turns: 0, playerHpRemaining: PLAYER_HP };
let drawPile = shuffle(starterDeck, rng);
let discard = [];
const exhaust = [];
let hand = [];
let pHp = PLAYER_HP, pBlock = 0;
let pStr = 0, pWeak = 0, pVuln = 0;
@@ -222,7 +223,8 @@ export function simulateCombat(data, rng, stats) {
energy -= c.cost;
resolveCardEffects(id, c, c.cost);
hand.splice(idx, 1);
if (c.kind !== 'Power') discard.push(id);
if (c.exhaust === true || String(c.desc || '').includes('소멸.')) exhaust.push(id);
else if (c.kind !== 'Power') discard.push(id);
applyDiscardEffects(c);
if (aliveList().length === 0) return { win: true, turns, playerHpRemaining: pHp };
}

View File

@@ -405,3 +405,16 @@ test("simulateCombat: retain keeps card in hand across turns", () => {
assert.equal(r.win, true);
assert.equal(r.turns, 2);
});
test("simulateCombat: exhaust cards do not return through discard reshuffle", () => {
const data = {
cards: {
BurnOut: { name: "BurnOut", cost: 1, kind: "Attack", damage: 10, exhaust: true },
},
starterDeck: ["BurnOut"],
monsters: [{ name: "Dummy", maxHp: 12, intents: [{ kind: "Defend", value: 0 }] }],
};
const r = simulateCombat(data, mulberry32(1));
assert.equal(r.win, false);
assert.equal(r.draw, true);
});