summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-18 10:02:30 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-18 10:02:30 +0100
commit6ac2c6928c566f23be2952ba641deb627ef1008f (patch)
tree5445fa4fe38c22c3a8eab7bba1e855d62622c7f8 /rules.js
parent101af67b326c84f34d032bbfe4d0f17beceec4e1 (diff)
downloadmaria-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.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 13d080e..5c87168 100644
--- a/rules.js
+++ b/rules.js
@@ -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()