* Soulfire Grand Master - Fixed that a countered spell did wrongly return to hand if second ability was used.

This commit is contained in:
LevelX2 2015-04-18 11:53:51 +02:00
parent 2d3c98a7b4
commit 47b1753519
5 changed files with 102 additions and 37 deletions

View file

@ -82,6 +82,7 @@ public class Spell implements StackObject, Card {
private UUID controllerId;
private boolean copiedSpell;
private boolean faceDown;
private boolean countered;
public Spell(Card card, SpellAbility ability, UUID controllerId, Zone fromZone) {
this.card = card;
@ -100,6 +101,7 @@ public class Spell implements StackObject, Card {
}
this.controllerId = controllerId;
this.fromZone = fromZone;
this.countered = false;
}
public Spell(final Spell spell) {
@ -521,6 +523,7 @@ public class Spell implements StackObject, Card {
@Override
public void counter(UUID sourceId, Game game) {
this.countered = true;
if (!isCopiedSpell()) {
card.moveToZone(Zone.GRAVEYARD, sourceId, game, false);
}
@ -1002,4 +1005,8 @@ public class Spell implements StackObject, Card {
throw new UnsupportedOperationException("Not supported.");
}
public boolean isCountered() {
return countered;
}
}

View file

@ -97,9 +97,10 @@ public class SpellStack extends ArrayDeque<StackObject> {
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) {
if ( stackObject instanceof Spell ) {
game.rememberLKI(objectId, Zone.STACK, (Spell)stackObject);
} else {
this.remove(stackObject);
}
this.remove(stackObject);
stackObject.counter(sourceId, game); // tries to move to graveyard
stackObject.counter(sourceId, game);
if (!game.isSimulation())
game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName());
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId()));