diff --git a/Mage.Sets/src/mage/cards/e/EnsnaringBridge.java b/Mage.Sets/src/mage/cards/e/EnsnaringBridge.java index ba74af82a2..d0d676f67f 100644 --- a/Mage.Sets/src/mage/cards/e/EnsnaringBridge.java +++ b/Mage.Sets/src/mage/cards/e/EnsnaringBridge.java @@ -47,7 +47,7 @@ import mage.players.Player; public class EnsnaringBridge extends CardImpl { public EnsnaringBridge(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // Creatures with power greater than the number of cards in your hand can't attack. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EnsnaringBridgeRestrictionEffect())); @@ -63,7 +63,6 @@ public class EnsnaringBridge extends CardImpl { } } - class EnsnaringBridgeRestrictionEffect extends RestrictionEffect { public EnsnaringBridgeRestrictionEffect() { @@ -78,10 +77,11 @@ class EnsnaringBridgeRestrictionEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - return permanent.getPower().getValue() > controller.getHand().size(); + if (controller == null) { + return false; } - return false; + return controller.getInRange().contains(permanent.getControllerId()) + && permanent.getPower().getValue() > controller.getHand().size(); } @Override diff --git a/Mage.Sets/src/mage/cards/p/PriceOfGlory.java b/Mage.Sets/src/mage/cards/p/PriceOfGlory.java index 35e30e70bf..8f039fcdad 100644 --- a/Mage.Sets/src/mage/cards/p/PriceOfGlory.java +++ b/Mage.Sets/src/mage/cards/p/PriceOfGlory.java @@ -50,8 +50,7 @@ import mage.target.targetpointer.FixedTarget; public class PriceOfGlory extends CardImpl { public PriceOfGlory(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); // Whenever a player taps a land for mana, if it's not that player's turn, destroy that land. this.addAbility(new PriceOfGloryAbility()); @@ -86,11 +85,16 @@ class PriceOfGloryAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - Permanent permanent = game.getPermanent(event.getSourceId()); + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + return false; } - if (permanent != null && permanent.isLand() + Player player = game.getPlayer(controllerId); + if (player == null) { + return false; + } + if (permanent.isLand() + && player.getInRange().contains(permanent.getControllerId()) && !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); return true; @@ -125,7 +129,7 @@ class PriceOfGloryEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Permanent land = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source)); - if (land != null && !land.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause has to be checked again + if (land != null && !land.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause has to be checked again land.destroy(source.getSourceId(), game, false); } return true; diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 1567246fda..dac2bddf9a 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -3484,9 +3484,10 @@ public abstract class PlayerImpl implements Player, Serializable { } @Override - public boolean hasOpponent(UUID playerToCheckId, Game game - ) { - return !this.getId().equals(playerToCheckId) && game.isOpponent(this, playerToCheckId); + public boolean hasOpponent(UUID playerToCheckId, Game game) { + return !this.getId().equals(playerToCheckId) + && game.isOpponent(this, playerToCheckId) + && getInRange().contains(playerToCheckId); } @Override