diff options
-rw-r--r-- | rules.js | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -1934,12 +1934,17 @@ states.ops_american_reinforcements_where = { inactive: "to reinforce", prompt() { view.prompt = "Reinforcements: Choose a space." - view.move = { from: AMERICAN_REINFORCEMENTS, to: AMERICAN_REINFORCEMENTS, who: game.who, carry_american: game.count } view.selected_general = game.who - gen_american_reinforcements_where(game.who) + if (game.who === ROCHAMBEAU && location_of_general(ROCHAMBEAU) === FRENCH_REINFORCEMENTS) { + view.move = { from: FRENCH_REINFORCEMENTS, to: FRENCH_REINFORCEMENTS, who: game.who, carry_american: 0, carry_french: 5 } + gen_french_reinforcements_where(game.who) + } else { + view.move = { from: AMERICAN_REINFORCEMENTS, to: AMERICAN_REINFORCEMENTS, who: game.who, carry_american: game.count } + gen_american_reinforcements_where(game.who) + } }, space(space) { - if (game.who === ROCHAMBEAU) + if (game.who === ROCHAMBEAU && location_of_general(ROCHAMBEAU) === FRENCH_REINFORCEMENTS) place_french_reinforcements(game.who, space) else place_american_reinforcements(game.who, game.count, space) @@ -1986,12 +1991,15 @@ function gen_american_reinforcements_who() { function gen_american_reinforcements_where(general) { for (let space of all_spaces) { if (!has_british_cu(space) && !has_british_pc(space)) { - if (general === ROCHAMBEAU) { - if (is_port(space)) - gen_action_space(space) - } else { - gen_action_space(space) - } + gen_action_space(space) + } + } +} + +function gen_french_reinforcements_where(general) { + for (let space of all_port_spaces) { + if (!has_british_cu(space) && !has_british_pc(space)) { + gen_action_space(space) } } } @@ -4140,8 +4148,6 @@ function goto_place_rochambeau() { if (can_place_rochambeau()) { game.state = "place_rochambeau" } else { - move_general(ROCHAMBEAU, AMERICAN_REINFORCEMENTS) - move_french_cu(FRENCH_REINFORCEMENTS, AMERICAN_REINFORCEMENTS, 5) end_place_rochambeau() } } |