summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-27 18:55:06 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:38 +0100
commitdaeef6c6473cc6285f75f45f56e074c6acd0525e (patch)
tree3d0a98bbfd465d3886f74818792f770baa9068e9 /rules.js
parentabffcc1c2282123265784c899ce5c569b34da8e3 (diff)
downloadcrusader-rex-daeef6c6473cc6285f75f45f56e074c6acd0525e.tar.gz
crusader: Flash 'click next' when out of options in battles.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 7c7bd54..12b1174 100644
--- a/rules.js
+++ b/rules.js
@@ -2085,16 +2085,20 @@ states.combat_deployment = {
view.prompt = "Deploy blocks on the field and in the castle.";
let max = castle_limit(game.where);
let n = count_blocks_in_castle(game.where);
+ let have_options = false;
if (n < max) {
for (let b in BLOCKS) {
if (block_owner(b) == game.active && !is_reserve(b)) {
if (game.location[b] == game.where && !game.castle.includes(b)) {
gen_action(view, 'withdraw', b);
gen_action(view, 'block', b);
+ have_options = true;
}
}
}
}
+ if (!have_options)
+ view.flash_next = "Click Next when you're done.";
gen_action_undo(view);
gen_action(view, 'next');
},
@@ -2281,16 +2285,20 @@ states.declare_storm = {
if (is_inactive_player(current))
return view.prompt = "Siege Declaration: Waiting for " + game.active + " to declare storm.";
view.prompt = "Siege Declaration: Declare which blocks should storm the castle.";
+ let have_options = false;
if (game.storming.length < castle_limit(game.where)) {
for (let b in BLOCKS) {
if (block_owner(b) == game.active && !is_reserve(b)) {
if (game.location[b] == game.where && !game.storming.includes(b)) {
gen_action(view, 'storm', b);
gen_action(view, 'block', b);
+ have_options = true;
}
}
}
}
+ if (!have_options)
+ view.flash_next = "Click Next when you're done.";
gen_action_undo(view);
gen_action(view, 'next');
},
@@ -2337,14 +2345,18 @@ states.declare_sally = {
if (is_inactive_player(current))
return view.prompt = "Siege Declaration: Waiting for " + game.active + " to declare sally.";
view.prompt = "Siege Declaration: Declare which blocks should sally onto the field.";
+ let have_options = false;
for (let b in BLOCKS) {
if (block_owner(b) == game.active && !is_reserve(b) && is_block_in_castle(b)) {
if (game.location[b] == game.where && !game.sallying.includes(b)) {
gen_action(view, 'sally', b);
gen_action(view, 'block', b);
+ have_options = true;
}
}
}
+ if (!have_options)
+ view.flash_next = "Click Next when you're done.";
gen_action_undo(view);
gen_action(view, 'next');
},