Search in sources :

Example 1 with SpiderToken

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

the class GloomwidowsFeastEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent targetCreature = game.getPermanent(source.getFirstTarget());
    if (targetCreature != null) {
        targetCreature.destroy(source, game, false);
        Permanent destroyedCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
        if (destroyedCreature.getColor(game).isBlue() || destroyedCreature.getColor(game).isBlack()) {
            SpiderToken token = new SpiderToken();
            token.putOntoBattlefield(1, game, source, source.getControllerId());
            return true;
        }
    }
    return false;
}
Also used : Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) TargetPermanent(mage.target.TargetPermanent) SpiderToken(mage.game.permanent.token.SpiderToken)

Aggregations

FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1 SpiderToken (mage.game.permanent.token.SpiderToken)1 TargetPermanent (mage.target.TargetPermanent)1