summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index f027463..94ca4ef 100644
--- a/rules.js
+++ b/rules.js
@@ -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);