From b82d52d34cf20573fd7d67b4da9a5601ed065d31 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Mon, 1 Aug 2011 00:46:10 +0400 Subject: [PATCH] restriction effects for untap phase --- Mage/src/mage/abilities/effects/RestrictionEffect.java | 4 ++++ Mage/src/mage/players/PlayerImpl.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Mage/src/mage/abilities/effects/RestrictionEffect.java b/Mage/src/mage/abilities/effects/RestrictionEffect.java index 44cf018ac7..37980fde35 100644 --- a/Mage/src/mage/abilities/effects/RestrictionEffect.java +++ b/Mage/src/mage/abilities/effects/RestrictionEffect.java @@ -68,5 +68,9 @@ public abstract class RestrictionEffect> extends public boolean canBeBlocked(Permanent attacker, Permanent blocker, Game game) { return true; } + + public boolean canBeUntapped(Permanent permanent, Game game) { + return true; + } } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 308b66db5e..11e0ad2146 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -52,6 +52,7 @@ import mage.abilities.SpecialAction; import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility; import mage.abilities.common.PassAbility; +import mage.abilities.effects.RestrictionEffect; import mage.abilities.keyword.*; import mage.abilities.mana.ManaAbility; import mage.abilities.mana.ManaOptions; @@ -571,7 +572,11 @@ public abstract class PlayerImpl> implements Player, Ser public void untap(Game game) { //20091005 - 502.2 for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { - permanent.untap(game); + boolean untap = true; + for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game)) { + untap &= effect.canBeUntapped(permanent, game); + } + if (untap) permanent.untap(game); } }