diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-03-24 02:42:15 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 11:54:52 +0100 |
commit | e056a8383b13581a115166b026f92efb2c8b7108 (patch) | |
tree | ba4cd7f3582048b9ea36a7161bd18a201b8d7db8 | |
parent | 1ef39d9f8dedabdf077ccf8132a2e013c10b7dea (diff) | |
download | wilderness-war-e056a8383b13581a115166b026f92efb2c8b7108.tar.gz |
Summary of dropped off units.
-rw-r--r-- | rules.js | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -3216,6 +3216,8 @@ states.move = { }, drop_off() { push_undo(); + if (game.summary) + game.summary.drop_off = []; game.state = 'drop_off'; }, siege() { @@ -3267,11 +3269,18 @@ states.drop_off = { }, piece(who) { push_undo(); - log(`Dropped off ${piece_name(who)}.`); + if (game.summary) + game.summary.drop_off.push(who); + else + log(`Dropped off ${piece_name(who)}.`); move_piece_to(who, moving_piece_space()); }, next() { push_undo(); + if (game.summary) { + log("Dropped off\n" + game.summary.drop_off.sort((a,b)=>a-b).map(piece_name).join(",\n") + "."); + delete game.summary.drop_off; + } resume_move(); }, demolish_fort: goto_demolish_fort, @@ -9094,17 +9103,20 @@ exports.setup = function (seed, scenario, options) { // raid: {}, // go_home: {}, - // Log summaries summary: { placed: {}, restored: {}, reduced: {}, eliminated: {}, }, + undo: [], log: [], }); + if (false) + delete game.summary; + switch (scenario) { default: // Start at 2VP for balance. |