@Override public int getX() { int amount = 0; List<VariableCost> variableCosts = getVariableCosts(); if (!variableCosts.isEmpty()) { amount = variableCosts.get(0).getAmount(); } return amount; }
@Override public void setX(int x) { List<VariableCost> variableCosts = getVariableCosts(); if (!variableCosts.isEmpty()) { variableCosts.get(0).setAmount(x); } }
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()); } }