Some minor changes.

This commit is contained in:
LevelX2 2016-04-26 12:00:20 +02:00
parent dff8c1ea40
commit 9fcefc8cd7
2 changed files with 15 additions and 28 deletions

View file

@ -40,19 +40,15 @@ import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.Filter; import mage.filter.Filter;
import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
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;
import mage.target.Target; import mage.target.Target;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
/** /**
* *
* @author MarcoMarin * @author MarcoMarin
@ -85,11 +81,12 @@ public class SerendibDjinn extends CardImpl {
return new SerendibDjinn(this); return new SerendibDjinn(this);
} }
} }
class SerendibDjinnEffect extends OneShotEffect { class SerendibDjinnEffect extends OneShotEffect {
public SerendibDjinnEffect() { public SerendibDjinnEffect() {
super(Outcome.Damage); 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) { public SerendibDjinnEffect(final SerendibDjinnEffect effect) {
@ -103,30 +100,20 @@ class SerendibDjinnEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (controller != null) {
if (sourcePermanent == null) { Target target = new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent(), true);
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); if (target.canChoose(source.getSourceId(), controller.getId(), game)) {
} controller.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
if (player == null || sourcePermanent == null) { Permanent permanent = game.getPermanent(target.getFirstTarget());
return false; if (permanent != null) {
} permanent.sacrifice(source.getSourceId(), game);
if (permanent.hasSubtype("Island")) {
FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Controlled Land"); controller.damage(3, source.getSourceId(), game, false, true);
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);
} }
permanent.sacrifice(source.getSourceId(), game);
return true;
} }
return true;
} }
return false; return false;
} }

View file

@ -27,7 +27,7 @@ import mage.target.common.TargetCardInExile;
public class ExileOpponentsCardFromExileToGraveyardCost extends CostImpl { public class ExileOpponentsCardFromExileToGraveyardCost extends CostImpl {
public ExileOpponentsCardFromExileToGraveyardCost(boolean thatPlayersText) { public ExileOpponentsCardFromExileToGraveyardCost(boolean thatPlayersText) {
if (false) { if (!thatPlayersText) {
this.text = "put a card an opponent owns from exile into its owner's graveyard"; this.text = "put a card an opponent owns from exile into its owner's graveyard";
} else { } else {
this.text = "put a card an opponent owns from exile into that player's graveyard"; this.text = "put a card an opponent owns from exile into that player's graveyard";