From 9a28f8d6781c376766b82b59d1a4f9ba59adc906 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 4 Nov 2017 16:48:13 +0100 Subject: [PATCH] * Fixed that conditional mana colors were not tracked correctly for abilities like Converge. --- Mage/src/main/java/mage/players/ManaPool.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/players/ManaPool.java b/Mage/src/main/java/mage/players/ManaPool.java index e55444bf3d..62ddedf6d6 100644 --- a/Mage/src/main/java/mage/players/ManaPool.java +++ b/Mage/src/main/java/mage/players/ManaPool.java @@ -125,7 +125,7 @@ public class ManaPool implements Serializable { } if (getConditional(manaType, ability, filter, game, costToPay) > 0) { - removeConditional(manaType, ability, game, costToPay); + removeConditional(manaType, ability, game, costToPay, usedManaToPay); lockManaType(); // pay only one mana if mana payment is set to manually return true; } @@ -437,10 +437,11 @@ public class ManaPool implements Serializable { return new ManaPool(this); } - private void removeConditional(ManaType manaType, Ability ability, Game game, Cost costToPay) { + private void removeConditional(ManaType manaType, Ability ability, Game game, Cost costToPay, Mana usedManaToPay) { for (ConditionalMana mana : getConditionalMana()) { if (mana.get(manaType) > 0 && mana.apply(ability, game, mana.getManaProducerId(), costToPay)) { mana.set(manaType, mana.get(manaType) - 1); + usedManaToPay.increase(manaType); GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAID, ability.getId(), mana.getManaProducerId(), ability.getControllerId(), 0, mana.getFlag()); event.setData(mana.getManaProducerOriginalId().toString()); game.fireEvent(event);