diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-09 18:08:00 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-09 18:08:00 +0200 |
commit | 9926d6955fb30e9e17312ffeacfc21a4766d8208 (patch) | |
tree | d1ee9234e6efe1753cd9c4fbb41d5fe2aeb617a7 /rules.js | |
parent | 1c72b0872bf32120bf203ac1a3d46d394207cde4 (diff) | |
download | washingtons-war-9926d6955fb30e9e17312ffeacfc21a4766d8208.tar.gz |
fix dead end on john_glovers_marblehead_regiment
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -329,6 +329,9 @@ function can_play_event(c) { case 'after_french_alliance': return game.french_alliance_triggered; case 'european_war_in_effect': return game.european_war; } + switch (card.event) { + case 'john_glovers_marblehead_regiment': return has_general_on_map(); + } return true; } @@ -701,6 +704,27 @@ function count_friendly_generals(where) { return count; } +function has_general_on_map() { + if (game.active == BRITISH) + return has_british_general_on_map(); + else + return has_american_general_on_map(); +} + +function has_british_general_on_map() { + for (let g of BRITISH_GENERALS) + if (is_general_on_map(g)) + return true; + return false; +} + +function has_american_general_on_map() { + for (let g of AMERICAN_GENERALS) + if (is_general_on_map(g)) + return true; + return false; +} + function can_activate_general(c) { if (game.active == BRITISH) return can_activate_british_general(c); |