mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
fixed Aethergeode Miner and Flickering Spirit returning to the battlefield even if they die before their abilities resolve
This commit is contained in:
parent
1a61b657b7
commit
ced243df0a
2 changed files with 77 additions and 13 deletions
|
@ -33,14 +33,17 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.PayEnergyCost;
|
import mage.abilities.costs.common.PayEnergyCost;
|
||||||
import mage.abilities.effects.common.ExileSourceEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlSourceEffect;
|
|
||||||
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
|
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
|
||||||
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -60,9 +63,7 @@ public class AethergeodeMiner extends CardImpl {
|
||||||
this.addAbility(new AttacksTriggeredAbility(new GetEnergyCountersControllerEffect(2), false));
|
this.addAbility(new AttacksTriggeredAbility(new GetEnergyCountersControllerEffect(2), false));
|
||||||
|
|
||||||
// Pay {E}{E}: Exile Aethergeode Miner, then return it to the battlefield under its owner's control.
|
// Pay {E}{E}: Exile Aethergeode Miner, then return it to the battlefield under its owner's control.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileSourceEffect(true), new PayEnergyCost(2));
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AethergeodeMinerEffect(), new PayEnergyCost(2)));
|
||||||
ability.addEffect(new ReturnToBattlefieldUnderOwnerControlSourceEffect());
|
|
||||||
this.addAbility(ability);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AethergeodeMiner(final AethergeodeMiner card) {
|
public AethergeodeMiner(final AethergeodeMiner card) {
|
||||||
|
@ -74,3 +75,34 @@ public class AethergeodeMiner extends CardImpl {
|
||||||
return new AethergeodeMiner(this);
|
return new AethergeodeMiner(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AethergeodeMinerEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public AethergeodeMinerEffect() {
|
||||||
|
super(Outcome.Neutral);
|
||||||
|
this.staticText = "Exile {this}, then return it to the battlefield under its owner's control";
|
||||||
|
}
|
||||||
|
|
||||||
|
public AethergeodeMinerEffect(final AethergeodeMinerEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AethergeodeMinerEffect copy() {
|
||||||
|
return new AethergeodeMinerEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
|
if (permanent != null) {
|
||||||
|
if (permanent.moveToExile(source.getSourceId(), "Aethergeode Miner", source.getSourceId(), game)) {
|
||||||
|
Card card = game.getExile().getCard(source.getSourceId(), game);
|
||||||
|
if (card != null) {
|
||||||
|
return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -32,14 +32,17 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.common.ExileSourceEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlSourceEffect;
|
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -57,9 +60,7 @@ public class FlickeringSpirit extends CardImpl {
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// {3}{W}: Exile Flickering Spirit, then return it to the battlefield under its owner's control.
|
// {3}{W}: Exile Flickering Spirit, then return it to the battlefield under its owner's control.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileSourceEffect(true), new ManaCostsImpl("{3}{W}"));
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new FlickeringSpiritEffect(), new ManaCostsImpl("{3}{W}")));
|
||||||
ability.addEffect(new ReturnToBattlefieldUnderOwnerControlSourceEffect());
|
|
||||||
this.addAbility(ability);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,3 +73,34 @@ public class FlickeringSpirit extends CardImpl {
|
||||||
return new FlickeringSpirit(this);
|
return new FlickeringSpirit(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class FlickeringSpiritEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public FlickeringSpiritEffect() {
|
||||||
|
super(Outcome.Neutral);
|
||||||
|
this.staticText = "Exile {this}, then return it to the battlefield under its owner's control";
|
||||||
|
}
|
||||||
|
|
||||||
|
public FlickeringSpiritEffect(final FlickeringSpiritEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FlickeringSpiritEffect copy() {
|
||||||
|
return new FlickeringSpiritEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
|
if (permanent != null) {
|
||||||
|
if (permanent.moveToExile(source.getSourceId(), "Flickering Spirit", source.getSourceId(), game)) {
|
||||||
|
Card card = game.getExile().getCard(source.getSourceId(), game);
|
||||||
|
if (card != null) {
|
||||||
|
return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue