Search in sources :

Example 36 with ReflexiveTriggeredAbility

use of mage.abilities.common.delayed.ReflexiveTriggeredAbility in project mage by magefree.

the class CalibratedBlastEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    Cards cards = new CardsImpl();
    for (Card card : player.getLibrary().getCards(game)) {
        cards.add(card);
        if (card.isLand(game)) {
            continue;
        }
        ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(card.getManaValue()), false, "When you reveal " + "a nonland card this way, {this} deals damage equal to that card's mana value to any target");
        ability.addTarget(new TargetAnyTarget());
        game.fireReflexiveTriggeredAbility(ability, source);
        break;
    }
    player.revealCards(source, cards, game);
    player.putCardsOnBottomOfLibrary(cards, game, source, false);
    return true;
}
Also used : Player(mage.players.Player) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect) TargetAnyTarget(mage.target.common.TargetAnyTarget)

Example 37 with ReflexiveTriggeredAbility

use of mage.abilities.common.delayed.ReflexiveTriggeredAbility in project mage by magefree.

the class DiregrafHordeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    if (!new ZombieDecayedToken().putOntoBattlefield(2, game, source, source.getControllerId())) {
        return false;
    }
    ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new ExileTargetEffect(), false, "exile up to two target cards from graveyards");
    ability.addTarget(new TargetCardInGraveyard(0, 2));
    game.fireReflexiveTriggeredAbility(ability, source);
    return true;
}
Also used : TargetCardInGraveyard(mage.target.common.TargetCardInGraveyard) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) ZombieDecayedToken(mage.game.permanent.token.ZombieDecayedToken) ExileTargetEffect(mage.abilities.effects.common.ExileTargetEffect)

Aggregations

ReflexiveTriggeredAbility (mage.abilities.common.delayed.ReflexiveTriggeredAbility)37 Player (mage.players.Player)23 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)15 Permanent (mage.game.permanent.Permanent)13 TargetPermanent (mage.target.TargetPermanent)12 TargetAnyTarget (mage.target.common.TargetAnyTarget)11 UUID (java.util.UUID)6 Card (mage.cards.Card)6 FilterPermanent (mage.filter.FilterPermanent)6 AddCountersSourceEffect (mage.abilities.effects.common.counter.AddCountersSourceEffect)5 GenericManaCost (mage.abilities.costs.mana.GenericManaCost)4 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)4 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)3 DoWhenCostPaid (mage.abilities.effects.common.DoWhenCostPaid)3 ExileTargetEffect (mage.abilities.effects.common.ExileTargetEffect)3 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)3 ControllerIdPredicate (mage.filter.predicate.permanent.ControllerIdPredicate)3 FixedTarget (mage.target.targetpointer.FixedTarget)3 Mode (mage.abilities.Mode)2 ManaCosts (mage.abilities.costs.mana.ManaCosts)2