[FIX] References issue 282 - Fixes Phyrexian Arena, Punish Ignorance, Countersqual, Pyschic Barrier and adds LKI for spells that were countered.

This commit is contained in:
maurer.it 2011-10-17 20:28:43 -04:00
parent 7ef8070f6f
commit 515b718ad5
3 changed files with 29 additions and 10 deletions

View file

@ -38,6 +38,7 @@ import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.ReplacementEffect;
import mage.cards.Card;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
@ -87,6 +88,9 @@ public class SpellStack extends Stack<StackObject> {
StackObject stackObject = getStackObject(objectId);
if (stackObject != null) {
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) {
if ( stackObject instanceof Spell ) {
game.rememberLKI(objectId, Zone.STACK, (Spell)stackObject);
}
this.remove(stackObject);
stackObject.counter(sourceId, game);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId()));