From dd94d3330134097dce2132e8c0a459e808c97b1e Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 10 Jul 2017 11:33:52 -0500 Subject: [PATCH] - Fixed controller/owner issue with Abandoned Sarcophagus. --- .../src/mage/cards/a/AbandonedSarcophagus.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java b/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java index d0e0fe71d1..6621fa8baa 100644 --- a/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java +++ b/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java @@ -174,12 +174,14 @@ class AbandonedSarcophagusReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { cardWasCycledThisTurn = false; cardHasCycling = false; - if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + && !game.isSimulation()) { Player controller = game.getPlayer(source.getControllerId()); AbandonedSarcophagusWatcher watcher = (AbandonedSarcophagusWatcher) game.getState().getWatchers().get(AbandonedSarcophagusWatcher.class.getSimpleName()); Card card = game.getCard(event.getTargetId()); if (card != null - && watcher != null) { + && watcher != null + && card.getOwnerId() == controller.getId()) { for (Ability ability : card.getAbilities()) { if (ability instanceof CyclingAbility) { cardHasCycling = true; @@ -217,9 +219,13 @@ class AbandonedSarcophagusWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.CYCLE_CARD) { + if (event.getType() == GameEvent.EventType.CYCLE_CARD + && !game.isSimulation()) { Card card = game.getCard(event.getSourceId()); - if (card != null) { + Player controller = game.getPlayer(event.getPlayerId()); + if (card != null + && controller != null + && card.getOwnerId() == controller.getId()) { Cards c = getCardsCycledThisTurn(event.getPlayerId()); c.add(card); cycledCardsThisTurn.put(event.getPlayerId(), c);