From bec827f96c0218e8c351e99324566227795da1d0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Oct 2016 23:58:41 +0200 Subject: [PATCH] The Gitrog Monster - Fixed that it could only be sacrificed if it's still on the battlefield. --- .../effects/common/SacrificeSourceUnlessPaysEffect.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java b/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java index 283d8c04a3..3b8afb7944 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java @@ -5,6 +5,7 @@ import mage.abilities.Mode; import mage.abilities.costs.Cost; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -38,14 +39,18 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect { } String message = CardUtil.replaceSourceName(sb.toString(), sourcePermanent.getLogName()); message = Character.toUpperCase(message.charAt(0)) + message.substring(1); - if (controller.chooseUse(Outcome.Benefit, message, source, game)) { + if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game) + && controller.chooseUse(Outcome.Benefit, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { game.informPlayers(controller.getLogName() + " pays " + cost.toString()); return true; } } - sourcePermanent.sacrifice(source.getSourceId(), game); + if (source.getSourceObjectZoneChangeCounter() == game.getState().getZoneChangeCounter(source.getSourceId()) + && game.getState().getZone(source.getSourceId()).equals(Zone.BATTLEFIELD)) { + sourcePermanent.sacrifice(source.getSourceId(), game); + } return true; } return false;