Files
systemic-game-design-course/course/04-interceptors/reference/rust
Lucas WintherandClaude Fable 5.2 429137a6ef fix(reference): Death Events remember a right-hand neighbour, not a board index
A Deathrattle summon used the dying minion's board index from before the
Death Creation Step removed anything. That index is stale when a minion to
its left dies in the same step, so the token landed one place too far right.

Each Death Event now records `before`: the nearest minion to the right that
is not dying in the same step. The position handed to the effect context is
resolved when the trigger resolves: the current index of `before`, or the
right end. Applied to the Rust and TS references of Modules 3-10.

Module 3 gains two tests, documented in scenarios.md:
test_03_summon_position_after_simultaneous_deaths (fails before the fix) and
test_03_simultaneous_summons_keep_board_order.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 09:15:48 +01:00
..
2026-10-29 02:54:37 +01:00
2026-10-29 02:54:37 +01:00
2026-10-29 02:54:37 +01:00
2026-10-29 02:54:37 +01:00

Module 4 reference engine (Rust)

The course's own engine as of the end of Module 4. It adds auras as card data and one routine that decides how many times a queued trigger activates, so "Your minions trigger their Deathrattles twice." is a card, not a change to Deathrattle. It also adds playing a minion from hand, and Battlecries. Module 3's reference was the starting point, so a diff between the two shows what this module adds. Module 5's reference starts from this one.

  • src/engine/: generic machinery. Names no cards.
    • aura.rs: the Aura Update (Other), which snapshots the auras of every minion in play, and activations, the one routine that reads the snapshot and returns how many times a trigger of a given kind activates for a given player. Stacking policy (Max or Additive) is a field of each multiplier.
    • queue.rs: actions, the context an effect sees, and the resolver. The end of the outermost Phase runs the Death Creation Step, then the Aura Update (Other). Summoning a minion also runs the Aura Update; playing one does not. Each queued trigger asks activations once, as it starts, and then activates that many times back to back. A Play action moves a minion from hand to board and raises a Played event, which the minion's Battlecry answers.
    • death.rs: the Death Creation Step, unchanged from Module 3.
    • world.rs: entities, zones, order of play, heroes, stats, Armor, the pending-destroy flag, the aura snapshot and the log.
    • card.rs: card definitions (stats, triggers, auras, a spell's effect) and the library.
    • event.rs: the engine's events. Played is engine-only: src/harness.rs leaves it out of the course's GameEvent log, where the played minion's Summoned already shows it.
  • src/content/mod.rs: card definitions. Baron Rivendare is one aura entry: Aura::TriggerMultiplier on TriggerOn::Deathrattle, times 2, Stacking::Max. Twisting Nether (the Module 3 Expansion Drop) is here because the Module 4 tests use it.
  • src/harness.rs: the adapter the course tests call. summon goes through the engine's summon, so it runs an Aura Update. play (the Module 1 Expansion Drop) runs one Sequence with a Play action.

Run it with the module's tests: node tools/verify-references.mjs 04 from the course repository.