Skip to content

Fix/3994 Route host damage to swarm cards before defeating swarming enemies#4152

Open
wdqin wants to merge 1 commit intohalogenandtoast:mainfrom
wdqin:fix/3994-stir-the-pot-damage
Open

Fix/3994 Route host damage to swarm cards before defeating swarming enemies#4152
wdqin wants to merge 1 commit intohalogenandtoast:mainfrom
wdqin:fix/3994-stir-the-pot-damage

Conversation

@wdqin
Copy link
Copy Markdown

@wdqin wdqin commented Apr 1, 2026

Title:
Fix swarming enemy host damage resolution when targeting Swarm of Spiders with Stir the Pot

Issue ID: 3994
#3994

Summary:
This fixes damage resolution against swarming enemies so damage assigned to a swarming host is routed to one of its swarm cards first, instead of accumulating directly on the face-up host while swarm cards remain.

Problem:
In the failing Stir the Pot case, targeting the face-up Swarm of Spiders host applied damage directly to the host enemy even though it still had swarm cards underneath it.

That caused two incorrect outcomes:

the swarm card that should have been defeated remained in play
the face-up host could continue accumulating damage and be selected again, even though that damage should have been absorbed by remaining swarm cards first

In the captured game state, this showed up as the host receiving damage while a remaining AsSwarm child was still attached, which left the swarming stack in an invalid state.

Change:

Updated EnemyDamage handling in Enemy.Runner
When the target is a non-swarm host and it still has in-play SwarmOf eid children, damage is now redirected to a swarm card instead of being applied to the host
Left direct damage handling unchanged for enemies whose placement is already AsSwarm
Kept the existing defeat and excess-damage flow intact after damage reaches the swarm card

Implementation references:
This change works with the existing swarming defeat rules already in:

CheckDefeated, which prevents a swarming host from being defeated while swarm cards remain
EnemyDefeated / Discard, which already clean up swarm defeat state once an actual swarm card is defeated

Files changed:

backend/arkham-api/library/Arkham/Enemy/Runner.hs

Test coverage:
No automated regression spec added in this change.

Validated manually against the provided game state for:

targeting the face-up Swarm of Spiders host no longer stacking damage directly on the host while swarm cards remain
damage being routed into a swarm card first
preventing the host from reaching an invalid multi-damage state before swarm cards are removed

Result:

Screenshot 2026-04-01 at 3 03 55 PM

Now the 2 damages to each enemy are correctly assigned, and the two "swarming 2" spiders only have their host card remaining on the board after the full damages are applied.

P.S. I shall stop my bug-fixing process until the previous ones are reviewed. @halogenandtoast please let me know if such PRs could be actually beneficial for the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant