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;
}
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);
}
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;
}
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;
}
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;
}
Aggregations