From 0d49ccb6230899d55124da8974f49399c3aa5cf2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 19 Nov 2012 23:03:24 +0100 Subject: [PATCH] Fixed Centaur Omenreader not reducing creature casting mana costs. --- .../sets/futuresight/CentaurOmenreader.java | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/sets/futuresight/CentaurOmenreader.java b/Mage.Sets/src/mage/sets/futuresight/CentaurOmenreader.java index 4b47590f1d..4c6afb515d 100644 --- a/Mage.Sets/src/mage/sets/futuresight/CentaurOmenreader.java +++ b/Mage.Sets/src/mage/sets/futuresight/CentaurOmenreader.java @@ -34,8 +34,6 @@ import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; -import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.cost.SpellsCostReductionEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; @@ -60,11 +58,7 @@ public class CentaurOmenreader extends CardImpl { this.toughness = new MageInt(3); // As long as Centaur Omenreader is tapped, creature spells you cast cost {2} less to cast. - ConditionalContinousEffect effect = new ConditionalContinousEffect( - new SpellsCostReductionEffect(new FilterCreatureCard("creature spells"), 2), - TappedCondition.getInstance(), - "As long as {this} is tapped, creature spells you cast cost {2} less to cast"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CentaurOmenreaderSpellsCostReductionEffect())); } public CentaurOmenreader(final CentaurOmenreader card) { @@ -77,18 +71,27 @@ public class CentaurOmenreader extends CardImpl { } } -class TappedCondition implements Condition { +class CentaurOmenreaderSpellsCostReductionEffect extends SpellsCostReductionEffect { - private static TappedCondition fInstance = new TappedCondition(); + public CentaurOmenreaderSpellsCostReductionEffect() { + super(new FilterCreatureCard("creature spells"), 2); + } - public static Condition getInstance() { - return fInstance; + protected CentaurOmenreaderSpellsCostReductionEffect(SpellsCostReductionEffect effect) { + super(effect); } @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - - return permanent != null && permanent.isTapped(); + public boolean applies(Ability abilityToModify, Ability source, Game game) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent != null && sourcePermanent.isTapped()) { + return super.applies(abilityToModify, source, game); + } + return false; } -} + + @Override + public CentaurOmenreaderSpellsCostReductionEffect copy() { + return new CentaurOmenreaderSpellsCostReductionEffect(this); + } +} \ No newline at end of file