summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-03-24 02:42:15 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 11:54:52 +0100
commite056a8383b13581a115166b026f92efb2c8b7108 (patch)
treeba4cd7f3582048b9ea36a7161bd18a201b8d7db8 /rules.js
parent1ef39d9f8dedabdf077ccf8132a2e013c10b7dea (diff)
downloadwilderness-war-e056a8383b13581a115166b026f92efb2c8b7108.tar.gz
Summary of dropped off units.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js16
1 files 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.