summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-05-21 13:33:44 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:08:56 +0100
commit76a282cc3ae7e3c15a6fbd84ec8650077e77aecb (patch)
tree4185d4a4b9e667562a0900c8618f1b4414e9307e
parent8753a986615fef8a465b95137db8514ba32ce535 (diff)
downloadjulius-caesar-76a282cc3ae7e3c15a6fbd84ec8650077e77aecb.tar.gz
caesar: Show number of navis left to move to port.
-rw-r--r--rules.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index cd8c8ce..57bb672 100644
--- a/rules.js
+++ b/rules.js
@@ -2086,14 +2086,20 @@ states.navis_to_port = {
prompt: function (view, current) {
if (is_inactive_player(current))
return view.prompt = "Waiting for " + game.active + " to move navis to port...";
- view.prompt = "Move all Navis to a friendly port on the same sea.";
+ view.prompt = "Move all Navis to a friendly port.";
+ let count = 0;
for (let b in BLOCKS) {
- if (block_owner(b) == game.active && BLOCKS[b].type == 'navis')
- if (SPACES[game.location[b]].type == 'sea')
-
- if (can_navis_move_to_port(b))
+ if (block_owner(b) == game.active && BLOCKS[b].type == 'navis') {
+ if (SPACES[game.location[b]].type == 'sea') {
+ if (can_navis_move_to_port(b)) {
gen_action(view, 'block', b);
+ ++count;
+ }
+ }
+ }
}
+ if (count > 0)
+ view.prompt += " " + count + " left.";
gen_action_pass(view, "End navis to port");
gen_action_undo(view);
},