Search in sources :

Example 1 with RedElementalWithTrampleAndHaste

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

the class ElementalAppealEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    CreateTokenEffect effect = new CreateTokenEffect(new RedElementalWithTrampleAndHaste());
    if (effect.apply(game, source)) {
        effect.exileTokensCreatedAtNextEndStep(game, source);
        if (KickedCondition.instance.apply(game, source)) {
            List<Predicate<MageObject>> predList = new ArrayList<>();
            for (UUID tokenId : effect.getLastAddedTokenIds()) {
                predList.add(new CardIdPredicate(tokenId));
            }
            if (!predList.isEmpty()) {
                FilterCreaturePermanent filter = new FilterCreaturePermanent();
                filter.add(Predicates.or(predList));
                game.addEffect(new BoostAllEffect(7, 0, Duration.EndOfTurn, filter, false), source);
            }
        }
        return true;
    }
    return false;
}
Also used : FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) ArrayList(java.util.ArrayList) RedElementalWithTrampleAndHaste(mage.game.permanent.token.RedElementalWithTrampleAndHaste) UUID(java.util.UUID) BoostAllEffect(mage.abilities.effects.common.continuous.BoostAllEffect) Predicate(mage.filter.predicate.Predicate) CardIdPredicate(mage.filter.predicate.mageobject.CardIdPredicate) CardIdPredicate(mage.filter.predicate.mageobject.CardIdPredicate)

Aggregations

ArrayList (java.util.ArrayList)1 UUID (java.util.UUID)1 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 BoostAllEffect (mage.abilities.effects.common.continuous.BoostAllEffect)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Predicate (mage.filter.predicate.Predicate)1 CardIdPredicate (mage.filter.predicate.mageobject.CardIdPredicate)1 RedElementalWithTrampleAndHaste (mage.game.permanent.token.RedElementalWithTrampleAndHaste)1