diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-07-04 00:00:09 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-08-21 00:28:20 +0200 |
commit | 0eaed15c92906fe4faa53f248bebba12f9c737e2 (patch) | |
tree | b386a70f06ac19aa8164d5066af6fc251be6e4df | |
parent | b229c12bcc1796936e8ef78d15d7fad20f219df9 (diff) | |
download | washingtons-war-0eaed15c92906fe4faa53f248bebba12f9c737e2.tar.gz |
remove stacked general when placing rochambeau
-rw-r--r-- | rules.js | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -1,7 +1,7 @@ "use strict" // TODO: capture washington -// TODO: remove general after placing rochambeau +// TODO: draw after battle - delay until end of campaign /* washington's capture - winning general with no CU on enemy PC (no undo anyway) @@ -1502,10 +1502,6 @@ function goto_ops_reinforcements(c) { } } -// TODO: british reinforcements: pick general -// TODO: british reinforcements: pick number of CU -// TODO: british reinforcements: pick destination - states.ops_british_reinforcements_who = { prompt() { view.prompt = "Reinforcements: choose an available general." @@ -1640,13 +1636,6 @@ function gen_american_reinforcements_where(general) { /* PLAY OPS CARD TO MOVE A GENERAL */ -// TODO: new procedure: -// 1) pick general -// 2) take CU -// 3) drop CU / take CU / move to space -// 4) confirm move if intercept/battle -// 5) goto battle/intercept/3 - function goto_ops_general(c) { play_card(c, "to activate a general") if (game.active === P_BRITAIN) { @@ -3552,12 +3541,31 @@ states.place_rochambeau = { } } }, - space(space) { - // TODO: remove_general! + space(to) { push_undo() logp("placed Rochambeau .") - move_general(ROCHAMBEAU, space) - move_french_cu(FRENCH_REINFORCEMENTS, space, 5) + move_general(ROCHAMBEAU, to) + move_french_cu(FRENCH_REINFORCEMENTS, to, 5) + if (count_friendly_generals(to) > 1) + game.state = "remove_general_rochambeau" + else + game.state = "end_place_rochambeau" + }, +} + +states.remove_general_rochambeau = { + prompt() { + let where = location_of_general(ROCHAMBEAU) + view.prompt = "Remove a general to the reinforcements box." + view.move = { who: ROCHAMBEAU, from: where, to: where, carry_american: 0, carry_french: 5 } + gen_remove_general(where) + }, + general(g) { + push_undo() + if (game.active === P_BRITAIN) + move_general(g, BRITISH_REINFORCEMENTS) + else + move_general(g, AMERICAN_REINFORCEMENTS) game.state = "end_place_rochambeau" }, } |