From be57396131c9d64a515bbe2122f09783f7010d63 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 2 Apr 2022 01:23:07 +0200 Subject: Check instant victory after Winter Turn. --- rules.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 2b63890..c802a95 100644 --- a/rules.js +++ b/rules.js @@ -2813,6 +2813,17 @@ function goto_english_feudal_levy() { } function end_winter_turn() { + if (count_english_nobles() === 0) { + game.victory = "Scotland wins by controlling all the nobles!"; + game.result = SCOTLAND; + } + if (count_scottish_nobles() === 0) { + game.victory = "England wins by controlling all the nobles!"; + game.result = ENGLAND; + } + if (game.victory) + return goto_game_over(); + if (++game.year > game.end_year) goto_game_over(); else @@ -2839,6 +2850,7 @@ function goto_game_over() { } } } + log(""); log(game.victory); game.active = "None"; game.state = 'game_over'; -- cgit v1.2.3