mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge branch 'sim-draw-npe' into 'master'
add a draw condition for sim if players life total both equal 0 See merge request core-developers/forge!3248
This commit is contained in:
@@ -202,7 +202,14 @@ public class SimulateMatch {
|
||||
System.out.println(l);
|
||||
}
|
||||
|
||||
System.out.println(String.format("\nGame %d ended in %d ms. %s has won!\n", 1+iGame, sw.getTime(), g1.getOutcome().getWinningLobbyPlayer().getName()));
|
||||
// If both players life totals to 0 in a single turn, the game should end in a draw
|
||||
if(g1.getOutcome().getLifeDelta() == 0){
|
||||
g1.setGameOver(GameEndReason.Draw);
|
||||
System.out.println(String.format("Game %d ended in a Draw! Took %d ms.", 1+iGame, sw.getTime()));
|
||||
sw.stop();
|
||||
} else {
|
||||
System.out.println(String.format("\nGame %d ended in %d ms. %s has won!\n", 1+iGame, sw.getTime(), g1.getOutcome().getWinningLobbyPlayer().getName()));
|
||||
}
|
||||
}
|
||||
|
||||
private static void simulateTournament(Map<String, List<String>> params, GameRules rules, boolean outputGamelog) {
|
||||
|
||||
Reference in New Issue
Block a user