summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-07-17 22:53:18 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:39 +0100
commit6ce2ff478ce42be456b1f31269991bd71cf02d89 (patch)
tree8f2f274aafcb442aaa6d9d939507c3af14e8c50d /rules.js
parentc39b3aaed8203fcc7565297532a0695302260e22 (diff)
downloadcrusader-rex-6ce2ff478ce42be456b1f31269991bd71cf02d89.tar.gz
crusader: Only show "Next" during draw phase if block cannot be placed.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 1f50b3e..e4d0825 100644
--- a/rules.js
+++ b/rules.js
@@ -3232,17 +3232,21 @@ states.draw_phase = {
prompt: function (view, current) {
if (is_inactive_player(current))
return view.prompt = "Draw Phase: Waiting for " + game.active + ".";
- gen_action(view, 'next');
+ let can_place = false;
switch (block_type(game.who)) {
case 'crusaders':
view.prompt = "Draw Phase: Place " + block_name(game.who) + " in the staging area.";
gen_action(view, 'town', block_home(game.who));
+ can_place = true;
break;
case 'pilgrims':
view.prompt = "Draw Phase: Place " + block_name(game.who) + " in a friendly port.";
- for (let town in TOWNS)
- if (is_friendly_port(town) || can_enter_besieged_port(town))
+ for (let town in TOWNS) {
+ if (is_friendly_port(town) || can_enter_besieged_port(town)) {
gen_action(view, 'town', town);
+ can_place = true;
+ }
+ }
break;
case 'turcopoles':
case 'outremers':
@@ -3254,11 +3258,15 @@ states.draw_phase = {
if (town === ENGLAND || town === FRANCE || town === GERMANIA)
continue;
// FAQ claims besieger controls town for draw purposes
- if (is_friendly_field(town))
+ if (is_friendly_field(town)) {
gen_action(view, 'town', town);
+ can_place = true;
+ }
}
break;
}
+ if (!can_place)
+ gen_action(view, 'next');
},
town: function (where) {
let type = block_type(game.who);