From a3db429525328303f377b66cdeb53d1ad10fd652 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Dec 2014 21:32:18 +0100 Subject: [PATCH] * Fixed mana effect, that added addional mana to the effect controller instead of the controller of the mana source (Dictate of Karametra, Keeper of Progenitus, Heartbeat of Spring, Zur-Taa Ancient). --- .../AddManaOfAnyColorTargetCanProduceEffect.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/AddManaOfAnyColorTargetCanProduceEffect.java b/Mage/src/mage/abilities/effects/common/AddManaOfAnyColorTargetCanProduceEffect.java index 36a5c4e82be..32c2dd833a1 100644 --- a/Mage/src/mage/abilities/effects/common/AddManaOfAnyColorTargetCanProduceEffect.java +++ b/Mage/src/mage/abilities/effects/common/AddManaOfAnyColorTargetCanProduceEffect.java @@ -57,9 +57,12 @@ public class AddManaOfAnyColorTargetCanProduceEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(this.targetPointer.getFirst(game, source)); - if (controller != null && permanent != null) { + if (permanent != null) { + Player targetController = game.getPlayer(permanent.getControllerId()); + if (targetController == null) { + return false; + } Abilities mana = permanent.getAbilities().getManaAbilities(Zone.BATTLEFIELD); Mana types = new Mana(); for (ManaAbility ability : mana) { @@ -91,7 +94,7 @@ public class AddManaOfAnyColorTargetCanProduceEffect extends ManaEffect { if (choice.getChoices().size() == 1) { choice.setChoice(choice.getChoices().iterator().next()); } else { - controller.choose(outcome, choice, game); + targetController.choose(outcome, choice, game); } if (choice.getChoice() == null) { return false; @@ -117,7 +120,7 @@ public class AddManaOfAnyColorTargetCanProduceEffect extends ManaEffect { newMana.setColorless(1); break; } - controller.getManaPool().addMana(newMana, game, source); + targetController.getManaPool().addMana(newMana, game, source); checkToFirePossibleEvents(newMana, game, source); } return true;