diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-22 20:58:29 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 12:53:17 +0100 |
commit | 080e364a2ef15a20ca242bb607cb80caa3ac3648 (patch) | |
tree | 95b2f12a467bf023fa78b8795a54b546fbf3d41d /rules.js | |
parent | a61433b1a2b11055b9a3a75d0ce04499be13986d (diff) | |
download | hammer-of-the-scots-080e364a2ef15a20ca242bb607cb80caa3ac3648.tar.gz |
hammer: End final winter turn early if possible.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -2276,6 +2276,22 @@ function king_can_go_home(current) { function goto_scottish_king() { print_turn_log_no_count("Scottish nobles go home:"); + // We can end winter early if Moray and Wallace are dead or on the map, and Moray is not overstacked + if (game.year == game.end_year) { + let e = count_english_nobles(); + let s = count_scottish_nobles(); + // We have a clear winner. + if (s > 7 || e > 7) + return goto_game_over(); + // Moray is dead so there can be no tie. + if (game.location[MORAY] == null) + return goto_game_over(); + // Wallace is dead so there can be no tie breaker. + if (game.location[WALLACE] == null) + return goto_game_over(); + // A tie is possible, need to continue to disband and build phase... + } + if (is_on_map(KING) && king_can_go_home(game.location[KING])) { game.state = 'scottish_king'; game.active = SCOTLAND; |