Search in sources :

Example 1 with AdditionalCombatPhaseEffect

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

the class LightningRunnerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        new GetEnergyCountersControllerEffect(2).apply(game, source);
        if (controller.getCounters().getCount(CounterType.ENERGY) > 7) {
            Cost cost = new PayEnergyCost(8);
            if (controller.chooseUse(outcome, "Pay {E}{E}{E}{E}{E}{E}{E}{E} to use this? ", "Untap all creatures you control and after this phase, there is an additional combat phase.", "Yes", "No", source, game) && cost.pay(source, game, source, source.getControllerId(), true)) {
                new UntapAllControllerEffect(new FilterControlledCreaturePermanent()).apply(game, source);
                new AdditionalCombatPhaseEffect().apply(game, source);
            }
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) GetEnergyCountersControllerEffect(mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect) AdditionalCombatPhaseEffect(mage.abilities.effects.common.AdditionalCombatPhaseEffect) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) PayEnergyCost(mage.abilities.costs.common.PayEnergyCost) Cost(mage.abilities.costs.Cost) PayEnergyCost(mage.abilities.costs.common.PayEnergyCost) UntapAllControllerEffect(mage.abilities.effects.common.UntapAllControllerEffect)

Aggregations

Cost (mage.abilities.costs.Cost)1 PayEnergyCost (mage.abilities.costs.common.PayEnergyCost)1 AdditionalCombatPhaseEffect (mage.abilities.effects.common.AdditionalCombatPhaseEffect)1 UntapAllControllerEffect (mage.abilities.effects.common.UntapAllControllerEffect)1 GetEnergyCountersControllerEffect (mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect)1 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)1 Player (mage.players.Player)1