From 342b4486e86a725e56da592975466aaac5e4321b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 14 May 2018 13:53:09 -0400 Subject: [PATCH] fixed Damping Sphere not reducing sources of conditional mana (such as Eldrazi Temple and Mishra's Workshop) --- .../AddConditionalColorlessManaEffect.java | 37 +------------------ .../mana/AddConditionalManaEffect.java | 3 ++ 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalColorlessManaEffect.java b/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalColorlessManaEffect.java index 057985a45b..7a2822f2f8 100644 --- a/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalColorlessManaEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalColorlessManaEffect.java @@ -6,57 +6,24 @@ package mage.abilities.effects.mana; import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.effects.common.ManaEffect; import mage.abilities.mana.builder.ConditionalManaBuilder; -import mage.game.Game; -import mage.players.Player; /** * * @author LevelX2 */ -public class AddConditionalColorlessManaEffect extends ManaEffect { - - private final int amount; - private final ConditionalManaBuilder manaBuilder; +public class AddConditionalColorlessManaEffect extends AddConditionalManaEffect { public AddConditionalColorlessManaEffect(int amount, ConditionalManaBuilder manaBuilder) { - super(); - this.amount = amount; - this.manaBuilder = manaBuilder; - - staticText = "Add " + String.format(String.format("%%%ds", amount), " ").replace(" ", "{C}") - + ". " + manaBuilder.getRule(); + super(Mana.ColorlessMana(amount), manaBuilder); } public AddConditionalColorlessManaEffect(final AddConditionalColorlessManaEffect effect) { super(effect); - this.amount = effect.amount; - this.manaBuilder = effect.manaBuilder; } @Override public AddConditionalColorlessManaEffect copy() { return new AddConditionalColorlessManaEffect(this); } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - controller.getManaPool().addMana(getMana(game, source), game, source); - return true; - } - return false; - } - - @Override - public Mana produceMana(boolean netMana, Game game, Ability source) { - return manaBuilder.setMana(Mana.ColorlessMana(amount), source, game).build(); - } - - public Mana getMana() { - return Mana.ColorlessMana(amount); - } } diff --git a/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalManaEffect.java b/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalManaEffect.java index d8e4bca588..3ee00370ff 100644 --- a/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalManaEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/mana/AddConditionalManaEffect.java @@ -54,4 +54,7 @@ public class AddConditionalManaEffect extends ManaEffect { return manaBuilder.setMana(mana, source, game).build(); } + public Mana getMana() { + return mana; + } }