From 3a01e97d6e91233d64e6fabae53cd7d3a897e1bf Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 21 Jan 2016 22:01:10 +0100 Subject: [PATCH] * Alhammarret's Archive - Fixed that the draw effect was also applied on cards drawn from other players. --- .../magicorigins/AlhammarretsArchive.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magicorigins/AlhammarretsArchive.java b/Mage.Sets/src/mage/sets/magicorigins/AlhammarretsArchive.java index 4543f0c49c..063e47a228 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/AlhammarretsArchive.java +++ b/Mage.Sets/src/mage/sets/magicorigins/AlhammarretsArchive.java @@ -87,11 +87,6 @@ class AlhammarretsArchiveEffect extends ReplacementEffectImpl { return new AlhammarretsArchiveEffect(this); } - @Override - public boolean apply(Game game, Ability source) { - return true; - } - @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { event.setAmount(event.getAmount() * 2); @@ -132,9 +127,9 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.drawCards(2, game, event.getAppliedEffects()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.drawCards(2, game, event.getAppliedEffects()); } return true; } @@ -146,15 +141,17 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) { - CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep"); - if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) { + if (event.getPlayerId().equals(source.getControllerId())) { + if (game.getActivePlayerId().equals(event.getPlayerId()) + && game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) { + CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep"); + if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) { + return true; + } + } else { return true; } - } else { - return true; } - return false; } }