summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-10 00:18:26 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-10 23:10:47 +0100
commitd810213990bf433a2efa24440bcd7cb1699e6448 (patch)
tree048c9aa390339542719fe44aac10a5ea1bca6181 /rules.js
parentebe9d5b86b2fe547395524f6414d47c2e4448771 (diff)
downloadland-and-freedom-d810213990bf433a2efa24440bcd7cb1699e6448.tar.gz
Add hidden bag of glory option.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js8
1 files changed, 5 insertions, 3 deletions
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();