use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class RancidEarthEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Effect effect1 = new DestroyTargetEffect("destroy that land");
effect1.apply(game, source);
return new DamageEverythingEffect(1).apply(game, source);
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class CruelDeceiverEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Cards cards = new CardsImpl();
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
cards.add(card);
controller.revealCards(sourceObject.getIdName(), cards, game);
if (card.isLand(game)) {
game.addEffect(new GainAbilitySourceEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, false, true), Duration.EndOfTurn), source);
}
}
return true;
}
return false;
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class NettlingImpDelayedDestroyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
DestroyTargetEffect effect = new DestroyTargetEffect();
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect, TargetController.ANY, new InvertCondition(TargetAttackedThisTurnCondition.instance));
delayedAbility.getDuration();
delayedAbility.getTargets().addAll(source.getTargets());
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class ArrogantBloodlordEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(permanent, game));
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.DestroyTargetEffect in project mage by magefree.
the class ConsumingFerocityEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature != null) {
Effect effect = new AddCountersAttachedEffect(CounterType.P1P0.createInstance(), "enchanted creature");
effect.apply(game, source);
if (creature.getCounters(game).getCount(CounterType.P1P0) > 2) {
Player player = game.getPlayer(creature.getControllerId());
if (player != null) {
player.damage(creature.getPower().getValue(), creature.getId(), source, game);
}
effect = new DestroyTargetEffect(true);
effect.setTargetPointer(new FixedTarget(creature, game));
effect.apply(game, source);
return true;
}
}
return false;
}
Aggregations