Files
systemic-game-design-course/course/10-spellgrid/expansion/tests/ts/test_10x.test.ts
T
Lucas WintherandClaude Opus 5.5 a0cf9be214 feat: module 10 spellgrid
SpellGrid capstone: Part I's card engine and Part II's grid engine joined at
three seams (rules -> aura data, hazard victims -> one destroy Sequence,
Sequence end -> write text, remove the dead, reparse). Three levels with
scripted solutions, a naive-timing test via a harness-only hook that
reverses the END_OF_PHASE list, CLIs in both tracks, the BATTLECRY IS DOUBLE
Expansion Drop, SpellGrid cards and words in course/cards and the catalog,
level schema cards/hand, and tools staging/copying of module levels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 05:01:27 +01:00

31 lines
880 B
TypeScript

// Module 10 Expansion Drop: BATTLECRY IS DOUBLE. The scenario is in ../../README.md.
import { expect, test } from "vitest";
import { newSpellGrid } from "../src/harness";
test("test_10x_battlecry_is_double", () => {
const g = newSpellGrid(
{
width: 5,
height: 3,
objects: [
{ kind: "text:BATTLECRY", x: 0, y: 0 },
{ kind: "text:IS", x: 1, y: 0 },
{ kind: "text:DOUBLE", x: 2, y: 0 },
],
cards: [],
hand: ["Town Crier"],
},
[],
);
expect(g.activeRules()).toContain("BATTLECRY IS DOUBLE");
g.clearLog();
const crier = g.play("Town Crier", 0, 2);
const battlecries = g.log().filter((e) => e.type === "Triggered" && e.source === crier && e.trigger === "battlecry");
expect(battlecries).toHaveLength(2);
expect(g.health(g.hero(1))).toBe(28);
expect(g.kindsAt(0, 2)).toEqual(["crier"]);
});