summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/rules.js b/rules.js
index 9dedb5b..40cde75 100644
--- a/rules.js
+++ b/rules.js
@@ -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] !== '')