diff options
-rw-r--r-- | rules.js | 32 |
1 files changed, 20 insertions, 12 deletions
@@ -1595,14 +1595,19 @@ states.greek_naval_retreat_attacker = { states.persian_naval_retreat_defender = { prompt: function (view, current) { - if (is_inactive_player(current)) - return view.prompt = "Persian Naval Battle: Defender retreat?"; - view.prompt = "Persian Naval Battle: Continue the battle in " + game.where + " or retreat?"; - gen_action(view, 'port', game.where); // shortcut for battle - if (game.greek.event !== THEMISTOCLES) + if (game.greek.event === THEMISTOCLES) { + if (is_inactive_player(current)) + return view.prompt = "Persian Naval Battle: Continue the battle."; + view.prompt = "Persian Naval Battle: Continue the battle in " + game.where + "."; + } else { + if (is_inactive_player(current)) + return view.prompt = "Persian Naval Battle: Defender retreat?"; + view.prompt = "Persian Naval Battle: Continue the battle in " + game.where + " or retreat?"; for (let port of PORTS) if (is_greek_control(port) && count_persian_fleets(port) === 0) gen_action(view, 'port', port); + } + gen_action(view, 'port', game.where); // shortcut for battle gen_action(view, 'battle'); }, port: function (to) { @@ -1623,14 +1628,19 @@ states.persian_naval_retreat_defender = { states.greek_naval_retreat_defender = { prompt: function (view, current) { - if (is_inactive_player(current)) - return view.prompt = "Greek Naval Battle: Defender retreat?"; - view.prompt = "Greek Naval Battle: Continue the battle in " + game.where + " or retreat?"; - gen_action(view, 'port', game.where); // shortcut for battle - if (game.greek.event !== THEMISTOCLES) + if (game.greek.event === THEMISTOCLES) { + if (is_inactive_player(current)) + return view.prompt = "Greek Naval Battle: Continue the battle."; + view.prompt = "Greek Naval Battle: Continue the battle in " + game.where + "."; + } else { + if (is_inactive_player(current)) + return view.prompt = "Greek Naval Battle: Defender retreat?"; + view.prompt = "Greek Naval Battle: Continue the battle in " + game.where + " or retreat?"; for (let port of PORTS) if (is_persian_control(port) && count_greek_fleets(port) === 0) gen_action(view, 'port', port); + } + gen_action(view, 'port', game.where); // shortcut for battle gen_action(view, 'battle'); }, port: function (to) { @@ -3457,8 +3467,6 @@ exports.resign = function (state, current) { return game; } -exports.is_checkpoint = (a, b) => a.campaign !== b.campaign; - exports.view = function(state, current) { game = state; |