diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-09 20:55:02 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-09 20:55:02 -0400 |
commit | f4e6fa42b7c256a86c9e6f94ab1ded8a6aab883c (patch) | |
tree | 459f1e89bb3909f901fa1c37a7b2a4089412a65c /rules.js | |
parent | 320900676c29dec41252b231b79905c8391513c4 (diff) | |
download | vijayanagara-f4e6fa42b7c256a86c9e6f94ab1ded8a6aab883c.tar.gz |
Discard pile!
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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) { |