summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-17 21:43:14 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-17 21:43:14 +0200
commit413caa41305cf4a1911e1163c2a44633ce582d38 (patch)
tree5c652f2b75b9ca24a24f12fee83a8a60ac65a1c4 /rules.js
parent2762014c0968eb1ba79519b9b538853591907d4c (diff)
downloadwashingtons-war-413caa41305cf4a1911e1163c2a44633ce582d38.tar.gz
Stable Take/Drop CU buttons.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index eb68fd1..54aaeac 100644
--- a/rules.js
+++ b/rules.js
@@ -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