diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-10-17 21:43:14 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-10-17 21:43:14 +0200 |
commit | 413caa41305cf4a1911e1163c2a44633ce582d38 (patch) | |
tree | 5c652f2b75b9ca24a24f12fee83a8a60ac65a1c4 /rules.js | |
parent | 2762014c0968eb1ba79519b9b538853591907d4c (diff) | |
download | washingtons-war-413caa41305cf4a1911e1163c2a44633ce582d38.tar.gz |
Stable Take/Drop CU buttons.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2383,11 +2383,23 @@ function path_type(from, to) { function gen_carry_cu() { let where = location_of_general(game.move.who) if (game.active === P_BRITAIN) { + view.actions.drop_british_cu = 0 + view.actions.pickup_british_cu = 0 + if (game.move.carry_british > 0) view.actions.drop_british_cu = 1 if (game.move.carry_british < 5 && game.move.carry_british < count_unmoved_british_cu(where)) view.actions.pickup_british_cu = 1 } else { + if (game.move.carry_french > 0 || count_french_cu(where) > 0) { + view.actions.drop_french_cu = 0 + view.actions.pickup_french_cu = 0 + } + if (game.move.carry_american > 0 || count_american_cu(where) > 0) { + view.actions.drop_american_cu = 0 + view.actions.pickup_american_cu = 0 + } + let carry_total = game.move.carry_french + game.move.carry_american if (game.move.carry_french > 0) view.actions.drop_french_cu = 1 |