mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
The Gitrog Monster - Fixed that it could only be sacrificed if it's still on the battlefield.
This commit is contained in:
parent
70126988c5
commit
bec827f96c
1 changed files with 7 additions and 2 deletions
|
@ -5,6 +5,7 @@ import mage.abilities.Mode;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
@ -38,14 +39,18 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
String message = CardUtil.replaceSourceName(sb.toString(), sourcePermanent.getLogName());
|
String message = CardUtil.replaceSourceName(sb.toString(), sourcePermanent.getLogName());
|
||||||
message = Character.toUpperCase(message.charAt(0)) + message.substring(1);
|
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();
|
cost.clearPaid();
|
||||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||||
game.informPlayers(controller.getLogName() + " pays " + cost.toString());
|
game.informPlayers(controller.getLogName() + " pays " + cost.toString());
|
||||||
return true;
|
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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue