diff --git a/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfTwoDifferentColorsEffect.java b/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfTwoDifferentColorsEffect.java index 5b0aaaadef..834170cf94 100644 --- a/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfTwoDifferentColorsEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/mana/AddManaOfTwoDifferentColorsEffect.java @@ -4,6 +4,7 @@ package mage.abilities.effects.mana; import mage.Mana; import mage.abilities.Ability; import mage.choices.ManaChoice; +import mage.constants.ManaType; import mage.game.Game; import mage.players.Player; @@ -12,6 +13,32 @@ import java.util.List; public class AddManaOfTwoDifferentColorsEffect extends ManaEffect { + // Performing this calculation here since it never changes and should not be recalcualted each time. + private static final List<ManaType> colorsToCycle = new ArrayList<>(); + private static final List<Mana> netMana = new ArrayList<>(); + static { + // Add the colored mana in order to cycle through them + colorsToCycle.add(ManaType.WHITE); + colorsToCycle.add(ManaType.BLUE); + colorsToCycle.add(ManaType.BLACK); + colorsToCycle.add(ManaType.RED); + colorsToCycle.add(ManaType.GREEN); + + // Create the possible combinations of two mana + for (ManaType manaType1 : colorsToCycle) { + for (ManaType manaType2 : colorsToCycle) { + // Mana types must be different + if (manaType1 == manaType2) { + continue; + } + + Mana manaCombo = new Mana(manaType1); + manaCombo.increase(manaType2); + netMana.add(manaCombo); + } + } + } + public AddManaOfTwoDifferentColorsEffect() { super(); staticText = "Add two mana of different colors."; @@ -23,8 +50,6 @@ public class AddManaOfTwoDifferentColorsEffect extends ManaEffect { @Override public List<Mana> getNetMana(Game game, Ability source) { - List<Mana> netMana = new ArrayList<>(); - netMana.add(Mana.AnyMana(2)); return netMana; }