Search in sources :

Example 1 with PhaseOutTargetEffect

use of mage.abilities.effects.common.PhaseOutTargetEffect in project mage by magefree.

the class SpectralAdversaryEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Integer timesPaid = (Integer) getValue("timesPaid");
    if (timesPaid == null || timesPaid <= 0) {
        return false;
    }
    ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(timesPaid)), false, staticText);
    ability.addEffect(new PhaseOutTargetEffect());
    ability.addTarget(new TargetPermanent(0, timesPaid, filter));
    game.fireReflexiveTriggeredAbility(ability, source);
    return true;
}
Also used : AddCountersSourceEffect(mage.abilities.effects.common.counter.AddCountersSourceEffect) PhaseOutTargetEffect(mage.abilities.effects.common.PhaseOutTargetEffect) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) TargetPermanent(mage.target.TargetPermanent)

Aggregations

ReflexiveTriggeredAbility (mage.abilities.common.delayed.ReflexiveTriggeredAbility)1 PhaseOutTargetEffect (mage.abilities.effects.common.PhaseOutTargetEffect)1 AddCountersSourceEffect (mage.abilities.effects.common.counter.AddCountersSourceEffect)1 TargetPermanent (mage.target.TargetPermanent)1