summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-12-28 12:04:57 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-12-28 12:04:57 +0000
commit4fd82c183f8dcf8f31cc8cfd4ca538c0c2b3766c (patch)
treef29174f3ff92d2a71510d6754948274c8c3f4a93 /rules.js
parent622742ae4ed14c7d523f06e467997d6918581dea (diff)
download1989-dawn-of-freedom-4fd82c183f8dcf8f31cc8cfd4ca538c0c2b3766c.tar.gz
Tidy up code
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js177
1 files changed, 31 insertions, 146 deletions
diff --git a/rules.js b/rules.js
index a9fc4f2..b1dcce8 100644
--- a/rules.js
+++ b/rules.js
@@ -280,7 +280,6 @@ exports.setup = function (seed, scenario, _options) {
vm: null,
vm_event: 0,
- //played_card: 0,
available_ops: 0,
vm_available_ops: 0,
valid_spaces: [],
@@ -416,7 +415,6 @@ exports.view = function (state, player) {
revolutions: game.revolutions,
hand: [],
- set_aside: [],
pwr_hand: [],
}
@@ -441,7 +439,6 @@ exports.view = function (state, player) {
if (game.communist_hand_red) {
view.opp_hand = game.communist_hand_red
}
- view.set_aside = game.democrat_set_aside /* Is this being used? */
view.power_hand = [ ...game.dem_pwr_hand ].sort((a, b) => a - b)
} else if (player === COM) {
view.hand = game.communist_hand
@@ -707,7 +704,6 @@ states.play_card = {
event() {
push_undo()
check_ligachev_event(game.played_card)
- //log_gap(`Played C${game.played_card} for the event`)
if (scoring_cards.includes(game.played_card))
log_struggle_banner(game.played_card)
else {
@@ -717,7 +713,6 @@ states.play_card = {
game.vm_infl_to_do = false
game.return = game.active
if (switch_events.includes(game.played_card)) {
- //next_player()
change_player()
}
game.vm_event = game.played_card
@@ -727,7 +722,6 @@ states.play_card = {
push_undo()
log_ops_banner()
check_ligachev_event(game.played_card)
- //log_gap(`Resolved opponent event C${game.played_card}`)
log_event(game.played_card)
game.vm_infl_to_do = true
game.return = game.active
@@ -736,8 +730,6 @@ states.play_card = {
goto_vm(game.vm_event)
} else {
change_player()
- /*next_player()
- log(`C${game.vm_event}:`) */
goto_vm(game.vm_event)
}
},
@@ -745,7 +737,6 @@ states.play_card = {
push_undo()
log_ops_banner()
check_ligachev_non_event()
- //log_gap(`Played C${game.played_card} to place SPs`)
log('Placed SP:')
finish_play_card()
@@ -760,7 +751,6 @@ states.play_card = {
push_undo()
log_ops_banner()
check_ligachev_non_event()
- //log_gap(`Played C${game.played_card} to the Tiananmen Square Track`)
log('Tiananmen Square Attempt:')
finish_play_card()
game.state = 'tiananmen_square_attempt'
@@ -769,7 +759,6 @@ states.play_card = {
push_undo()
log_ops_banner()
check_ligachev_non_event()
- //log_gap(`Played C${game.played_card} for Support Checks`)
log('Support Checks:')
finish_play_card()
game.available_ops = 2
@@ -793,7 +782,6 @@ states.play_card = {
game.vm_event_to_do = true
game.vm_infl_to_do = true
game.tst_8 = true
- //log(`Uses TST Award: event and operations.`)
game.state = 'vm_tst_8'
},
end_round() {
@@ -851,7 +839,6 @@ states.resolve_opponent_event = {
game.vm_event_to_do = false
game.return_state = 'resolve_opponent_event'
game.vm_event = game.played_card
- //log(`Resolved opponent event C${game.played_card}`)
log_event(game.played_card)
if (is_auto_resolve(game.played_card) || switch_events.includes(game.played_card)) {
game.return = game.active
@@ -862,9 +849,7 @@ states.resolve_opponent_event = {
} else {
game.return = DEM
}
- //next_player()
change_player()
- //log(`C${game.played_card}:`)
goto_vm(game.vm_event)
}
},
@@ -1070,7 +1055,7 @@ states.support_check_prep = {
if (game.is_pwr_struggle) {
/* Crowd Turns Against Ceausescu should be the only time you end up here during a power struggle */
if (game.return !== game.active) {
- next_player()
+ change_player()
}
log_h5('Raise the Stakes')
log(`${game.active}:`)
@@ -1217,7 +1202,7 @@ states.draw_power_cards = {
) {
if (game.active === COM) {
game.return = COM
- next_player()
+ change_player()
}
log_h3(`C${C_THE_CROWD_TURNS_AGAINST_CEAUSESCU}`)
game.persistent_events.push(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED)
@@ -1265,7 +1250,7 @@ states.vm_the_crowd_turns_against_ceausescu = {
game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'Romania')
log('Placed SP:')
game.state = 'the_crowd_turns_against_ceausescu_infl'
- /* Send this to add_infl. Add check at end of add_infl similar to valid_spaces */
+ /* Send this to add_infl? Add check at end of add_infl similar to valid_spaces? */
},
support_check() {
push_undo()
@@ -1480,11 +1465,6 @@ states.power_struggle = {
}
if (card === PC_TACTIC_FAILS) {
log_msg_gap(`${game.active}: P${PC_TACTIC_FAILS}`)
- /*if (game.proxy_power_card) {
- log_msg_gap(`P${PC_TACTIC_FAILS}: ${game.proxy_power_card} no longer playable.`)
- } else {
- log_msg_gap(`P${PC_TACTIC_FAILS}: P${game.played_power_card} no longer playable.`)
- }*/
} else {
if (game.phase === 0 && leader_cards.includes(card)) {
/* Log nothing. Probably a better way to do this */
@@ -1500,11 +1480,9 @@ states.power_struggle = {
game.played_power_card = card
game.phase = 3
} else if (card === PC_SCARE_TACTICS) {
- /* Scare Tactics */
game.return = ''
- goto_vm(351) /* Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */
+ goto_vm(351)
} else if (card === PC_SUPPORT_SURGES) {
- /* Support Surges */
if (game.active === DEM) {
game.return = COM
} else {
@@ -1512,7 +1490,6 @@ states.power_struggle = {
}
goto_vm(350)
} else if (game.phase === 0 && card === PC_SUPPORT_FALTERS) {
- /* Support Falters */
change_player()
goto_vm(349)
} else {
@@ -1571,7 +1548,7 @@ states.power_struggle = {
log_h5('Support Loss')
if (game.phase === 0) {
game.played_power_card = 0
- game.proxy_power_card = 0 /* If conceded when held the initiative but had no playable cards, ignore the last played card */
+ game.proxy_power_card = 0
}
game.phase = 0
game.state = 'support_loss'
@@ -1759,7 +1736,6 @@ states.finish_scoring = {
gen_action('done')
},
done() {
- //log_msg_gap('Power Struggle resolved.') /* At this point log card dicarded or permanently removed? */
if (game.persistent_events.includes(MAGIC_NEW_YEARS_EVE_PARTY)) {
game.state = 'new_years_eve_party'
return
@@ -1808,7 +1784,7 @@ states.end_turn_4_5_4 = {
}
game.persistent_events.push(MAGIC_NEW_YEARS_EVE_PARTY)
if (game.active !== DEM) {
- next_player()
+ change_player()
}
game.state = 'new_years_eve_party'
} else if (game.turn === 10) {
@@ -1917,7 +1893,7 @@ states.final_scoring = {
} else if (game.vp < 0) {
goto_game_over(COM, `${COM} wins on Victory Point Track!`)
} else if (game.vp === 0) {
- goto_game_over('', `The game is tied!`) /* Not sure what to pass for result */
+ goto_game_over('', `The game is tied!`)
}
},
}
@@ -1979,7 +1955,6 @@ states.general_strike_roll = {
log(`Roll: D${roll}`)
logi(`+${game.available_ops} ops`)
let total = roll + game.available_ops
- //log(`Modified roll: ${total}`)
if (total > 5) {
log(`Success: ${total} > 5.`)
log('The strike is over.')
@@ -2086,7 +2061,7 @@ states.new_years_eve_party = {
} else if (game.vp < 0) {
goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`)
} else if (game.vp === 0) {
- goto_game_over('', `New Year's Eve Party: The game is tied!`) /* Not sure what to pass for result */
+ goto_game_over('', `New Year's Eve Party: The game is tied!`)
}
},
end() {
@@ -2095,7 +2070,7 @@ states.new_years_eve_party = {
} else if (game.vp < 0) {
goto_game_over(COM, `New Year's Eve Party: ${COM} wins on Victory Point Track!`)
} else if (game.vp === 0) {
- goto_game_over('', `New Year's Eve Party: The game is tied!`) /* Not sure what to pass for result */
+ goto_game_over('', `New Year's Eve Party: The game is tied!`)
}
},
}
@@ -2187,13 +2162,11 @@ states.stasi_play_card = {
if (game.democrat_hand.includes(C_COMMON_EUROPEAN_HOME) && cards[card].side === "C") {
game.state = 'stasi_resolve_common_european_home'
} else {
- //log(`Played C${card}.`)
game.state = 'play_card'
}
},
pass() {
log('No cards remaining. Passed.')
- //end_round()
game.state = 'end_round'
},
done() {
@@ -2214,7 +2187,6 @@ states.stasi_resolve_common_european_home = {
},
yes() {
push_undo()
- //log(`Played C${game.played_card} with C${C_COMMON_EUROPEAN_HOME}.`)
silent_discard(C_COMMON_EUROPEAN_HOME)
game.vm_infl_to_do = true
game.vm_event_to_do = false
@@ -2222,7 +2194,6 @@ states.stasi_resolve_common_european_home = {
},
no() {
push_undo()
- //log(`Played C${game.played_card}.`)
game.state = 'play_card'
},
}
@@ -2265,8 +2236,6 @@ states.stasi_play_ceh = {
function add_infl(space, ops) {
push_undo()
- //log_summary(`£ in %${space}`)
-
let starting_control = check_control(space)
// If AHBR - check AHBR conditions
@@ -2298,16 +2267,8 @@ function add_infl(space, ops) {
// Update influence values
if (game.active === COM) {
game.comInfl[space]++
- /*if (check_com_control(space))
- logi(`£CC in %${space}`)
- else
- logi(`£CU in %${space}`) */
} else {
game.demInfl[space]++
- /*if (check_dem_control(space))
- logi(`£DC in %${space}`)
- else
- logi(`£DU in %${space}`)*/
}
let end_control = check_control(space)
@@ -2351,7 +2312,6 @@ function add_infl(space, ops) {
function remove_infl(space, ops) {
push_undo()
- //log_summary(`£ in %${space}`)
let starting_control = check_control(space)
if (game.remove_opponent_infl === true) {
@@ -2680,7 +2640,6 @@ function valid_spaces_infl() {
if (adj_space_id >= 0) {
const adj_piece = spaces[adj_space_id]
- // Check if the adjacent space is controlled by the opponent
const opponent_control = check_opp_control(adj_piece.space_id)
// Check for Genscher. Can always place in East Germany even with 1 op
@@ -2710,11 +2669,10 @@ function valid_cards(player_hand, presence) {
for (let c of player_hand) {
let card = power_cards[c]
- // Never add tactics fails
+ // Never add tactics fails or cards of its suit
if (c === PC_TACTIC_FAILS) {
continue
}
- // Cannot play the suit of Tactics Fails
if (card.name === game.tactics_fails) {
continue
}
@@ -2850,10 +2808,6 @@ function get_icons(starting_control, end_control) {
return ' (£UU .to £DC)'
else if (starting_control === 'none' && end_control === COM)
return ' (£UU .to £CC)'
- /*else if (starting_control === 'none' && end_control === 'd_ahead')
- return ' (£UU .to £DU)'
- else if (starting_control === 'none' && end_control === 'c_ahead')
- return ' (£UU .to £CU)'*/
else
return ''
}
@@ -2894,12 +2848,10 @@ function do_tst_attempt() {
roll ++
logi('+1 from C' + C_LI_PENG)
}
- //log(`Modified roll: ${roll}`)
// TIANANMEN SQUARE ATTEMPT
game.return = game.round_player
- //game.return_state = 'tiananmen_square_attempt_done'
if (game.active === DEM) {
game.dem_tst_attempted_this_turn = 1
if (roll >= dem_tst_req[game.dem_tst_position]) {
@@ -3089,7 +3041,6 @@ function score_country(country) {
}
logi(`${presence.dem_battlegrounds} VP for Battlegrounds`)
dem_vp += presence.dem_battlegrounds
- //log(`Total: +${dem_vp} VP`)
log_gap('Communist:')
if (presence.com_spaces > 0) {
@@ -3099,7 +3050,6 @@ function score_country(country) {
logi(`${presence.com_battlegrounds} VP for Battlegrounds`)
com_vp -= presence.com_battlegrounds
}
- //log(`Total: ${com_vp} VP`)
} else {
logi('0 VP')
}
@@ -3114,7 +3064,6 @@ function score_country(country) {
}
logi(`${presence.com_battlegrounds} VP for Battlegrounds`)
com_vp -= presence.com_battlegrounds
- //log(`Total: ${com_vp} VP`)
log_gap('Democrat:')
if (presence.dem_spaces > 0) {
@@ -3124,7 +3073,6 @@ function score_country(country) {
logi(`${presence.dem_battlegrounds} VP for Battlegrounds`)
dem_vp += presence.dem_battlegrounds
}
- //log(`Total: +${dem_vp} VP`)
} else {
logi('0 VP')
}
@@ -3140,10 +3088,7 @@ function score_country(country) {
if (presence.com_battlegrounds > 0) {
logi(`${presence.com_battlegrounds} VP for Battlegrounds`)
com_vp -= presence.com_battlegrounds
- } /*else {
- logi('No battlegrounds')
- }
- logi(`Total: ${com_vp} VP`)*/
+ }
} else {
logi('0 VP')
}
@@ -3154,10 +3099,7 @@ function score_country(country) {
if (presence.dem_battlegrounds > 0) {
logi(`${presence.dem_battlegrounds} VP for Battlegrounds`)
dem_vp += presence.dem_battlegrounds
- } /*else {
- logi('No battlegrounds')
- }
- logi(`Total: +${dem_vp} VP`) */
+ }
} else {
logi('0 VP')
}
@@ -3244,9 +3186,6 @@ function get_aftermath_roll() {
function add_to_persistent_events(card) {
game.persistent_events.push(card)
remove_from_discard(card)
- /*if (is_auto_resolve(card)) {
- log_gap(`C${card}:`)
- } */
}
function permanently_remove(card) {
@@ -3305,7 +3244,7 @@ function end_stasi() {
game.round_player = COM
game.round ++
log_round()
- next_player()
+ change_player()
game.valid_spaces = []
if (game.persistent_events.includes(C_GENERAL_STRIKE)) {
log('.cC' + C_GENERAL_STRIKE)
@@ -3319,10 +3258,8 @@ function end_goddess() {
game.return_state = ''
log_h2("Action Round " + game.round)
if (game.active === DEM) {
- next_player()
- } else {
- //log_side()
- }
+ change_player()
+ }
if (game.persistent_events.includes(C_GENERAL_STRIKE)) {
game.state = 'general_strike'
} else {
@@ -3349,7 +3286,6 @@ function end_raise_stakes(){
}
function check_reformer() {
- /* Is this function still used? */
if (game.dem_tst_position !== game.com_tst_position) {
if (!game.playable_cards.includes(C_REFORMER_REHABILITATED)) {
game.playable_cards.push(C_REFORMER_REHABILITATED)
@@ -3639,7 +3575,6 @@ function get_card_ops(card) {
if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) {
if (
game.state === 'play_card' ||
- //game.state === 'stasi_play_card' ||
game.state === 'general_strike' ||
game.state === 'vm_deutsche_marks'
) {
@@ -3650,7 +3585,6 @@ function get_card_ops(card) {
if (game.persistent_events.includes(C_THE_SINATRA_DOCTRINE) && game.active === DEM) {
if (
game.state === 'play_card' ||
- //game.state === 'stasi_play_card' ||
game.state === 'vm_laszlo_tokes'
) {
log(`+1 op from C${C_THE_SINATRA_DOCTRINE}.`)
@@ -3664,7 +3598,6 @@ function get_card_ops(card) {
) {
if (
game.state === 'play_card' ||
- //game.state === 'stasi_play_card' ||
game.state === 'general_strike'
) {
log('+1 op from Tiananmen Square Track.')
@@ -3675,7 +3608,6 @@ function get_card_ops(card) {
if (game.active === DEM && game.prudence && game.prudence.DEM !== 0) {
if (
game.state === 'play_card' ||
- //game.state === 'stasi_play_card' ||
game.state === 'vm_laszlo_tokes'
) {
if (ops > 2) {
@@ -3819,7 +3751,7 @@ function finish_we_are_the_people() {
// =========== MOVING THROUGH TURNS ============
function end_round() {
- // Check if the game is over! WHY IS THIS NEEDED?
+ // Check if the game is over!
if (game.state === 'game_over') {
return
}
@@ -3829,13 +3761,6 @@ function end_round() {
return
}
- // Check if the card needs to be discarded.
- /*
- let discard_check = [...game.strategy_removed, ...game.persistent_events]
- if (!discard_check.includes(game.played_card) && game.played_card > 0) {
- game.strategy_discard.push(game.played_card)
- } */
-
// Reset
delete game.played_card
delete game.temp
@@ -3843,7 +3768,7 @@ function end_round() {
delete game.phase
game.remove_opponent_infl = false
game.is_pwr_struggle = false
- game.vm_infl_to_do = false /* Can get rid of this and use game.return_state? */
+ game.vm_infl_to_do = false
delete game.vm_event_to_do
delete game.vm_infl_to_do
delete game.vm_active_country
@@ -3852,7 +3777,7 @@ function end_round() {
game.return = ''
game.valid_cards = []
game.valid_spaces = []
- reset_austria_hungary_border_reopened() /* This should be redundant! */
+ reset_austria_hungary_border_reopened()
// Check for duplicate card entries
let card_check
@@ -3902,13 +3827,13 @@ function end_round() {
if (game.round_player === DEM && game.round === 7) {
if (game.persistent_events.includes(C_HONECKER)) {
if (game.active !== COM) {
- next_player()
+ change_player()
}
game.state = 'honecker'
return
} else if (game.dem_tst_position >= 6 && game.com_tst_position <= 5) {
if (game.active !== DEM) {
- next_player()
+ change_player()
}
game.return = game.active
clear_undo()
@@ -3917,7 +3842,7 @@ function end_round() {
return
} else if (game.com_tst_position >= 6 && game.dem_tst_position <= 5) {
if (game.active !== COM) {
- next_player()
+ change_player()
}
game.return = game.active
clear_undo()
@@ -3943,12 +3868,9 @@ function end_round() {
// Otherwise go to Stasi
game.round_player = DEM
if (game.active !== DEM) {
- next_player()
- } else {
- //log_side()
- }
+ change_player()
+ }
if (game.democrat_hand.includes(game.stasi_card)) {
- //log('.dC' + C_STASI)
game.state = 'stasi_play_card'
} else {
game.stasi_card = 0
@@ -3966,9 +3888,7 @@ function end_round() {
else if (game.round_player === COM) {
game.round_player = DEM
if (game.active !== DEM) {
- next_player()
- } else {
- //log_side()
+ change_player()
}
game.state = 'choose_card'
return
@@ -3977,7 +3897,7 @@ function end_round() {
if (game.persistent_events.includes(C_STASI)) {
if (game.active !== DEM) {
- next_player()
+ change_player()
}
log_h3('C' + C_STASI)
game.state = 'stasi_end_round'
@@ -3988,7 +3908,7 @@ function end_round() {
log_round()
game.round_player = COM
if (game.active !== COM) {
- next_player()
+ change_player()
}
log('.cC' + C_GENERAL_STRIKE)
return
@@ -4000,7 +3920,6 @@ function end_round() {
if (game.active !== COM) {
change_player()
}
- //log_side()
}
}
}
@@ -4076,7 +3995,7 @@ function new_turn() {
(game.dem_tst_position >= 5 && game.com_tst_position <= 4 && game.active !== DEM) ||
(game.com_tst_position >= 5 && game.dem_tst_position <= 4 && game.active !== COM)
) {
- next_player()
+ change_player()
}
let hand = game.dem_tst_position >= 5 ? game.democrat_hand : game.communist_hand
for (let card of hand) {
@@ -4091,7 +4010,6 @@ function new_turn() {
game.state = 'tst_goddess'
} else {
log_h2("Action Round " + game.round)
- //log_side()
if (game.persistent_events.includes(C_GENERAL_STRIKE)) {
log('.cC' + C_GENERAL_STRIKE)
game.state = 'general_strike'
@@ -4107,17 +4025,6 @@ function end_one_turn_event(event) {
log_summary(`C${event}`)
}
-function next_player() {
- clear_undo()
- if (game.active === DEM) {
- game.active = COM
- //log_side()
- } else {
- game.active = DEM
- //log_side()
- }
-}
-
function change_player() {
clear_undo()
if (game.active === DEM)
@@ -4338,7 +4245,6 @@ function resolve_tyrant() {
}
function check_systematization() {
- /* Check for Systematization - may not use this space */
if (game.systematization > 0) {
game.valid_spaces = game.valid_spaces.filter(n => n !== game.systematization)
}
@@ -4790,7 +4696,7 @@ function vm_return() {
delete game.vm_max_infl
delete game.vm_influence_added
delete game.communist_hand_red
- game.vm_event = 0 /* Reset to 0 now that event has been completed. Hopefully this doesn't cause issues! */
+ game.vm_event = 0
if (game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)) {
reset_austria_hungary_border_reopened()
}
@@ -5050,9 +4956,7 @@ function vm_take_control(space) {
function vm_do_add_infl_free(space) {
push_undo()
- //log_summary(`£ in %${space}`)
let starting_control = check_control(space)
- // Update influence values
if (game.active === COM) {
game.comInfl[space]++
} else {
@@ -5112,7 +5016,6 @@ function vm_add_limited_infl() {
function vm_do_add_limited_infl(space, max_infl) {
push_undo()
- //log_summary(`£ in %${space}`)
let starting_control = check_control(space)
game.vm_available_ops --
@@ -5219,7 +5122,6 @@ function vm_remove_limited_opp_infl() {
function vm_do_remove_limited_infl(space, max_infl) {
push_undo()
- //log_summary(`£ in %${space}`)
let starting_control = check_control(space)
game.vm_available_ops --
@@ -5631,7 +5533,6 @@ function vm_foreign_currency_debt_burden() {
function vm_foreign_television() {
for (let i = 0; i < spaces.length; i++) {
if (i === S_DRESDEN) {
- /* Does not apply to Dresden */
continue
}
if (game.comInfl[i] > 0) {
@@ -5661,7 +5562,6 @@ function vm_genscher() {
function vm_goodbye_lenin() {
game.view_opp_hand = true
game.communist_hand_red = []
- // Select Red cards to show
for (let card of game.communist_hand) {
if (cards[card].red) {
game.communist_hand_red.push(card)
@@ -5921,7 +5821,6 @@ function vm_power_struggle() {
game.raised_stakes_round = 0
game.raised_stakes_discard = 0
game.pwr_struggle_in = countries[scoring_cards.indexOf(game.vm_event)]
- //log_h2(`C${game.vm_event}`)
// Check for Securitate
if (game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(C_SECURITATE)) {
@@ -6255,13 +6154,12 @@ function vm_yakovlev_counsels_gorbachev() {
}
function vm_permanently_remove() {
- // Check if the event is being played as the result of another card, e.g. Dash for the West, is a card which should be removed, and which hasn't already been removed!
if (game.vm_event !== 0 && cards[game.vm_event].remove && !game.strategy_removed.includes(game.vm_event)) {
permanently_remove(game.vm_event)
}
if (cards[game.played_card].remove && !game.strategy_removed.includes(game.played_card)) {
permanently_remove(game.played_card)
- } /* This means the card that called the event being played is also removed if relevant. Think this makes sense */
+ } /* This means the card that called the event being played is also removed if relevant. */
vm_next()
}
@@ -6662,6 +6560,7 @@ states.vm_support_check_prep = {
// Check for Austria-Hungary Border Reopened - check on first Support Check only
// First check for Monday Demonstrations - Support Checks will always be in East Germany
+ // TODO: Add check for My First Banana?
if (
game.vm_event === C_THE_MONDAY_DEMONSTRATIONS &&
game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED)
@@ -6833,7 +6732,6 @@ states.vm_adamec = {
logi(`-${worker_spaces} from Democrat controlled worker spaces`)
roll -= worker_spaces
}
- //log(`Modified roll: ${Math.max(roll, 0)}`)
if (roll > 2) {
log(`Success: ${roll} >= 3`)
vm_next()
@@ -6857,7 +6755,6 @@ states.vm_brought_in_for_questioning = {
},
discard() {
clear_undo()
- //log(`C${C_BROUGHT_IN_FOR_QUESTIONING}:`)
game.vm_event = discard_card(game.democrat_hand)
log(`Democrat discarded C${game.vm_event}.`)
game.phase = 1
@@ -6870,7 +6767,6 @@ states.vm_brought_in_for_questioning = {
}
}
if (!is_auto_resolve(game.vm_event) && !switch_events.includes(game.vm_event)) {
- //next_player()
change_player()
}
log_event(game.vm_event)
@@ -6995,7 +6891,7 @@ states.vm_common_european_home_play = {
game.state = 'vm_ceh_support_check_prep'
valid_spaces_sc()
},
- tst() { /*Should this be an option? */
+ tst() {
push_undo()
log_gap(`Played C${game.vm_event} to the Tiananmen Square Track`)
game.state = 'vm_tiananmen_square_attempt'
@@ -7043,7 +6939,6 @@ states.vm_play_event_from_discard = {
},
card(card) {
push_undo()
- //log(`C${this_card()}:`)
log(`Chose C${card}.`)
game.vm_event = card
game.vm_available_ops = cards[card].ops
@@ -7101,7 +6996,6 @@ states.vm_deutsche_marks_confirm = {
if (cards[game.vm_event].side === "C" && (is_auto_resolve(game.vm_event) || switch_events.includes(game.vm_event))) {
goto_vm(game.vm_event)
} else {
- //next_player()
change_player()
game.state = 'vm_deutsche_marks'
}
@@ -7123,7 +7017,6 @@ states.vm_deutsche_marks = {
},
event() {
push_undo()
- //log(`Played C${game.vm_event} for the event`)
log_event(game.vm_event)
if (!game.vm_infl_to_do) {
game.return = game.active
@@ -7218,31 +7111,26 @@ states.vm_foreign_currency_debt_burden = {
east_germany() {
push_undo()
game.foreign_currency_debt_burden = 'East_Germany'
- //log('Chose East Germany.')
vm_next()
},
poland() {
push_undo()
game.foreign_currency_debt_burden = 'Poland'
- //log('Chose Poland.')
vm_next()
},
czechoslovakia() {
push_undo()
game.foreign_currency_debt_burden = 'Czechoslovakia'
- //log('Chose Czechoslovakia.')
vm_next()
},
hungary() {
push_undo()
game.foreign_currency_debt_burden = 'Hungary'
- //log('Chose Hungary.')
vm_next()
},
bulgaria() {
push_undo()
game.foreign_currency_debt_burden = 'Bulgaria'
- //log('Chose Bulgaria.')
vm_next()
},
}
@@ -7691,7 +7579,6 @@ states.vm_malta_summit = {
logi(`D${roll} from roll`)
if (game.stability > 0) {
logi(`+${Math.min(game.stability, 3)} from USSR Stability Track`)
- //log(`Modified roll: ${roll + Math.min(game.stability, 3)}`)
}
if (roll + game.stability > 3) {
log(`Success: ${roll + game.stability} >= 4`)
@@ -7977,7 +7864,6 @@ states.vm_shock_therapy = {
}
logi(`D${roll} from roll`)
logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`)
- //log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`)
if ((roll - worker_farmer) > 2) {
log(`Success: ${roll - worker_farmer} >= 3`)
log('+3 VP')
@@ -8371,7 +8257,6 @@ states.vm_workers_revolt_finish = {
logi(`-${adj.dem_adj} from opponent controlled spaces`)
roll -= adj.dem_adj
}
- //log(`Modified roll: ${Math.max(roll, 0)}`)
if (roll >= 4) {
log(`Success: ${roll} >= 4`)
vm_replace_all_infl(game.selected_space)