forked from External/mage
these weren't being picked up as removal spells and now are: * modal spells where one mode is a removal spell * spells that do a dynamic amount of damage, such as fireball * cards that reduce the toughness temporarily or permanently * cards that keep a creature tapped down * cards that exile a creature * cards that damage creatures that are attacking or blocking * enchantments that exile a creature when they etb * fight cards, and one sided fight cards the ai will now rate those types of cards higher as they are removal
43 lines
1.3 KiB
Java
43 lines
1.3 KiB
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package mage.abilities.effects.common;
|
|
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.effects.OneShotEffect;
|
|
import mage.constants.Outcome;
|
|
import mage.game.Game;
|
|
import mage.game.permanent.Permanent;
|
|
import mage.util.CardUtil;
|
|
|
|
/**
|
|
*
|
|
* @author Styxo
|
|
*/
|
|
public class ExileUntilSourceLeavesEffect extends OneShotEffect {
|
|
|
|
public ExileUntilSourceLeavesEffect(String targetName) {
|
|
super(Outcome.Removal);
|
|
this.staticText = "exile target " + targetName + " an opponent controls until {this} leaves the battlefield";
|
|
}
|
|
|
|
public ExileUntilSourceLeavesEffect(final ExileUntilSourceLeavesEffect effect) {
|
|
super(effect);
|
|
}
|
|
|
|
@Override
|
|
public ExileUntilSourceLeavesEffect copy() {
|
|
return new ExileUntilSourceLeavesEffect(this);
|
|
}
|
|
|
|
@Override
|
|
public boolean apply(Game game, Ability source) {
|
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
|
if (permanent != null) {
|
|
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source);
|
|
}
|
|
return false;
|
|
}
|
|
}
|