mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- 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:
@@ -189,6 +189,11 @@ public class GameAction {
|
||||
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) {
|
||||
c.getController().setRevolt(true);
|
||||
}
|
||||
|
||||
@@ -7111,4 +7111,12 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user