From d810213990bf433a2efa24440bcd7cb1699e6448 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 10 Mar 2025 00:18:26 +0100 Subject: Add hidden bag of glory option. --- rules.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 386eb1e..5d7a9e1 100644 --- a/rules.js +++ b/rules.js @@ -348,8 +348,6 @@ function game_view(state, current) { view = { log: game.log, prompt: null, - bag_of_glory: game.bag_of_glory, - bag_of_glory_count: game.bag_of_glory.length, bonuses: game.bonuses, current_events: game.current_events, first_player: game.first_player, @@ -371,6 +369,8 @@ function game_view(state, current) { year: game.year, fascist: game.fascist, }; + if (!game.hidden_bag) + view.bag_of_glory = game.bag_of_glory; if (game.state === 'game_over') { view.prompt = game.victory; } @@ -391,7 +391,7 @@ function game_view(state, current) { } return view; } -function setup(seed, _scenario, _options) { +function setup(seed, _scenario, options) { game = { seed: seed, state: null, @@ -479,6 +479,8 @@ function setup(seed, _scenario, _options) { fascist: 0, card_played: 0, }; + if (options.hidden_bag) + game.hidden_bag = 1; game.player_order.push(exports.roles[random(2)]); game.player_order.push(game.player_order[1] === data_1.ANARCHIST ? data_1.COMMUNIST : data_1.ANARCHIST); draw_medallions(); -- cgit v1.2.3