Search in sources :

Example 6 with GenericManaCost

use of mage.abilities.costs.mana.GenericManaCost in project mage by magefree.

the class DancingSwordEffect method apply.

@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
    Permanent permanent = source.getSourcePermanentIfItStillExists(game);
    if (permanent == null) {
        discard();
        return false;
    }
    switch(layer) {
        case TypeChangingEffects_4:
            permanent.removeAllCardTypes();
            permanent.addCardType(game, CardType.ARTIFACT);
            permanent.addCardType(game, CardType.CREATURE);
            permanent.removeAllSubTypes(game);
            permanent.addSubType(game, SubType.CONSTRUCT);
            return true;
        case AbilityAddingRemovingEffects_6:
            permanent.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game);
            permanent.addAbility(new WardAbility(new GenericManaCost(1)), source.getSourceId(), game);
            return true;
        case PTChangingEffects_7:
            if (sublayer == SubLayer.SetPT_7b) {
                permanent.getPower().setValue(2);
                permanent.getToughness().setValue(1);
                return true;
            }
    }
    return false;
}
Also used : Permanent(mage.game.permanent.Permanent) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) WardAbility(mage.abilities.keyword.WardAbility)

Example 7 with GenericManaCost

use of mage.abilities.costs.mana.GenericManaCost in project mage by magefree.

the class ScentOfBrineEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source, source.getControllerId(), true)) {
        return false;
    }
    int xValue = cost.getNumberRevealedCards();
    return new CounterUnlessPaysEffect(new GenericManaCost(xValue)).apply(game, source);
}
Also used : CounterUnlessPaysEffect(mage.abilities.effects.common.CounterUnlessPaysEffect) RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) TargetCardInHand(mage.target.common.TargetCardInHand)

Example 8 with GenericManaCost

use of mage.abilities.costs.mana.GenericManaCost in project mage by magefree.

the class DepalaPilotExemplarEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        ManaCosts<ManaCost> cost = new ManaCostsImpl<>("{X}");
        int xValue = controller.announceXMana(0, Integer.MAX_VALUE, "Choose the amount of mana to pay", game, source);
        cost.add(new GenericManaCost(xValue));
        if (cost.pay(source, game, source, source.getControllerId(), false) && xValue > 0) {
            new RevealLibraryPutIntoHandEffect(xValue, filter, Zone.LIBRARY, false).apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) ManaCost(mage.abilities.costs.mana.ManaCost) RevealLibraryPutIntoHandEffect(mage.abilities.effects.common.RevealLibraryPutIntoHandEffect) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl)

Example 9 with GenericManaCost

use of mage.abilities.costs.mana.GenericManaCost in project mage by magefree.

the class StoryweaveWatcher method makeAbility.

public static Ability makeAbility() {
    // for testing purposes
    Ability ability = new SimpleActivatedAbility(new StoryweaveReplacementEffect(), new GenericManaCost(0));
    ability.addWatcher(new StoryweaveWatcher());
    return ability;
}
Also used : SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) Ability(mage.abilities.Ability) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility)

Example 10 with GenericManaCost

use of mage.abilities.costs.mana.GenericManaCost in project mage by magefree.

the class VolrathTheShapestealerCopyApplier method apply.

@Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID copyToObjectId) {
    Ability ability = new SimpleActivatedAbility(new VolrathTheShapestealerEffect(), new GenericManaCost(1));
    ability.addTarget(new TargetPermanent(VolrathTheShapestealer.filter));
    blueprint.getAbilities().add(ability);
    blueprint.removePTCDA();
    blueprint.getPower().modifyBaseValue(7);
    blueprint.getToughness().modifyBaseValue(5);
    return true;
}
Also used : BeginningOfCombatTriggeredAbility(mage.abilities.common.BeginningOfCombatTriggeredAbility) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) Ability(mage.abilities.Ability) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) TargetPermanent(mage.target.TargetPermanent)

Aggregations

GenericManaCost (mage.abilities.costs.mana.GenericManaCost)31 Player (mage.players.Player)15 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)12 Permanent (mage.game.permanent.Permanent)10 ManaCosts (mage.abilities.costs.mana.ManaCosts)7 Ability (mage.abilities.Ability)6 CounterUnlessPaysEffect (mage.abilities.effects.common.CounterUnlessPaysEffect)6 FixedTarget (mage.target.targetpointer.FixedTarget)5 SpellAbility (mage.abilities.SpellAbility)4 PassAbility (mage.abilities.common.PassAbility)4 SimpleActivatedAbility (mage.abilities.common.SimpleActivatedAbility)4 ReflexiveTriggeredAbility (mage.abilities.common.delayed.ReflexiveTriggeredAbility)4 ManaCost (mage.abilities.costs.mana.ManaCost)4 Effect (mage.abilities.effects.Effect)3 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)3 StackAbility (mage.game.stack.StackAbility)3 ActivatedAbility (mage.abilities.ActivatedAbility)2 RevealTargetFromHandCost (mage.abilities.costs.common.RevealTargetFromHandCost)2 TapSourceCost (mage.abilities.costs.common.TapSourceCost)2 AddCountersSourceEffect (mage.abilities.effects.common.counter.AddCountersSourceEffect)2