From 9fcefc8cd7d31f4a8df077bb9abcd0e574da9da5 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 26 Apr 2016 12:00:20 +0200 Subject: [PATCH] Some minor changes. --- .../sets/masterseditioniv/SerendibDjinn.java | 41 +++++++------------ ...OpponentsCardFromExileToGraveyardCost.java | 2 +- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SerendibDjinn.java b/Mage.Sets/src/mage/sets/masterseditioniv/SerendibDjinn.java index b07bd31ed5..e3cf9ec727 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniv/SerendibDjinn.java +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SerendibDjinn.java @@ -40,19 +40,15 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; -import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterLandPermanent; -import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetControlledPermanent; - - /** * * @author MarcoMarin @@ -85,11 +81,12 @@ public class SerendibDjinn extends CardImpl { return new SerendibDjinn(this); } } + class SerendibDjinnEffect extends OneShotEffect { public SerendibDjinnEffect() { super(Outcome.Damage); - this.staticText = "Sacrifice a Land. If it is an Island {this} deals 3 damage to you."; + this.staticText = "sacrifice a Land. If it is an Island {this} deals 3 damage to you"; } public SerendibDjinnEffect(final SerendibDjinnEffect effect) { @@ -103,30 +100,20 @@ class SerendibDjinnEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent == null) { - sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (player == null || sourcePermanent == null) { - return false; - } - - FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Controlled Land"); - filter.add(new AnotherPredicate()); - - Target target = new TargetControlledPermanent(1, 1, filter, true); - - if (target.canChoose(source.getSourceId(), player.getId(), game)) { - player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); - Permanent permanent = game.getPermanent(target.getFirstTarget()); - if (permanent != null) { - if (permanent.hasSubtype("Island")) { - player.damage(3, source.getSourceId(), game, false, true); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Target target = new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent(), true); + if (target.canChoose(source.getSourceId(), controller.getId(), game)) { + controller.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + permanent.sacrifice(source.getSourceId(), game); + if (permanent.hasSubtype("Island")) { + controller.damage(3, source.getSourceId(), game, false, true); + } } - permanent.sacrifice(source.getSourceId(), game); - return true; } + return true; } return false; } diff --git a/Mage/src/main/java/mage/abilities/costs/common/ExileOpponentsCardFromExileToGraveyardCost.java b/Mage/src/main/java/mage/abilities/costs/common/ExileOpponentsCardFromExileToGraveyardCost.java index c21e04c7e4..d26ffb11e9 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/ExileOpponentsCardFromExileToGraveyardCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/ExileOpponentsCardFromExileToGraveyardCost.java @@ -27,7 +27,7 @@ import mage.target.common.TargetCardInExile; public class ExileOpponentsCardFromExileToGraveyardCost extends CostImpl { public ExileOpponentsCardFromExileToGraveyardCost(boolean thatPlayersText) { - if (false) { + if (!thatPlayersText) { this.text = "put a card an opponent owns from exile into its owner's graveyard"; } else { this.text = "put a card an opponent owns from exile into that player's graveyard";