diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-11-14 18:28:01 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-11-14 18:28:01 +0100 |
commit | 15d6b224ad27bb269e5e2e2e1ab324e9f81efc7e (patch) | |
tree | c804525f1bbb1489612a34a90d23d4d40b257996 | |
parent | ad25fb8977c221c0913a48cce6e98f59ae8aaa50 (diff) | |
download | maria-15d6b224ad27bb269e5e2e2e1ab324e9f81efc7e.tar.gz |
transfer troops before sending expeditionary corps
-rw-r--r-- | rules.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -5262,6 +5262,15 @@ states.send_expeditionary_corps = { piece(p) { push_undo() + game.selected = p + + // transfer troops to other stacked general if possible + let take = count_unstacked_take() + let give = count_stacked_give() + let xfer = Math.min(take, give) + if (xfer > 0) + give_troops(xfer) + let s = off_map_box(game.power) log(`Expeditionary corps P${p} from S${game.pos[p]} to S${s}.`) game.pos[p] = s @@ -5271,7 +5280,6 @@ states.send_expeditionary_corps = { pool: [], used: [], } - game.selected = p game.state = "recruit_for_expeditionary_corps" } else { game.state = "send_expeditionary_corps_done" @@ -5286,6 +5294,7 @@ states.send_expeditionary_corps_done = { view.actions.next = 1 }, next() { + game.selected = -1 if (game.power === P_PRAGMATIC) next_execute_political_card() else |