use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class CustomTestCard method addCustomEffect_DestroyTarget.
/**
* Add target destroy ability that can be called by text "target destroy"
*
* @param controller
*/
protected void addCustomEffect_DestroyTarget(TestPlayer controller) {
Ability ability = new SimpleActivatedAbility(new DestroyTargetEffect().setText("target destroy"), new ManaCostsImpl(""));
ability.addTarget(new TargetPermanent());
addCustomCardWithAbility("target destroy for " + controller.getName(), controller, ability);
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class OracleEnVecDestroyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class);
if (watcher != null) {
for (UUID targetId : chosenCreatures) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null && !watcher.getAttackedThisTurnCreatures().contains(new MageObjectReference(permanent, game))) {
Effect effect = new DestroyTargetEffect();
effect.setTargetPointer(new FixedTarget(targetId, game));
effect.apply(game, source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class HornetCannonEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token hornetToken = new HornetToken();
hornetToken.putOntoBattlefield(1, game, source, source.getControllerId());
for (UUID tokenId : hornetToken.getLastAddedTokenIds()) {
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {
DestroyTargetEffect destroyEffect = new DestroyTargetEffect(false);
destroyEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(destroyEffect), source);
}
}
return true;
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class PufferExtractEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int xValue = source.getManaCostsToPay().getX();
game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DestroyTargetEffect().setTargetPointer(new FixedTarget(source.getFirstTarget(), game))), source);
return true;
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class TsabosAssasinEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
Condition condition = new MostCommonColorCondition(permanent.getColor(game));
if (condition.apply(game, source)) {
Effect effect = new DestroyTargetEffect();
effect.setTargetPointer(new FixedTarget(permanent, game));
return effect.apply(game, source);
}
}
return false;
}
Aggregations