diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-03-18 10:02:30 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-03-18 10:02:30 +0100 |
commit | 6ac2c6928c566f23be2952ba641deb627ef1008f (patch) | |
tree | 5445fa4fe38c22c3a8eab7bba1e855d62622c7f8 /rules.js | |
parent | 101af67b326c84f34d032bbfe4d0f17beceec4e1 (diff) | |
download | maria-6ac2c6928c566f23be2952ba641deb627ef1008f.tar.gz |
Only send eliminated generals to off-map boxes if they can be paid for.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -5498,9 +5498,16 @@ states.send_expeditionary_corps = { inactive: "send expeditionary corps off map", prompt() { prompt("Send expeditionary corps to off map box.") - for (let p of all_power_generals[game.power]) - if (is_piece_on_map_or_eliminated(p)) - gen_action_piece(p) + + let tc_in_hand = 0 + for_each_card_in_hand(c => tc_in_hand += to_value(c)) + + for (let p of all_power_generals[game.power]) { + if (is_piece_on_map_or_eliminated(p)) { + if (game.troops[p] > 0 || tc_in_hand >= 8) + gen_action_piece(p) + } + } }, piece(p) { push_undo() |