diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-09-03 13:57:19 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 13:11:27 +0100 |
commit | 9594cf9aeb5a0a6d141377cc95aeec5b31200d1e (patch) | |
tree | e84ec3791d3539a3658e86cc5daea329a6b37e6d | |
parent | 036468db8d980af582daa9ad020eb8c189309056 (diff) | |
download | rommel-in-the-desert-9594cf9aeb5a0a6d141377cc95aeec5b31200d1e.tar.gz |
Summarize free deployment.
-rw-r--r-- | rules.js | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -6125,6 +6125,7 @@ function goto_free_deployment() { game.selected = [] if (!has_friendly_unit_in_raw_hex(DEPLOY)) end_free_deployment() + game.summary = {} } function is_valid_deployment_hex(base, x, n) { @@ -6186,13 +6187,18 @@ states.free_deployment = { let list = game.selected game.selected = [] push_undo() - log(`Deployed ${list.length} at #${to}.`) - for (let who of list) { + game.summary[to] = (game.summary[to] | 0) + list.length + for (let who of list) set_unit_hex(who, to) - } }, end_deployment() { clear_undo() + + log(`Deployed`) + let keys = Object.keys(game.summary).sort((a,b)=>a-b) + for (let x of keys) + log(`>${game.summary[x]} at #${x}`) + end_free_deployment() } } @@ -6201,9 +6207,11 @@ function end_free_deployment() { set_enemy_player() if (has_friendly_unit_in_raw_hex(DEPLOY)) { game.selected = [] + game.summary = {} log_h2("Allied Deployment") } else { game.selected = -1 + game.summary = null goto_initial_supply_cards() } } @@ -6214,7 +6222,7 @@ function goto_initial_supply_cards() { set_clear(game.fired) - log_br() + log_h2("Initial Supply Cards") let scenario = current_scenario() deal_axis_supply_cards(scenario.axis_initial_supply) |