diff --git a/Mage.Sets/src/mage/sets/coldsnap/Counterbalance.java b/Mage.Sets/src/mage/sets/coldsnap/Counterbalance.java index c1be6a6024..de1b4dbc07 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/Counterbalance.java +++ b/Mage.Sets/src/mage/sets/coldsnap/Counterbalance.java @@ -42,7 +42,7 @@ import mage.constants.Zone; import mage.filter.FilterSpell; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.stack.StackObject; +import mage.game.stack.Spell; import mage.players.Player; /** @@ -92,14 +92,14 @@ class CounterbalanceEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { - StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); + Spell spell = (Spell) game.getStack().getStackObject(targetPointer.getFirst(game, source)); if (spell != null) { Card topcard = controller.getLibrary().getFromTop(game); if (topcard != null) { CardsImpl cards = new CardsImpl(); cards.add(topcard); controller.revealCards(sourcePermanent.getName(), cards, game); - if (topcard.getManaCost().convertedManaCost() == spell.getManaCost().convertedManaCost()) { + if (topcard.getManaCost().convertedManaCost() == spell.getConvertedManaCost()) { return game.getStack().counter(spell.getId(), source.getSourceId(), game); } } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java b/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java index 61d5ddda0e..f72b03b85b 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java @@ -41,6 +41,7 @@ import mage.cards.CardImpl; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.stack.Spell; import mage.target.common.TargetCreatureOrPlayer; /** @@ -85,11 +86,11 @@ class RageExtractorTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.controllerId)) { - Card card = game.getCard(event.getSourceId()); - if (card != null) { - for (ManaCost cost : card.getManaCost()) { + Spell spell = (Spell) game.getStack().getStackObject(event.getTargetId()); + if (spell != null) { + for (ManaCost cost : spell.getCard().getManaCost()) { if (cost instanceof PhyrexianManaCost) { - ((DamageTargetEffect)getEffects().get(0)).setAmount(new StaticValue(card.getManaCost().convertedManaCost())); + ((DamageTargetEffect)getEffects().get(0)).setAmount(new StaticValue(spell.getConvertedManaCost())); return true; } }