From e056a8383b13581a115166b026f92efb2c8b7108 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 24 Mar 2022 02:42:15 +0100 Subject: Summary of dropped off units. --- rules.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index f826cb1..fc4d898 100644 --- a/rules.js +++ b/rules.js @@ -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. -- cgit v1.2.3