Fix/3994 Route host damage to swarm cards before defeating swarming enemies#4152
Open
wdqin wants to merge 1 commit intohalogenandtoast:mainfrom
Open
Fix/3994 Route host damage to swarm cards before defeating swarming enemies#4152wdqin wants to merge 1 commit intohalogenandtoast:mainfrom
wdqin wants to merge 1 commit intohalogenandtoast:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Potcase, targeting the face-upSwarm of Spidershost 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
AsSwarmchild was still attached, which left the swarming stack in an invalid state.Change:
Updated
EnemyDamagehandling inEnemy.RunnerWhen the target is a non-swarm host and it still has in-play
SwarmOf eidchildren, damage is now redirected to a swarm card instead of being applied to the hostLeft direct damage handling unchanged for enemies whose placement is already
AsSwarmKept 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 remainEnemyDefeated/Discard, which already clean up swarm defeat state once an actual swarm card is defeatedFiles 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 Spidershost no longer stacking damage directly on the host while swarm cards remaindamage being routed into a swarm card first
preventing the host from reaching an invalid multi-damage state before swarm cards are removed
Result:
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.