* M15 added 5 green cards. Fixed Nissan Worldeaker.

This commit is contained in:
LevelX2 2014-07-03 17:20:18 +02:00
parent 9b4b209e37
commit ad85d4e7f6
12 changed files with 612 additions and 28 deletions

View file

@ -42,9 +42,9 @@ import mage.util.CardUtil;
*/
public class PutCountersSourceCost extends CostImpl {
private int amount;
private String name;
private Counter counter;
private final int amount;
private final String name;
private final Counter counter;
public PutCountersSourceCost(Counter counter) {
this.counter = counter.copy();

View file

@ -34,7 +34,6 @@ import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
@ -44,6 +43,7 @@ import mage.players.Player;
public class ReturnSourceFromGraveyardToBattlefieldEffect extends OneShotEffect {
private boolean tapped;
private boolean ownerControl;
public ReturnSourceFromGraveyardToBattlefieldEffect() {
this(false);
@ -54,10 +54,17 @@ public class ReturnSourceFromGraveyardToBattlefieldEffect extends OneShotEffect
this.tapped = tapped;
setText();
}
public ReturnSourceFromGraveyardToBattlefieldEffect(boolean tapped, boolean ownerControl) {
super(Outcome.PutCreatureInPlay);
this.tapped = tapped;
this.ownerControl = ownerControl;
setText();
}
public ReturnSourceFromGraveyardToBattlefieldEffect(final ReturnSourceFromGraveyardToBattlefieldEffect effect) {
super(effect);
this.tapped = effect.tapped;
this.ownerControl = effect.ownerControl;
}
@Override
@ -67,22 +74,36 @@ public class ReturnSourceFromGraveyardToBattlefieldEffect extends OneShotEffect
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card card = player.getGraveyard().get(source.getSourceId(), game);
if (card != null) {
if(card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId(), tapped))
{
return true;
}
if (!game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) {
return false;
}
Card card = game.getCard(source.getSourceId());
if (card == null) {
return false;
}
return false;
Player player;
if (ownerControl) {
player = game.getPlayer(card.getOwnerId());
} else {
player = game.getPlayer(source.getControllerId());
}
if (player == null) {
return false;
}
return player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), tapped);
}
private void setText() {
if (tapped)
staticText = "Return {this} from your graveyard to the battlefield tapped";
else
staticText = "Return {this} from your graveyard to the battlefield";
StringBuilder sb = new StringBuilder("Return {this} from your graveyard to the battlefield");
if (tapped) {
sb.append(" tapped");
}
if (ownerControl) {
sb.append(" under its owner's control");
}
staticText = sb.toString();
}
}

View file

@ -120,8 +120,11 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
permanent.getPower().setValue(token.getPower().getValue());
}
}
result = true;
}
result |= true;
}
if (!result && this.duration.equals(Duration.Custom) ) {
this.discard();
}
return result;
}

View file

@ -164,7 +164,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl {
}
sb.append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName()).append(" gain ");
} else {
if (!target.getTargetName().startsWith("another")) {
if (!target.getTargetName().toUpperCase().startsWith("ANOTHER")) {
sb.append("Target ");
}
sb.append(target.getTargetName()).append(" gains ");