From a5c0ae1b41ad1f6f6e893c27d11813b9043a272e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 26 Jan 2014 09:50:24 +0100 Subject: [PATCH] * Acolyte's Reward - Fixed that the prevented damage was not dealt to second target. --- .../sets/bornofthegods/AcolytesReward.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java b/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java index 604aaeb4dd..c1db6504ba 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/AcolytesReward.java @@ -39,6 +39,7 @@ import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; +import mage.players.Player; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreaturePermanent; @@ -116,10 +117,24 @@ class AcolytesRewardEffect extends PreventionEffectImpl { event.setAmount(0); this.amount -= damage; } + if (damage > 0) { + game.informPlayers(new StringBuilder("Acolyte's Reward ").append("prevented ").append(damage).append(" to ").append(targetCreature.getName()).toString()); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, + source.getControllerId(), source.getSourceId(), source.getControllerId(), damage)); - targetCreature.damage(damage, source.getSourceId(), game, true, false, event.getAppliedEffects()); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, - source.getControllerId(), source.getSourceId(), source.getControllerId(), damage)); + Player targetPlayer = game.getPlayer(source.getTargets().get(1).getFirstTarget()); + if (targetPlayer != null) { + targetPlayer.damage(damage, source.getSourceId(), game, false, true); + game.informPlayers(new StringBuilder("Acolyte's Reward ").append("deals ").append(damage).append(" damge to ").append(targetPlayer.getName()).toString()); + } else { + Permanent targetDamageCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (targetDamageCreature != null) { + targetDamageCreature.damage(damage, source.getSourceId(), game, true, false); + game.informPlayers(new StringBuilder("Acolyte's Reward ").append("deals ").append(damage).append(" damge to ").append(targetDamageCreature.getName()).toString()); + } + } + } + return true; } } return false;