diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-05-21 13:33:44 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:08:56 +0100 |
commit | 76a282cc3ae7e3c15a6fbd84ec8650077e77aecb (patch) | |
tree | 4185d4a4b9e667562a0900c8618f1b4414e9307e /rules.js | |
parent | 8753a986615fef8a465b95137db8514ba32ce535 (diff) | |
download | julius-caesar-76a282cc3ae7e3c15a6fbd84ec8650077e77aecb.tar.gz |
caesar: Show number of navis left to move to port.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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); }, |