1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 09:11:04 -09:00

* Fixed Rage Extractor and Counterbalance not taking X value into account for calculating converted mana costs.

This commit is contained in:
LevelX2 2014-07-19 15:16:08 +02:00
parent 22697295a8
commit acd5db9e62
2 changed files with 8 additions and 7 deletions
Mage.Sets/src/mage/sets

View file

@ -42,7 +42,7 @@ import mage.constants.Zone;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.stack.StackObject; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
/** /**
@ -92,14 +92,14 @@ class CounterbalanceEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && sourcePermanent != null) { 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) { if (spell != null) {
Card topcard = controller.getLibrary().getFromTop(game); Card topcard = controller.getLibrary().getFromTop(game);
if (topcard != null) { if (topcard != null) {
CardsImpl cards = new CardsImpl(); CardsImpl cards = new CardsImpl();
cards.add(topcard); cards.add(topcard);
controller.revealCards(sourcePermanent.getName(), cards, game); 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); return game.getStack().counter(spell.getId(), source.getSourceId(), game);
} }
} }

View file

@ -41,6 +41,7 @@ import mage.cards.CardImpl;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
/** /**
@ -85,11 +86,11 @@ class RageExtractorTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.controllerId)) { if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.controllerId)) {
Card card = game.getCard(event.getSourceId()); Spell spell = (Spell) game.getStack().getStackObject(event.getTargetId());
if (card != null) { if (spell != null) {
for (ManaCost cost : card.getManaCost()) { for (ManaCost cost : spell.getCard().getManaCost()) {
if (cost instanceof PhyrexianManaCost) { 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; return true;
} }
} }