diff options
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -517,16 +517,9 @@ function game_view(state: Game, current: Player | 'Observer') { current === OBSERVER ? null : player_faction_map[current]; view = { - // active: game.active, - // engine: game.engine, // TODO: remove log: game.log, prompt: null, - // state: game.state, - bag_of_glory: game.bag_of_glory, - bag_of_glory_count: game.bag_of_glory.length, bonuses: game.bonuses, - // current, - // current_player_faction: faction, current_events: game.current_events, first_player: game.first_player, fronts: game.fronts, @@ -552,6 +545,9 @@ function game_view(state: Game, current: Player | 'Observer') { fascist: game.fascist, }; + if (!game.hidden_bag) + view.bag_of_glory = game.bag_of_glory; + if (game.state === 'game_over') { view.prompt = game.victory; } else if ( @@ -576,7 +572,7 @@ function game_view(state: Game, current: Player | 'Observer') { // #region SETUP -export function setup(seed: number, _scenario: string, _options: unknown) { +export function setup(seed: number, _scenario: string, options: Record<string,boolean>) { // game.seed = seed; game = { seed: seed, @@ -666,6 +662,9 @@ export function setup(seed: number, _scenario: string, _options: unknown) { card_played: 0, }; + if (options.hidden_bag) + game.hidden_bag = 1; + // Randomly choose second player game.player_order.push(roles[random(2)]); // Remaining role is 3rd player |