diff options
-rw-r--r-- | play.js | 10 | ||||
-rw-r--r-- | rules.js | 250 |
2 files changed, 134 insertions, 126 deletions
@@ -285,7 +285,7 @@ let ui = { function on_update() {
//console.log('on_update called')
//console.log('view.valid_spaces: ', view.valid_spaces)
- console.log('view.actions: ', view.actions)
+ //console.log('view.actions: ', view.actions)
//console.log('view.power_cards:', view.power_cards)
document.querySelectorAll('[id^="space_"].selected').forEach(spaceElement => {spaceElement.classList.remove('selected');});
document.getElementById("power_hand")?.querySelectorAll('.selected').forEach(cardElement => {cardElement.classList.remove('selected');});
@@ -301,7 +301,7 @@ function on_update() { //Check influence values
//const pieces = view.pieces
- for (let i = 1; spaces.length; i ++) {
+ for (let i = 1; i < spaces.length; i ++) {
const space = spaces[i]
const demInfl = view.demInfl[i]
@@ -313,7 +313,7 @@ function on_update() { const com_marker = document.getElementById(`${space.name_unique}_comInfl`);
const com_number = document.getElementById(`${space.name_unique}_comInflValue`);
- dem_number.innerText=piece.demInfl
+ dem_number.innerText=demInfl
if (demInfl > 0) {
dem_marker.style.display = 'block';
dem_number.style.display = 'block';
@@ -331,7 +331,7 @@ function on_update() { dem_marker.style.display = 'none';
dem_number.style.display = 'none';
}
- com_number.innerText=piece.comInfl
+ com_number.innerText=comInfl
if (comInfl > 0) {
com_marker.style.display = 'block';
com_number.style.display = 'block';
@@ -621,7 +621,7 @@ if (view.persistent_events['the_tyrant_is_gone'] > 0) { action_button("done", "Done")
action_button("undo", "Undo")
- //console.log('view.action', view.action)
+console.log('view.persistent_events', view.persistent_events)
}
// =========================== LOG FUNCTIONS ==============================================
@@ -77,15 +77,15 @@ exports.setup = function (seed, scenario, options) { tst_8: false,
vp: 0,
- demInfl: spaces.demInfl,
- comInfl: spaces.comInfl,
+ demInfl: [],
+ comInfl: [],
strategy_deck: [],
strategy_discard: [],
discard: false,
view_opp_hand: false,
strategy_removed: [],
- persistent_events: {austria_hungary_border_reopened: false, civic_forum: false, eco_glasnost: false, elena: false, foreign_currency_debt_burden: '', frg_embassies: false, general_strike: false, genscher: false, grenztruppen: false, helsinki_final_act: false, honecker: false, laszlo_tokes: false, li_peng: false, ligachev: false, national_salvation_front: false, perestroika: false, presidential_visit: false, prudence: {DEM: 0, COM: 0}, roundtable_talks: false, securitate: false, sinatra_doctrine: false, solidarity_legalised: false, stand_fast: '', stasi: false, st_nicholas_church: false, systematization: 0, tear_gas: false, the_crowd_turns_against_ceausescu: false, the_tyrant_is_gone: 0, the_wall: false, the_wall_must_go: false, we_are_the_people: false, yakovlev: false},
+ persistent_events: {prudence: {DEM: 0, COM: 0}},
power_struggle_deck: [],
power_struggle_discard: [],
dem_hand_limit: 8,
@@ -104,17 +104,12 @@ exports.setup = function (seed, scenario, options) { raised_stakes_discard: 0,
raised_stakes: 0,
raised_stakes_round: 0,
- rally_win: 0,
- petition_win: 0,
phase: 0,
times_held: {'East_Germany': 0, 'Poland': 0, 'Czechoslovakia': 0, 'Hungary': 0, 'Romania': 0, 'Bulgaria': 0},
revolutions: {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false},
- scored_countries: {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false},
remove_opponent_infl: false,
tactics_fails: '',
warsaw_pact_summit: false,
- the_wall_must_go: {dem_wins: 0, com_wins: 0, dem_roll: 0, com_roll: 0},
- tyrant_space: 0
}
log_h1("1989 Dawn of Freedom")
@@ -134,6 +129,14 @@ function start_game() { game.strategy_deck = draw_deck(cards)
reset_power()
+ //Set starting influence
+ spaces.forEach((space, index) => {
+ if (space !== null) {
+ game.demInfl[index] = space.demInfl
+ game.comInfl[index] = space.comInfl
+ }
+ })
+
// Set cards were event playable status changes during the game
game.playable_cards = [false, true, true, true, false, '', true, false, false, false, false, false, false ]
@@ -261,7 +264,7 @@ exports.view = function(state, player) { // === ACTIONS ===========
function gen_action(action, argument) {
-console.log('gen_action called with ', action, ' and ', argument)
+//console.log('gen_action called with ', action, ' and ', argument)
if (argument === undefined) {
view.actions[action] = 1
} else {
@@ -723,7 +726,7 @@ states.finish_support_check_prep = { // Check for Austria-Hungary Border Reopened - check on first support check only
//console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked)
if (game.available_ops > 1) {
- console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', game.persistent_events['austria_hungary_border_reopened'])
+ //console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', game.persistent_events['austria_hungary_border_reopened'])
if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events['austria_hungary_border_reopened'] && game.active === DEM) {
game.state = 'finish_austria_hungary_border_reopened_check'
return
@@ -904,7 +907,7 @@ states.support_check_prep = { // Check for Austria-Hungary Border Reopened - check on first support check only
//console.log('game.austria_hungary_border_reopened_checked', game.austria_hungary_border_reopened_checked)
if (game.available_ops > 1) {
- console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', game.persistent_events['austria_hungary_border_reopened'])
+ // console.log('in ahb check, country, ', spaces[game.selected_space].country, 'ahb', game.persistent_events['austria_hungary_border_reopened'])
if (spaces[game.selected_space].country === 'East_Germany' && game.persistent_events['austria_hungary_border_reopened'] && game.active === DEM) {
game.state = 'austria_hungary_border_reopened_check'
return
@@ -998,7 +1001,7 @@ states.draw_power_cards = { game.dem_pwr_hand_limit += 2
game.com_pwr_hand_limit -= 2
discard_from_table(17)
- game.persistent_events['roundtable_talks'] = false
+ delete game.persistent_events['roundtable_talks']
}
if (game.persistent_events['peasant_parties_revolt']) {
@@ -1013,7 +1016,7 @@ states.draw_power_cards = { game.dem_pwr_hand_limit += 1
game.com_pwr_hand_limit -= 1
permanently_remove(72)
- game.persistent_events['peasant_parties_revolt'] = false
+ delete game.persistent_events['peasant_parties_revolt']
}
}
@@ -1022,7 +1025,7 @@ states.draw_power_cards = { game.dem_pwr_hand_limit -= 2
game.com_pwr_hand_limit += 2
permanently_remove(102)
- game.persistent_events['national_salvation_front'] = false
+ delete game.persistent_events['national_salvation_front']
}
//Draw Power Cards
@@ -1433,6 +1436,7 @@ states.support_loss ={ }
},
roll () {
+ clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
let rally_win = 0
let petition_win = 0
@@ -1708,11 +1712,11 @@ states.final_scoring_held = { gen_action('bonus')
},
bonus() {
- const held_countries = Object.values(game.revolutions).filter(value => value === false).length
+ const held_countries = game.revolutions.filter(value => value === false).length
let vp_gain = 4*held_countries
log(`Communist holds ${held_countries} countries: gains ${vp_gain} VP`)
game.vp -= 4*held_countries
- game.scored_countries = {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false}
+ game.temp = {'East_Germany': false, 'Poland': false, 'Czechoslovakia': false, 'Hungary': false, 'Romania': false, 'Bulgaria': false}
game.state = 'final_scoring'
}
}
@@ -1720,42 +1724,42 @@ states.final_scoring_held = { states.final_scoring = {
inactive: 'score countries.',
prompt() {
- if (game.scored_countries['East_Germany'] && game.scored_countries['Poland'] && game.scored_countries['Czechoslovakia'] && game.scored_countries['Hungary'] && game.scored_countries['Romania'] && game.scored_countries['Bulgaria']) {
+ if (game.temp['East_Germany'] && game.temp['Poland'] && game.temp['Czechoslovakia'] && game.temp['Hungary'] && game.temp['Romania'] && game.temp['Bulgaria']) {
view.prompt = 'Country scoring: done.'
gen_action('done')
} else {
view.prompt = 'Choose a country to score'
- if (!game.scored_countries['East_Germany']) {gen_action('east_germany')}
- if (!game.scored_countries['Poland']) {gen_action('poland')}
- if (!game.scored_countries['Czechoslovakia']) {gen_action('czechoslovakia')}
- if (!game.scored_countries['Hungary']) {gen_action('hungary')}
- if (!game.scored_countries['Romania']) {gen_action('romania')}
- if (!game.scored_countries['Bulgaria']) {gen_action('bulgaria')}
+ if (!game.temp['East_Germany']) {gen_action('east_germany')}
+ if (!game.temp['Poland']) {gen_action('poland')}
+ if (!game.temp['Czechoslovakia']) {gen_action('czechoslovakia')}
+ if (!game.temp['Hungary']) {gen_action('hungary')}
+ if (!game.temp['Romania']) {gen_action('romania')}
+ if (!game.temp['Bulgaria']) {gen_action('bulgaria')}
}
},
east_germany() {
score_country('East_Germany')
- game.scored_countries['East_Germany'] = true
+ game.temp['East_Germany'] = true
},
poland() {
score_country('Poland')
- game.scored_countries['Poland'] = true
+ game.temp['Poland'] = true
},
czechoslovakia() {
score_country('Czechoslovakia')
- game.scored_countries['Czechoslovakia'] = true
+ game.temp['Czechoslovakia'] = true
},
hungary() {
score_country('Hungary')
- game.scored_countries['Hungary'] = true
+ game.temp['Hungary'] = true
},
romania() {
score_country('Romania')
- game.scored_countries['Romania'] = true
+ game.temp['Romania'] = true
},
bulgaria() {
score_country('Bulgaria')
- game.scored_countries['Bulgaria'] = true
+ game.temp['Bulgaria'] = true
},
done() {
if (game.vp > 0) {
@@ -1783,7 +1787,7 @@ states.general_strike = { inactive: 'discard a card.',
prompt() {
if (game.played_card === 0 ) {
- view.prompt = 'General Strike: you must discard a card.'
+ view.prompt = 'General Strike: you must discard a card or play a Scoring Card.'
available_cards = game.communist_hand
for (let card of available_cards) {
gen_action_card(card)
@@ -1813,23 +1817,28 @@ states.general_strike = { }
// Otherwise, set card ops for the roll
- if (game.persistent_events['perestroika'] && game.active === COM) {
- log('+1 op from C25')
- game.available_ops = cards[card].ops +1
- } else {game.available_ops = cards[card].ops}
+
+ game.available_ops = get_card_ops(card)
+
},
roll() {
clear_undo()
let roll = Math.floor(Math.random() * 6) + 1
log(`Rolled a ${roll}`)
+
log(`+${game.available_ops} from C${cards[game.played_card].number}.`)
+ if (game.persistent_events['prudence'].COM !== 0) {
+ log(`${game.persistent_events['prudence'].COM} from C8`)
+ roll --
+ }
+
let total = roll + game.available_ops
log(`Modified total: ${total}`)
if (total > 5) {
log('The strike is over.')
permanently_remove(5)
- game.persistent_events['general_strike'] = false
+ delete game.persistent_events['general_strike']
} else {
log('The strike continues. Required 6 or more')
}
@@ -1851,12 +1860,12 @@ states.honecker ={ push_undo()
game.round++
game.round_player = COM
- game.persistent_events['honecker'] = false
+ delete game.persistent_events['honecker']
game.state = 'choose_card'
},
pass() {
log('C15: passed')
- game.persistent_events['honecker'] = false
+ delete game.persistent_events['honecker']
end_round()
}
}
@@ -2103,9 +2112,9 @@ function add_infl(space) { // Update influence values
if (game.active === COM) {
- game.comInfl[clicked_space].comInfl++
+ game.comInfl[clicked_space]++
} else {
- game.demInfl[clicked_space].demInfl++
+ game.demInfl[clicked_space]++
}
// Check whether spaces are controlled
@@ -2124,7 +2133,7 @@ function add_infl(space) { // Check for Genscher & Austria Hungary Border Reopened
if (game.available_ops === 1) {
- console.log(`in Genscher / AHBR check, game.persistent_events['genscher']`, game.persistent_events['genscher'])
+ //console.log(`in Genscher / AHBR check, game.persistent_events['genscher']`, game.persistent_events['genscher'])
if (game.active === DEM) {
if (game.persistent_events['genscher'] || (game.persistent_events['austria_hungary_border_reopened'] && game.austria_hungary_border_reopened_tracker)) {
console.log('in gensher subcheck - remove non-East German controlled ')
@@ -2266,7 +2275,7 @@ function do_sc(space) { roll ++
log('+1 from C30')
permanently_remove(30)
- game.persistent_events['tear_gas'] = false
+ delete game.persistent_events['tear_gas']
}
if (game.active === DEM && spaces[clicked_space].region === 'Eastern Europe' && game.persistent_events['frg_embassies']) {
roll++
@@ -2306,7 +2315,7 @@ function do_sc(space) { if (adj.com_adj > 0) {
log(`+${adj.com_adj} from adjacent control`)
}
- game.persistent_events['the_wall'] = false
+ delete game.persistent_events['the_wall']
// Standard adjacency
} else {
@@ -2471,7 +2480,7 @@ function valid_spaces_support_loss() { valid_spaces_set.add(space.space_id);
}
} else {
- infl = game.demInfl[i]
+ infl = game.comInfl[i]
if (infl > 0 && space.country === game.pwr_struggle_in) {
valid_spaces_set.add(space.space_id);
}
@@ -2653,14 +2662,14 @@ function count_adj(name_unique) { } */
function check_control(space_id) {
- console.log('in check control, space', spaces[space_id].name_unique)
+ //console.log('in check control, space', spaces[space_id].name_unique)
if (game.active === COM && ((game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability)) {
return true;
} else if (game.active === DEM && ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability)) {
- console.log('true')
+ //console.log('true')
return true;
} else {
- console.log('false')
+ //console.log('false')
return false;
}
}
@@ -3095,49 +3104,7 @@ function select_card(card){ find_card = game.democrat_hand.indexOf(card)
game.democrat_hand.splice(find_card, 1)
}
- game.available_ops = cards[card].ops
-
- //Check events which affect game ops
- if (game.persistent_events['perestroika'] && game.active === COM) {
- log('+1 op from C25')
- game.available_ops ++
- }
- if (game.persistent_events['sinatra_doctrine'] && game.active === DEM) {
- log('+1 op from C50')
- game.available_ops ++
- }
-
- if ((game.active === DEM && game.dem_tst_position >= 2 && game.com_tst_position <= 1 && cards[card].ops === 1) || (game.active === COM && game.com_tst_position >=2 && game.dem_tst_position <= 1 && cards[card].ops === 1)) {
- log('+1 op from Tiananmen Square Track')
- game.available_ops ++
- }
-
- console.log('prudence:', game.persistent_events['prudence'])
- if ((game.active === DEM && game.persistent_events['prudence'].DEM !== 0)) {
- if (game.available_ops > 2) {
- log(`${pluralize(game.persistent_events['prudence'].DEM,'op')} from C8`)
- } else {
- if (game.available_ops > 1) {
- log(`-1 op from C8`)
- }
- }
- game.available_ops += game.persistent_events['prudence'].DEM
- if (game.available_ops < 1) {
- game.available_ops = 1
- }
- }
-
- if (game.active === COM && game.persistent_events['prudence'].COM !== 0) {
- if (game.available_ops > 2) {
- log(`${pluralize(game.persistent_events['prudence'].COM,'op')} from C8`)
- } else if (game.available_ops > 1) {
- log(`-1 op from C8`)
- }
- game.available_ops += game.persistent_events['prudence'].COM
- if (game.available_ops < 1) {
- game.available_ops = 1
- }
- }
+ game.available_ops = get_card_ops(card)
//Check Ligachev
if (game.active === DEM && game.persistent_events['ligachev'] && card !== 14) {
@@ -3146,14 +3113,14 @@ function select_card(card){ if (check_vp()) {
return
}
- game.persistent_events['ligachev'] = false
+ delete game.persistent_events['ligachev']
}
game.state = 'play_card'
console.log('game.state', game.state)
}
function find_event(card) {
- return variable_events.findIndex(card)
+ return variable_events.indexOf(card)
}
function get_events(card){
@@ -3169,6 +3136,49 @@ function get_events(card){ }
}
+function get_card_ops(card) {
+ let ops = cards[card].ops
+ if (game.persistent_events['perestroika'] && game.active === COM) {
+ log('+1 op from C25')
+ ops ++
+ }
+ if (game.persistent_events['sinatra_doctrine'] && game.active === DEM) {
+ log('+1 op from C50')
+ ops ++
+ }
+
+ if ((game.active === DEM && game.dem_tst_position >= 2 && game.com_tst_position <= 1 && cards[card].ops === 1) || (game.active === COM && game.com_tst_position >=2 && game.dem_tst_position <= 1 && cards[card].ops === 1)) {
+ log('+1 op from Tiananmen Square Track')
+ ops ++
+ }
+
+ if ((game.active === DEM && game.persistent_events['prudence'].DEM !== 0)) {
+ if (ops > 2) {
+ log(`${pluralize(game.persistent_events['prudence'].DEM,'op')} from C8`)
+ } else {
+ if (ops > 1) {
+ log(`-1 op from C8`)
+ }
+ }
+ ops += game.persistent_events['prudence'].DEM
+ if (ops < 1) {
+ ops = 1
+ }
+ }
+
+ if (game.active === COM && game.persistent_events['prudence'].COM !== 0) {
+ if (ops > 2) {
+ log(`${pluralize(game.persistent_events['prudence'].COM,'op')} from C8`)
+ } else if (ops > 1) {
+ log(`-1 op from C8`)
+ }
+ ops += game.persistent_events['prudence'].COM
+ if (ops < 1) {
+ ops = 1
+ }
+ } return ops
+}
+
// =========== MOVING THROUGH TURNS ============
function end_round() {
@@ -3380,52 +3390,52 @@ function new_turn() { game.com_tst_attempted_this_turn = 0
game.tst_7 = false
game.tst_8 = false
- game.persistent_events['perestroika'] = false
+ delete game.persistent_events['perestroika']
game.persistent_events['prudence'] = {DEM: 0, COM: 0}
- game.persistent_events['sinatra_doctrine'] = false
- game.persistent_events['stasi'] = false
- game.persistent_events['honecker'] = false
+ delete game.persistent_events['sinatra_doctrine']
+ delete game.persistent_events['stasi']
+ delete game.persistent_events['honecker']
//Remove Events on the table which last only 1 turn
console.log('in new turn')
if (game.persistent_events['austria_hungary_border_reopened']) {
- game.persistent_events['austria_hungary_border_reopened'] = false
+ delete game.persistent_events['austria_hungary_border_reopened']
log(`C58 no longer in effect`)
//permanently_remove(58)
}
if (game.persistent_events['elena']) {
- game.persistent_events['elena'] = false
+ delete game.persistent_events['elena']
log(`C101 no longer in effect`)
//permanently_remove(101)
}
if (game.persistent_events['grenztruppen']) {
- game.persistent_events['grenztruppen'] = false
+ delete game.persistent_events['grenztruppen']
log(`C59 no longer in effect`)
//permanently_remove(59)
}
if (game.persistent_events['foreign_currency_debt_burden'] !== '') {
- game.persistent_events['foreign_currency_debt_burden'] = ''
+ delete game.persistent_events['foreign_currency_debt_burden']
log(`C49 no longer in effect`)
//permanently_remove(49)
}
if (game.persistent_events['frg_embassies']) {
- game.persistent_events['frg_embassies'] = false
+ delete game.persistent_events['frg_embassies']
log(`C74 no longer in effect`)
discard_from_table(74)
//permanently_remove(74)
}
if (game.persistent_events['genscher']) {
- game.persistent_events['genscher'] = false
+ delete game.persistent_events['genscher']
log(`C63 no longer in effect`)
discard_from_table(63)
//permanently_remove(63)
}
if (game.persistent_events['stand_fast'] !== '') {
- game.persistent_events['stand_fast'] = ''
+ delete game.persistent_events['stand_fast']
log(`C100 no longer in effect`)
//permanently_remove(100)
}
@@ -3448,7 +3458,7 @@ function new_turn() { game.com_hand_limit = 7
log('Communist draws 7 cards due to Presidential Visit')
//permanently_remove(65)
- game.persistent_events['presidential_visit'] = false
+ delete game.persistent_events['presidential_visit']
}
console.log('deck', game.strategy_deck)
console.log('game.com_hand_limit', game.com_hand_limit, 'communist hand before draw', game.communist_hand)
@@ -3665,20 +3675,18 @@ function reset_power() { game.raised_stakes_round = 0
game.raised_stakes = 0
game.played_power_card = 0
- //game.rally_win = 0
- //game.petition_win = 0
game.tactics_fails = ''
game.view_opp_hand = false
if (game.persistent_events['peasant_parties_revolt']){
permanently_remove(72)
game.table_cards = game.table_cards.filter(card => card !== 72)
- game.persistent_events['peasant_parties_revolt'] = false
+ delete game.persistent_events['peasant_parties_revolt']
}
if (game.persistent_events['yakovlev']) {
permanently_remove(62)
game.table_cards = game.table_cards.filter(card => card !== 62)
- game.persistent_events['yakovlev'] = false
+ delete game.persistent_events['yakovlev']
}
if (game.persistent_events['the_crowd_turns_against_ceausescu'] && game.pwr_struggle_in === 'Romania'){
permanently_remove(54)
@@ -3688,7 +3696,7 @@ function reset_power() { if (game.pwr_struggle_in === 'Romania' && game.persistent_events['securitate']){
permanently_remove(70)
game.table_cards = game.table_cards.filter(card => card !== 70)
- game.persistent_events['securitate'] = false
+ delete game.persistent_events['securitate']
}
}
@@ -3710,7 +3718,7 @@ function check_control_change(space_id) { if (check_vp()) {
return
}
- game.persistent_events['the_tyrant_is_gone'] = 0
+ delete game.persistent_events['the_tyrant_is_gone']
}
}
@@ -4144,12 +4152,12 @@ function vm_valid_spaces_opponent_socio () { let space = spaces[i]
if (game.active === DEM) {
- let infl = game.demInfl[i]
+ let infl = game.comInfl[i]
if (infl > 0 && space.socio === vm_operand(1)) {
valid_spaces.push(space.space_id)
}
} else {
- let infl = game.comInfl[i]
+ let infl = game.demInfl[i]
if (infl > 0 && space.socio === vm_operand(1)) {
valid_spaces.push(space.space_id)
}
@@ -4731,7 +4739,7 @@ function vm_army_backs_revolution() { /*if (game.persistent_events['securitate']) {
permanently_remove(70)
}*/
- game.persistent_events['securitate'] = false
+ delete game.persistent_events['securitate']
game.playable_cards[find_event(70)] = false
/*if (game.table_cards.includes(70)) {
permanently_remove(70)
@@ -4941,24 +4949,24 @@ function vm_eliminate(space_id) { function get_adjusted_adjacency(space_id) {
let adjacent_spaces = spaces[space_id].adjacent;
if (adjacent_spaces.includes(game.persistent_events['systematization'])) {
- console.log('in get adjusted adjacency, systemization',game.persistent_events['systematization'])
- console.log('adjacent_spaces', adjacent_spaces)
+ //console.log('in get adjusted adjacency, systemization',game.persistent_events['systematization'])
+ //console.log('adjacent_spaces', adjacent_spaces)
}
if (game.persistent_events['systematization'] !== 0) {
- console.log('in systematization check')
+ //console.log('in systematization check')
let eliminated_space_id = game.persistent_events['systematization'];
return adjacent_spaces.map(adj_space_id => {
if (adj_space_id === eliminated_space_id) {
// Replace the eliminated space with its adjacencies
- console.log('in map check, return', spaces[eliminated_space_id].adjacent)
+ //console.log('in map check, return', spaces[eliminated_space_id].adjacent)
return spaces[eliminated_space_id].adjacent;
}
- console.log('2nd check, return', adj_space_id)
+ //console.log('2nd check, return', adj_space_id)
return adj_space_id;
}).flat(); // Flatten in case the eliminated space has multiple adjacencies
}
- console.log('final adjacent spaces', adjacent_spaces)
+ //console.log('final adjacent spaces', adjacent_spaces)
return adjacent_spaces;
}
@@ -5188,7 +5196,7 @@ function vm_malta_summit() { }
function vm_massacre_in_timisoara() {
- game.persistent_events['laszlo_tokes'] = false
+ delete game.persistent_events['laszlo_tokes']
vm_next()
}
@@ -7000,7 +7008,7 @@ states.vm_new_years_eve_party = { push_undo()
game.persistent_events['new_years_eve_party'] = 1
log('Chooses to end the game. There will be no final scoring')
- let power = Object.values(game.revolutions).filter(value => value === false).length
+ let power = game.revolutions.filter(value => value === false).length
if (power > 3) {
log(`Communist holds power in ${power} countries. -3 VP`)
game.vp -= 3
@@ -7758,7 +7766,7 @@ states.vm_tst_6 = { },
sc(space) {
push_undo()
- console.log('in vm_valid_spaces_sc: game.persistent_events[we_are_the_people]', game.persistent_events['we_are_the_people'])
+ //console.log('in vm_valid_spaces_sc: game.persistent_events[we_are_the_people]', game.persistent_events['we_are_the_people'])
game.selected_space = find_space_index(space)
if (game.active === DEM && game.persistent_events['austria_hungary_border_reopened'] && spaces[space].country === "East_Germany") {
game.austria_hungary_border_reopened_tracker = true
|