use of mage.abilities.costs.common.RemoveVariableCountersTargetCost in project mage by magefree.
the class OozeFluxCreateTokenEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int xValue = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof RemoveVariableCountersTargetCost) {
xValue = ((RemoveVariableCountersTargetCost) cost).getAmount();
break;
}
}
Token tokenCopy = token.copy();
tokenCopy.getAbilities().newId();
tokenCopy.getPower().modifyBaseValue(xValue);
tokenCopy.getToughness().modifyBaseValue(xValue);
tokenCopy.putOntoBattlefield(1, game, source, source.getControllerId());
return true;
}
use of mage.abilities.costs.common.RemoveVariableCountersTargetCost in project mage by magefree.
the class GallopingLizrogEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
RemoveVariableCountersTargetCost variableCost = new RemoveVariableCountersTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURE, CounterType.P1P1);
int toPay = variableCost.announceXValue(source, game);
Cost cost = variableCost.getFixedCostsFromAnnouncedValue(toPay);
if (!cost.pay(source, game, source, source.getControllerId(), true)) {
return false;
}
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(2 * toPay)).apply(game, source);
}
Aggregations