forked from External/mage
* Cumulative upkeep cost - fixed that it can lost payed state (cards: Aboroth, Karplusan Minotaur, Psychic Vortex, Sheltering Ancient); * Effects - fixed that it can lost selected targets or other settings (cards: Citadel of Pain, Crimson Honor Guard, Curfew, Leveler, Mana Cache, Monsoon, Paradigm Shift, Saprazzan Bailiff); * Exile all cards from graveyard ability - fixed that it can lost targets (example: Agent of Erebos); * Melee ability - fixed that it can lost targets (example: Adriana, Captain of the Guard).
39 lines
1 KiB
Java
39 lines
1 KiB
Java
package mage.abilities.effects.common;
|
|
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.effects.OneShotEffect;
|
|
import mage.constants.Outcome;
|
|
import mage.constants.Zone;
|
|
import mage.game.Game;
|
|
import mage.game.stack.Spell;
|
|
import mage.players.Player;
|
|
|
|
/**
|
|
* @author BetaSteward_at_googlemail.com
|
|
*/
|
|
public class ExileSpellEffect extends OneShotEffect {
|
|
|
|
public ExileSpellEffect() {
|
|
super(Outcome.Exile);
|
|
staticText = "Exile {this}";
|
|
}
|
|
|
|
private ExileSpellEffect(final ExileSpellEffect effect) {
|
|
super(effect);
|
|
}
|
|
|
|
@Override
|
|
public ExileSpellEffect copy() {
|
|
return new ExileSpellEffect(this);
|
|
}
|
|
|
|
@Override
|
|
public boolean apply(Game game, Ability source) {
|
|
Player controller = game.getPlayer(source.getControllerId());
|
|
Spell spell = game.getStack().getSpell(source.getId());
|
|
if (controller == null || spell == null) {
|
|
return true;
|
|
}
|
|
return controller.moveCards(spell.getCard(), Zone.EXILED, source, game);
|
|
}
|
|
}
|