- Clean up PayX and SunburstValue when a card goes to a zone like graveyard,exile,etc., so that it's not remembered in case a card is replayed via something like Goblin Dark-Dwellers.

This commit is contained in:
Agetian
2017-06-28 19:37:42 +00:00
parent 392cceb083
commit 4e48078d2b
2 changed files with 13 additions and 0 deletions

View File

@@ -189,6 +189,11 @@ public class GameAction {
c.removeSVar("EndOfTurnLeavePlay"); c.removeSVar("EndOfTurnLeavePlay");
} }
// Clean up temporary variables such as Sunburst value or announced PayX value
if (!(zoneTo.is(ZoneType.Stack) || zoneTo.is(ZoneType.Battlefield))) {
c.clearTemporaryVars();
}
if (fromBattlefield && !toBattlefield) { if (fromBattlefield && !toBattlefield) {
c.getController().setRevolt(true); c.getController().setRevolt(true);
} }

View File

@@ -7111,4 +7111,12 @@ public class Card extends GameEntity implements Comparable<Card> {
this.addCounter(e.getKey(), e.getValue(), this, true); this.addCounter(e.getKey(), e.getValue(), this, true);
} }
} }
public final void clearTemporaryVars() {
// Add cleanup for all variables that are set temporarily but that need
// to be restored to their original value if a card changes zones
removeSVar("PayX"); // Temporary AI X announcement variable
setSunburstValue(0); // Sunburst
}
} }