diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-07-09 20:11:47 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-09 20:11:47 +0200 |
commit | 70520cf7f360d8f2bbce1557ea1c40dbd53710f4 (patch) | |
tree | 3426ebceb95e5f40f5c1b7f956c5dddeb63a8a69 | |
parent | 2b1eaf95c116ce95751b44912e0c0e804bbcbce8 (diff) | |
download | richard-iii-70520cf7f360d8f2bbce1557ea1c40dbd53710f4.tar.gz |
Fix regroup with piracy and _not_ attacker.
-rw-r--r-- | rules.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -2696,6 +2696,10 @@ function goto_regroup() { clear_undo() } +function is_attacker_with_piracy() { + game.active === game.piracy && game.active === game.attacker[game.where] +} + states.regroup = { prompt: function (view, current) { if (is_inactive_player(current)) @@ -2705,7 +2709,7 @@ states.regroup = { gen_action(view, 'end_regroup') for (let b = 0; b < block_count; ++b) { if (game.location[b] === game.where) { - if (game.active === game.piracy) { + if (is_attacker_with_piracy()) { if (set_has(game.is_pirate, b)) gen_action(view, 'block', b) } else { @@ -2731,7 +2735,7 @@ states.regroup = { states.regroup_to = { prompt: function (view, current) { - if (game.active === game.piracy && set_has(game.is_pirate, game.who)) { + if (is_attacker_with_piracy() && set_has(game.is_pirate, game.who)) { if (is_inactive_player(current)) return view.prompt = "Waiting for " + game.active + " to regroup." view.prompt = "Regroup: Move the army to a friendly or vacant area in the same sea zone." |