Reversed, Slow Death heals a point per draw (rules rev 11)
Per the FAQ: a REVERSE riding the cast turns the whole curse — the victim gains a point for every card drawn, as permanently as the bite. The stack's reversed verdict now reaches onResolved, and the sustained effect carries it in its data scratch. Older ledgers attached the biting curse regardless and replay unchanged (pinned at deckRev 10). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF
This commit is contained in:
co-authored by
Claude Fable 5
parent
e930d013f8
commit
e885325098
@@ -1,7 +1,8 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { applyCommand, activePlayer, displays, handLimit, sustainedOn, type GameState, type PlayerId } from "../src/game";
|
||||
import type { CardInstance } from "../src/cards";
|
||||
import { newGame, must, giveCard, toRound2, faceOff, castAt } from "./helpers";
|
||||
import { createGame } from "../src/game";
|
||||
import { newGame, must, drain, giveCard, toRound2, faceOff, castAt } from "./helpers";
|
||||
|
||||
/** Display a stone for a player during their turn. */
|
||||
function displayStone(state: GameState, playerId: PlayerId, stoneId: string, slot = 0): GameState {
|
||||
@@ -147,6 +148,49 @@ describe("slow death", () => {
|
||||
expect(sustainedOn(state, defender, "slow-death").length).toBe(1);
|
||||
});
|
||||
|
||||
it("a reverse at the casting turns the curse: a point gained per draw (rev 11)", () => {
|
||||
let { state } = newGame();
|
||||
state = toRound2(state);
|
||||
const { attacker, defender } = faceOff(state);
|
||||
const sd = giveCard(state, attacker, "slow-death");
|
||||
giveCard(state, defender, "reverse", "RV", 0);
|
||||
const r = applyCommand(state, attacker, {
|
||||
type: "cast", instanceId: sd.instanceId, target: { kind: "player", playerId: defender },
|
||||
});
|
||||
if (!r.ok) throw new Error(r.error);
|
||||
state = must(r.state, defender, { type: "counteract", instanceId: "reverse#RV" });
|
||||
state = drain(state);
|
||||
expect(sustainedOn(state, defender, "slow-death").length).toBe(1);
|
||||
|
||||
state = must(state, attacker, { type: "endTurn", draw: 0 });
|
||||
const d = state.players.find((p) => p.id === defender)!;
|
||||
const toDiscard = d.hand.slice(0, 2).map((c) => c.instanceId);
|
||||
state = must(state, defender, { type: "discard", instanceIds: toDiscard });
|
||||
state = must(state, defender, { type: "endTurn", draw: 2 });
|
||||
expect(state.players.find((p) => p.id === defender)!.life).toBe(17);
|
||||
});
|
||||
|
||||
it("older decks attach the biting curse through a reverse (rev ≤10)", () => {
|
||||
let { state } = createGame({ playerIds: ["alice", "bob"], seed: 42, sets: ["basic"], deckRev: 10 });
|
||||
state = toRound2(state);
|
||||
const { attacker, defender } = faceOff(state);
|
||||
const sd = giveCard(state, attacker, "slow-death");
|
||||
giveCard(state, defender, "reverse", "RV", 0);
|
||||
const r = applyCommand(state, attacker, {
|
||||
type: "cast", instanceId: sd.instanceId, target: { kind: "player", playerId: defender },
|
||||
});
|
||||
if (!r.ok) throw new Error(r.error);
|
||||
state = must(r.state, defender, { type: "counteract", instanceId: "reverse#RV" });
|
||||
state = drain(state);
|
||||
|
||||
state = must(state, attacker, { type: "endTurn", draw: 0 });
|
||||
const d = state.players.find((p) => p.id === defender)!;
|
||||
const toDiscard = d.hand.slice(0, 2).map((c) => c.instanceId);
|
||||
state = must(state, defender, { type: "discard", instanceIds: toDiscard });
|
||||
state = must(state, defender, { type: "endTurn", draw: 2 });
|
||||
expect(state.players.find((p) => p.id === defender)!.life).toBe(13);
|
||||
});
|
||||
|
||||
it("bloodstone cancels slow death's per-draw point", () => {
|
||||
let { state } = newGame();
|
||||
state = toRound2(state);
|
||||
|
||||
Reference in New Issue
Block a user