Search in sources :

Example 11 with SacrificeSourceEffect

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

the class SacrificeSourceBeginningCleanupStepEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent cunning = game.getPermanent(source.getSourceId());
    if (cunning != null) {
        DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextCleanupDelayedTriggeredAbility(new SacrificeSourceEffect());
        game.addDelayedTriggeredAbility(delayedAbility, source);
        return true;
    }
    return false;
}
Also used : AtTheBeginOfNextCleanupDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheBeginOfNextCleanupDelayedTriggeredAbility) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) Permanent(mage.game.permanent.Permanent) TargetPermanent(mage.target.TargetPermanent) AtTheBeginOfNextCleanupDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheBeginOfNextCleanupDelayedTriggeredAbility) DelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) SacrificeSourceEffect(mage.abilities.effects.common.SacrificeSourceEffect)

Aggregations

SacrificeSourceEffect (mage.abilities.effects.common.SacrificeSourceEffect)11 Permanent (mage.game.permanent.Permanent)6 DelayedTriggeredAbility (mage.abilities.DelayedTriggeredAbility)5 Player (mage.players.Player)5 ActivationInfo (mage.abilities.ActivationInfo)4 AtTheBeginOfNextEndStepDelayedTriggeredAbility (mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility)4 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)3 CreateTokenCopyTargetEffect (mage.abilities.effects.common.CreateTokenCopyTargetEffect)2 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)2 TargetPermanent (mage.target.TargetPermanent)2 TargetControlledCreaturePermanent (mage.target.common.TargetControlledCreaturePermanent)2 FixedTarget (mage.target.targetpointer.FixedTarget)2 TriggeredAbility (mage.abilities.TriggeredAbility)1 BecomesTargetTriggeredAbility (mage.abilities.common.BecomesTargetTriggeredAbility)1 BeginningOfEndStepTriggeredAbility (mage.abilities.common.BeginningOfEndStepTriggeredAbility)1 AtTheBeginOfNextCleanupDelayedTriggeredAbility (mage.abilities.common.delayed.AtTheBeginOfNextCleanupDelayedTriggeredAbility)1 Cost (mage.abilities.costs.Cost)1 SacrificeTargetCost (mage.abilities.costs.common.SacrificeTargetCost)1 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 Effect (mage.abilities.effects.Effect)1