summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-04-02 01:23:07 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 12:53:18 +0100
commitbe57396131c9d64a515bbe2122f09783f7010d63 (patch)
treeec7ee9fb1bf5916634980ee5eb696bbd02bdfb8a
parent91af980dfff5ea7648ce882c3ae3d2b94eb96fa1 (diff)
downloadhammer-of-the-scots-be57396131c9d64a515bbe2122f09783f7010d63.tar.gz
Check instant victory after Winter Turn.
-rw-r--r--rules.js12
1 files changed, 12 insertions, 0 deletions
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';