mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- When checking state-based effects, check the game over condition early to account for win conditions that trigger before the cards die due to zero toughness (e.g. Platinum Angel + lethal Hurricane that gets both players to zero or below).
- To be on the safe side I left the original check intact and I'm running it in case the first check wasn't positive, assuming that the situation may change somehow after all the card-based state effects are checked and relevant effects apply. Is this necessary? - Please test this in various win/lose conditions and let me know if anything is wrong with this approach, I can try to adapt or revert as necessary.
This commit is contained in:
@@ -691,6 +691,9 @@ public class GameAction {
|
|||||||
game.getStack().setFrozen(true);
|
game.getStack().setFrozen(true);
|
||||||
game.getTracker().freeze(); //prevent views flickering during while updating for state-based effects
|
game.getTracker().freeze(); //prevent views flickering during while updating for state-based effects
|
||||||
|
|
||||||
|
// check the game over condition early for win conditions such as Platinum Angel + Hurricane lethal for both players
|
||||||
|
checkGameOverCondition();
|
||||||
|
|
||||||
// do this multiple times, sometimes creatures/permanents will survive when they shouldn't
|
// do this multiple times, sometimes creatures/permanents will survive when they shouldn't
|
||||||
for (int q = 0; q < 9; q++) {
|
for (int q = 0; q < 9; q++) {
|
||||||
checkStaticAbilities(false, affectedCards);
|
checkStaticAbilities(false, affectedCards);
|
||||||
@@ -800,7 +803,12 @@ public class GameAction {
|
|||||||
game.fireEvent(new GameEventCardStatsChanged(affectedCards));
|
game.fireEvent(new GameEventCardStatsChanged(affectedCards));
|
||||||
}
|
}
|
||||||
|
|
||||||
checkGameOverCondition();
|
// recheck the game over condition at this point to make sure no other win conditions apply now.
|
||||||
|
// TODO: is this necessary at this point if it's checked early above anyway?
|
||||||
|
if (!game.isGameOver()) {
|
||||||
|
checkGameOverCondition();
|
||||||
|
}
|
||||||
|
|
||||||
if (game.getAge() != GameStage.Play) {
|
if (game.getAge() != GameStage.Play) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user