summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-03 13:57:19 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commit9594cf9aeb5a0a6d141377cc95aeec5b31200d1e (patch)
treee84ec3791d3539a3658e86cc5daea329a6b37e6d
parent036468db8d980af582daa9ad020eb8c189309056 (diff)
downloadrommel-in-the-desert-9594cf9aeb5a0a6d141377cc95aeec5b31200d1e.tar.gz
Summarize free deployment.
-rw-r--r--rules.js16
1 files 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)