From 9594cf9aeb5a0a6d141377cc95aeec5b31200d1e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 3 Sep 2022 13:57:19 +0200 Subject: Summarize free deployment. --- rules.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 83f2d32..3224e37 100644 --- a/rules.js +++ b/rules.js @@ -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) -- cgit v1.2.3