int multiplier = variableManaCost.getMultiplier(); for (int mana = variableManaCost.getMinX(); mana <= numAvailable; mana++) { if (mana % multiplier == 0) { // use only values dependant from multiplier int xAmount = mana / multiplier;
if (!variableManaCost.isPaid()) { // should only happen for human players if (!noMana) { xValue = controller.announceXMana(variableManaCost.getMinX(), variableManaCost.getMaxX(), "Announce the value for " + variableManaCost.getText(), game, this); int amountMana = xValue * variableManaCost.getMultiplier(); StringBuilder manaString = threadLocalBuilder.get();
private void addKickerCostsToAbility(Cost cost, Ability ability, Game game) { if (cost instanceof ManaCostsImpl) { @SuppressWarnings("unchecked") List<VariableManaCost> varCosts = ((ManaCostsImpl) cost).getVariableCosts(); if (!varCosts.isEmpty()) { // use only first variable cost xManaValue = game.getPlayer(this.controllerId).announceXMana(varCosts.get(0).getMinX(), Integer.MAX_VALUE, "Announce kicker value for " + varCosts.get(0).getText(), game, this); // kicker variable X costs handled internally as multikicker with {1} cost (no multikicker on card) if (!game.isSimulation()) { game.informPlayers(game.getPlayer(this.controllerId).getLogName() + " announced a value of " + xManaValue + " for " + " kicker X "); } ability.getManaCostsToPay().add(new GenericManaCost(xManaValue)); ManaCostsImpl<ManaCost> kickerManaCosts = (ManaCostsImpl) cost; for (ManaCost manaCost : kickerManaCosts) { if (!(manaCost instanceof VariableManaCost)) { ability.getManaCostsToPay().add(manaCost.copy()); } } } else { ability.getManaCostsToPay().add((ManaCostsImpl) cost.copy()); } } else { ability.getCosts().add(cost.copy()); } }