Search in sources :

Example 1 with Pest11GainLifeToken

use of mage.game.permanent.token.Pest11GainLifeToken in project mage by magefree.

the class ValentinDeanOfTheVeinEffect method replaceEvent.

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
    ((ZoneChangeEvent) event).setToZone(Zone.EXILED);
    game.fireReflexiveTriggeredAbility(new ReflexiveTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new Pest11GainLifeToken()), new GenericManaCost(2)), false, "you may pay {2}. If you do, create a 1/1 black and green " + "Pest creature token with \"When this creature dies, you gain 1 life.\""), source);
    return false;
}
Also used : ZoneChangeEvent(mage.game.events.ZoneChangeEvent) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) DoIfCostPaid(mage.abilities.effects.common.DoIfCostPaid) Pest11GainLifeToken(mage.game.permanent.token.Pest11GainLifeToken) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect)

Example 2 with Pest11GainLifeToken

use of mage.game.permanent.token.Pest11GainLifeToken in project mage by magefree.

the class ContainmentBreachEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    permanent.destroy(source, game, false);
    if (permanent.getManaValue() <= 2) {
        new Pest11GainLifeToken().putOntoBattlefield(1, game, source, source.getControllerId());
    }
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetPermanent(mage.target.TargetPermanent) Pest11GainLifeToken(mage.game.permanent.token.Pest11GainLifeToken)

Aggregations

Pest11GainLifeToken (mage.game.permanent.token.Pest11GainLifeToken)2 ReflexiveTriggeredAbility (mage.abilities.common.delayed.ReflexiveTriggeredAbility)1 GenericManaCost (mage.abilities.costs.mana.GenericManaCost)1 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 DoIfCostPaid (mage.abilities.effects.common.DoIfCostPaid)1 ZoneChangeEvent (mage.game.events.ZoneChangeEvent)1 Permanent (mage.game.permanent.Permanent)1 TargetPermanent (mage.target.TargetPermanent)1