Implement dex and thorns effects
This commit is contained in:
@@ -418,3 +418,32 @@ test("simulateCombat: exhaust cards do not return through discard reshuffle", ()
|
||||
assert.equal(r.win, false);
|
||||
assert.equal(r.draw, true);
|
||||
});
|
||||
|
||||
test("simulateCombat: dex increases block gained from cards", () => {
|
||||
const data = {
|
||||
cards: {
|
||||
Footwork: { name: "Footwork", cost: 1, kind: "Power", dex: 2 },
|
||||
Defend: { name: "Defend", cost: 1, kind: "Skill", block: 5 },
|
||||
},
|
||||
starterDeck: ["Footwork", "Defend"],
|
||||
monsters: [{ name: "Dummy", maxHp: 99, intents: [{ kind: "Attack", value: 6 }] }],
|
||||
};
|
||||
const r = simulateCombat(data, () => 0.999999);
|
||||
assert.equal(r.win, false);
|
||||
assert.equal(r.draw, true);
|
||||
assert.equal(r.playerHpRemaining, 80);
|
||||
});
|
||||
|
||||
test("simulateCombat: thorns reflects unblocked attack damage", () => {
|
||||
const data = {
|
||||
cards: {
|
||||
Spikes: { name: "Spikes", cost: 1, kind: "Power", thorns: 4 },
|
||||
},
|
||||
starterDeck: ["Spikes"],
|
||||
monsters: [{ name: "Dummy", maxHp: 4, intents: [{ kind: "Attack", value: 1 }] }],
|
||||
};
|
||||
const r = simulateCombat(data, () => 0.999999);
|
||||
assert.equal(r.win, true);
|
||||
assert.equal(r.turns, 1);
|
||||
assert.equal(r.playerHpRemaining, 79);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user