Fix Lifelink so it triggers per source instead of per recipient in combat. (#6272)

* Fix Lifelink so it triggers once per source instead of once per recipient in combat.

* Undo an import collapse.

* Add more tests for lifelink.
This commit is contained in:
Samuel Sandeen 2020-02-08 21:31:50 -05:00 committed by GitHub
parent fb82303b85
commit 29ce4b1ad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 187 additions and 4 deletions

View file

@ -2161,8 +2161,12 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
if (sourceAbilities != null && sourceAbilities.containsKey(LifelinkAbility.getInstance().getId())) {
Player player = game.getPlayer(sourceControllerId);
player.gainLife(actualDamage, game, sourceId);
if (combatDamage) {
game.getPermanent(sourceId).markLifelink(actualDamage);
} else {
Player player = game.getPlayer(sourceControllerId);
player.gainLife(actualDamage, game, sourceId);
}
}
// Unstable ability - Earl of Squirrel
if (sourceAbilities != null && sourceAbilities.containsKey(SquirrellinkAbility.getInstance().getId())) {