* Norin the Wary - Fixed that it also returned from commandzone if put there from commander replament effect. Some other move and return from exile fixes.

This commit is contained in:
LevelX2 2015-08-02 10:34:57 +02:00
parent 6faeb19079
commit 2df109cf0b
9 changed files with 231 additions and 21 deletions

View file

@ -55,7 +55,7 @@ public class AEtherling extends CardImpl {
this.toughness = new MageInt(5);
// {U}: Exile AEtherling. Return it to the battlefield under its owner's control at the beginning of the next end step.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileReturnToBattlefieldOwnerNextEndStepEffect(), new ManaCostsImpl("{U}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileReturnToBattlefieldOwnerNextEndStepEffect(true), new ManaCostsImpl("{U}")));
// {U}: AEtherling can't be blocked this turn
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedSourceEffect(), new ManaCostsImpl("{U}")));
// {1}: AEtherling gets +1/-1 until end of turn.

View file

@ -43,9 +43,9 @@ import mage.filter.predicate.permanent.AnotherPredicate;
* @author fireshoes
*/
public class Saltskitter extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
@ -58,7 +58,7 @@ public class Saltskitter extends CardImpl {
this.toughness = new MageInt(4);
// Whenever another creature enters the battlefield, exile Saltskitter. Return Saltskitter to the battlefield under its owner's control at the beginning of the next end step.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(new ExileReturnToBattlefieldOwnerNextEndStepEffect(), filter));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(new ExileReturnToBattlefieldOwnerNextEndStepEffect(true), filter));
}
public Saltskitter(final Saltskitter card) {

View file

@ -31,8 +31,9 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -45,6 +46,7 @@ import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
@ -94,22 +96,23 @@ class GhostwayEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null && controller != null) {
int numberCreatures = 0;
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (creature != null) {
controller.moveCardToExileWithInfo(creature, exileId,sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
numberCreatures++;
int zcc = game.getState().getZoneChangeCounter(creature.getId());
controller.moveCardToExileWithInfo(creature, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
if (zcc == game.getState().getZoneChangeCounter(creature.getId()) - 1) {
Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect();
effect.setTargetPointer(new FixedTarget(creature.getId(), zcc + 1));
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}
}
if (numberCreatures > 0) {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;
}
return false;

View file

@ -54,8 +54,8 @@ public class AnuridBrushhopper extends CardImpl {
this.toughness = new MageInt(4);
// Discard two cards: Exile Anurid Brushhopper. Return it to the battlefield under its owner's control at the beginning of the next end step.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ExileReturnToBattlefieldOwnerNextEndStepEffect(),
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ExileReturnToBattlefieldOwnerNextEndStepEffect(true),
new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))));
}

View file

@ -97,7 +97,7 @@ class FreneticSliverEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
if (player.flipCoin(game)) {
return new ExileReturnToBattlefieldOwnerNextEndStepEffect().apply(game, source);
return new ExileReturnToBattlefieldOwnerNextEndStepEffect(true).apply(game, source);
} else {
Permanent perm = game.getPermanent(source.getSourceId());
if (perm != null) {

View file

@ -73,7 +73,7 @@ public class NorinTheWary extends CardImpl {
class NorinTheWaryTriggeredAbility extends TriggeredAbilityImpl {
public NorinTheWaryTriggeredAbility() {
super(Zone.BATTLEFIELD, new ExileReturnToBattlefieldOwnerNextEndStepEffect(), false);
super(Zone.BATTLEFIELD, new ExileReturnToBattlefieldOwnerNextEndStepEffect(true), false);
}
public NorinTheWaryTriggeredAbility(final NorinTheWaryTriggeredAbility ability) {