diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -410,28 +410,28 @@ function setup(seed, _scenario, options) { }, engine: [], faction_turn: null, - fronts: { - a: { + fronts: [ + { value: -2, contributions: [], status: null, }, - m: { + { value: -2, contributions: [], status: null, }, - n: { + { value: -2, contributions: [], status: null, }, - s: { + { value: -2, contributions: [], status: null, }, - }, + ], glory: [], first_player: null, hands: { @@ -2551,7 +2551,7 @@ function defeat_on_a_front(front_id) { log_br(); log('Defeat on ' + get_front_name(front_id) + '!'); log_br(); - if (front_id === 'm' || get_defeated_front_count() == 2) { + if (front_id === data_1.MADRID || get_defeated_front_count() == 2) { game_over('Fascist', 'All players lose the game!'); return; } @@ -2745,7 +2745,7 @@ function get_fronts_closest_to(target) { return []; } const targetValue = target === 'd' ? Math.min(...values) : Math.max(...values); - return Object.keys(game.fronts).filter((frontId) => game.fronts[frontId].value === targetValue); + return game.fronts.findIndex((front) => front.value === targetValue); } function log_br() { if (game.log.length > 0 && game.log[game.log.length - 1] !== '') |