* Fixed a bug that cost adjustments for costs of abilities that had multiple ManaCost objects in the ManaCosts could be applied muliple times (e.g. Everflowing Chalice with Thorn of Amethyst).

This commit is contained in:
LevelX2 2015-04-25 19:11:49 +02:00
parent b846d0c411
commit 167bf8be3c
2 changed files with 3 additions and 2 deletions

View file

@ -218,8 +218,9 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
// 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())
if (!game.isSimulation()) {
game.informPlayers(new StringBuilder(game.getPlayer(this.controllerId).getName()).append(" announced a value of ").append(xManaValue).append(" for ").append(" kicker X ").toString());
}
ability.getManaCostsToPay().add(new GenericManaCost(xManaValue));
} else {
ability.getManaCostsToPay().add((ManaCostsImpl) cost.copy());

View file

@ -221,7 +221,7 @@ public class CardUtil {
for (ManaCost manaCost : manaCosts) {
Mana mana = manaCost.getOptions().get(0);
int colorless = mana != null ? mana.getColorless() : 0;
if (colorless > 0) {
if (!updated && restToReduce != 0 && colorless > 0) {
if ((colorless - restToReduce) > 0) {
int newColorless = colorless - restToReduce;
adjustedCost.add(new GenericManaCost(newColorless));