Search in sources :

Example 1 with UntapAllControllerEffect

use of mage.abilities.effects.common.UntapAllControllerEffect 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)

Example 2 with UntapAllControllerEffect

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

the class HellkiteChargerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
        ManaCosts cost = new ManaCostsImpl("{5}{R}{R}");
        if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + '?', source, game)) {
            cost.clearPaid();
            if (cost.pay(source, game, source, source.getControllerId(), false, null)) {
                new UntapAllControllerEffect(new FilterAttackingCreature(), "").apply(game, source);
                game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
                return true;
            }
        }
    }
    return false;
}
Also used : ManaCosts(mage.abilities.costs.mana.ManaCosts) FilterAttackingCreature(mage.filter.common.FilterAttackingCreature) Player(mage.players.Player) TurnMod(mage.game.turn.TurnMod) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) UntapAllControllerEffect(mage.abilities.effects.common.UntapAllControllerEffect)

Aggregations

UntapAllControllerEffect (mage.abilities.effects.common.UntapAllControllerEffect)2 Player (mage.players.Player)2 Cost (mage.abilities.costs.Cost)1 PayEnergyCost (mage.abilities.costs.common.PayEnergyCost)1 ManaCosts (mage.abilities.costs.mana.ManaCosts)1 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)1 AdditionalCombatPhaseEffect (mage.abilities.effects.common.AdditionalCombatPhaseEffect)1 GetEnergyCountersControllerEffect (mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect)1 FilterAttackingCreature (mage.filter.common.FilterAttackingCreature)1 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)1 TurnMod (mage.game.turn.TurnMod)1