feat: module 03 death step
Deferred death: damage and destroy only mark minions; the Death Creation Step removes them when the outermost Phase ends, and Death Phases resolve Deathrattles in order of play until no new deaths occur. Deathrattle summons use the board position the Death Event remembered. Harness adds destroy(target). Expansion Drop: Twisting Nether as content only. test_02_mortally_wounded_still_triggers no longer asserts the Acolyte is still on the board: from Module 3 on it leaves at the end of the Sequence, and verify-references runs Module 2's tests against the Module 3 reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9c50591d3b
commit
8a4eba1948
41 files changed
+4080
-5
No files matched your search
@@ -70,7 +70,7 @@ Each player has a hero with 30 Health, in play from the start. `hero(player)` re
|
||||
The four tests (full statements in `course/02-action-queue/scenarios.md`):
|
||||
|
||||
- `test_02_aoe_damage_then_triggers`: Armorsmith then Acolyte of Pain, decks of 5 `Test Filler`, Whirlwind. Both `Damaged` events (Armorsmith first) come before any `Triggered` event; Armorsmith triggers twice and Acolyte once; 2 Armor; 1 card in hand.
|
||||
- `test_02_mortally_wounded_still_triggers`: an Acolyte at 1 Health (after `dealDamage(acolyte, 3)`) still draws from Whirlwind, ends at 0 Health, and is still on the board.
|
||||
- `test_02_mortally_wounded_still_triggers`: an Acolyte at 1 Health (after `dealDamage(acolyte, 3)`) still draws from Whirlwind and ends at 0 Health. The test does not ask where the Acolyte ends up: from Module 3 on, it leaves the board once the Whirlwind's reactions are done.
|
||||
- `test_02_depth_first_nesting`: Test Echo, Armorsmith, Test Reactor; `dealDamage(armorsmith, 1)`. Triggers in order Echo, Reactor, Armorsmith; Reactor's `StatsChanged` before `ArmorGained`.
|
||||
- `test_02_empty_deck_draw_is_fatigue`: an Acolyte with an empty deck takes 1 damage. The log is exactly `Damaged`, `Triggered`, `Fatigue`, and nothing else changes.
|
||||
|
||||
@@ -140,7 +140,7 @@ Make the four tests pass without breaking Module 1's. The rules for where code g
|
||||
|
||||
A card's behaviour can be ordinary code in this module: a function in `src/content/` that the engine calls. Module 5 turns those functions into data. What matters now is that a card's code only *describes* what it wants done, and the engine decides when it happens.
|
||||
|
||||
Don't build deaths. A minion at 0 Health stays on the board, and `test_02_mortally_wounded_still_triggers` checks exactly that. Module 3 adds the step that removes it.
|
||||
Don't build deaths. A minion at 0 Health stays on the board and keeps reacting, which is what `test_02_mortally_wounded_still_triggers` relies on. Module 3 adds the step that removes it, at the end of the Sequence.
|
||||
|
||||
<details><summary>Hint 1 — nudge</summary>
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Heroes have 30 Health and 0 Armor at the start of a game.
|
||||
- The log contains `Triggered{source: A, trigger: "damaged"}` and a `Drew` event for player 0.
|
||||
- `hand(0)` has N + 1 cards.
|
||||
- `health(A)` is 0.
|
||||
- `zoneOf(A)` is still board. Module 2 has no death step; Module 3 adds one.
|
||||
- The test does not check `zoneOf(A)`. Module 2 has no death step, so A stays on the board at 0 Health. Module 3 adds the step that removes A once the Sequence's reactions have resolved, and this test must keep passing then.
|
||||
|
||||
### test_02_depth_first_nesting
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ fn test_02_mortally_wounded_still_triggers() {
|
||||
.any(|e| matches!(e, GameEvent::Drew { player: 0, .. })));
|
||||
assert_eq!(g.hand(0).len(), n + 1);
|
||||
assert_eq!(g.health(a), 0);
|
||||
assert_eq!(g.zone_of(a), Zone::Board);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -49,7 +49,6 @@ test("test_02_mortally_wounded_still_triggers", () => {
|
||||
expect(log.some((e) => e.type === "Drew" && e.player === 0)).toBe(true);
|
||||
expect(g.hand(0)).toHaveLength(n + 1);
|
||||
expect(g.health(a)).toBe(0);
|
||||
expect(g.zoneOf(a)).toBe("board");
|
||||
});
|
||||
|
||||
test("test_02_depth_first_nesting", () => {
|
||||
|
||||
Reference in new issue
Block a user