Search in sources :

Example 1 with ElementalTokenWithHaste

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

the class ChandraDrawEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        CreateTokenEffect effect = new CreateTokenEffect(new ElementalTokenWithHaste(), 2);
        effect.apply(game, source);
        effect.exileTokensCreatedAtNextEndStep(game, source);
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) ElementalTokenWithHaste(mage.game.permanent.token.ElementalTokenWithHaste)

Example 2 with ElementalTokenWithHaste

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

the class FeralLightningEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        CreateTokenEffect effect = new CreateTokenEffect(new ElementalTokenWithHaste(), 3);
        effect.apply(game, source);
        effect.exileTokensCreatedAtNextEndStep(game, source);
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) ElementalTokenWithHaste(mage.game.permanent.token.ElementalTokenWithHaste)

Example 3 with ElementalTokenWithHaste

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

the class LightningCoilsEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent p = game.getPermanent(source.getSourceId());
    if (p != null && controller != null) {
        int counters = p.getCounters(game).getCount(CounterType.CHARGE);
        if (counters >= 5) {
            // remove all the counters and create that many tokens
            p.removeCounters(CounterType.CHARGE.getName(), p.getCounters(game).getCount(CounterType.CHARGE), source, game);
            CreateTokenEffect effect = new CreateTokenEffect(new ElementalTokenWithHaste(), counters);
            effect.apply(game, source);
            // exile those tokens at next end step
            effect.exileTokensCreatedAtNextEndStep(game, source);
            return true;
        }
    }
    return false;
}
Also used : Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) ElementalTokenWithHaste(mage.game.permanent.token.ElementalTokenWithHaste)

Aggregations

CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)3 ElementalTokenWithHaste (mage.game.permanent.token.ElementalTokenWithHaste)3 Player (mage.players.Player)3 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1