From f4e6fa42b7c256a86c9e6f94ab1ded8a6aab883c Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Wed, 9 Apr 2025 20:55:02 -0400 Subject: Discard pile! --- rules.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 2b2cfc5..8ac2e91 100644 --- a/rules.js +++ b/rules.js @@ -127,6 +127,7 @@ exports.view = function (state, role) { resources: game.resources, inf: game.inf, deck: [ this_card, deck_size, card_back, game.of_gods_and_kings ], + discard: game.discard, cavalry: game.cavalry, cylinder: game.cylinder, pieces: game.pieces, @@ -251,6 +252,7 @@ exports.setup = function (seed, scenario, _options) { cavalry: Array(10).fill(AVAILABLE), deck: [], of_gods_and_kings: [null, null, 0], + discard: [], order: [], cmd: { type: null, @@ -403,11 +405,22 @@ function resume_event_card() { function end_card() { clear_undo() - + update_discard() array_remove(game.deck, 0) goto_card() } +function update_discard() { + if (this_card() === 45) + game.discard = [45] + else if (this_card() === 46) + game.discard = [45, 46] + else if (this_card() === 47) + game.discard = [45, 46, 47] + else if (this_card() > 36) + game.discard.push(this_card()) +} + function goto_eligible() { change_current(next_eligible_faction()) if (game.current < 0) { -- cgit v1.2.3