1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-17 17:00:08 -09:00

Merge pull request from use/swans-chandra-emblem-fix

Fix 
This commit is contained in:
Derek M 2017-06-10 09:21:26 -04:00 committed by GitHub
commit 05d90729c3

View file

@ -42,6 +42,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.command.CommandObject;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
@ -100,6 +101,7 @@ class SwansOfBrynArgollEffect extends PreventionEffectImpl {
if (sourceOfDamage != null) {
Spell spell = game.getStack().getSpell(sourceOfDamage.getId());
Permanent permanent = game.getPermanentOrLKIBattlefield(sourceOfDamage.getId());
CommandObject emblem = (CommandObject)game.getEmblem(sourceOfDamage.getId());
if (spell != null) {
Player controllerOfSpell = game.getPlayer(spell.getControllerId());
controllerOfSpell.drawCards(preventionEffectData.getPreventedDamage(), game);
@ -110,6 +112,11 @@ class SwansOfBrynArgollEffect extends PreventionEffectImpl {
controllerOfPermanent.drawCards(preventionEffectData.getPreventedDamage(), game);
passed = true;
}
if (emblem != null) {
Player controllerOfEmblem = game.getPlayer(emblem.getControllerId());
controllerOfEmblem.drawCards(preventionEffectData.getPreventedDamage(), game);
passed = true;
}
if (!passed) {
// Needed for cards that do damage from hand e.g. Gempalm Incinerator
Card cardSource = game.getCard(event.getSourceId());