summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-02-09 23:33:46 +0100
committerTor Andersson <tor@ccxvii.net>2025-02-09 23:33:46 +0100
commitb367009a36ea9797f0b614a1c03d004df1e08a30 (patch)
tree5aa7ac580c7b8001535e67cf7c25f87f1c64e09a /rules.js
parent92bac20c44b3f04435f65f7acd0e60b1571b2094 (diff)
download1989-dawn-of-freedom-b367009a36ea9797f0b614a1c03d004df1e08a30.tar.gz
remove stray console.log and fix indentation
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js43
1 files changed, 21 insertions, 22 deletions
diff --git a/rules.js b/rules.js
index eed3611..f54eef8 100644
--- a/rules.js
+++ b/rules.js
@@ -1082,8 +1082,8 @@ states.support_check_prep = {
},
done() {
push_undo()
- // Check if in a Power Struggle after Crowd Turns Against Ceausescu
- if (game.is_pwr_struggle) {
+ // Check if in a Power Struggle after Crowd Turns Against Ceausescu
+ if (game.is_pwr_struggle) {
if (game.return !== game.active) {
change_player()
}
@@ -1278,7 +1278,7 @@ states.vm_the_crowd_turns_against_ceausescu = {
view.prompt = `You have ${game.vm_available_ops} Operations points. Play for:`
gen_action('influence')
gen_action('support_check')
- if (crowd_infl_check())
+ if (crowd_infl_check())
view.actions.influence = 0
if (crowd_sc_check())
view.actions.support_check = 0
@@ -1502,7 +1502,7 @@ states.power_struggle = {
log(`${game.active}: P${PC_TACTIC_FAILS}`)
game.state = 'power_struggle_tactic_fails'
return
- }
+ }
if (power_cards[game.played_power_card].value === 1) {
log(`${game.active}: P${card}`)
log('Takes initiative.')
@@ -1553,9 +1553,9 @@ states.power_struggle = {
states.power_struggle_confirm = {
inactive: 'play a card',
prompt() {
- view.prompt = `Play ${numberless_cards.includes(game.played_power_card)
- ? power_cards[game.played_power_card].name
- : `${power_cards[game.played_power_card].name} ${power_cards[game.played_power_card].value}`}.`
+ view.prompt = `Play ${numberless_cards.includes(game.played_power_card)
+ ? power_cards[game.played_power_card].name
+ : `${power_cards[game.played_power_card].name} ${power_cards[game.played_power_card].value}`}.`
gen_action('done')
},
done() {
@@ -1626,7 +1626,7 @@ states.power_struggle_confirm_leader = {
states.power_struggle_tactic_fails = {
inactive: 'play a card',
prompt() {
- view.prompt = `Play ${power_cards[PC_TACTIC_FAILS].name}.`
+ view.prompt = `Play ${power_cards[PC_TACTIC_FAILS].name}.`
gen_action('done')
},
done() {
@@ -2948,7 +2948,7 @@ function battlegrounds(country) {
} else if (country === 'Romania') {
if (game.systematization && romania_battlegrounds.includes(game.systematization))
battlegrounds = 5
- else
+ else
battlegrounds = 6
} else {
battlegrounds = 6
@@ -3004,14 +3004,14 @@ function score_country(country) {
if (presence.dem_battlegrounds > 0) {
logi(`+${presence.dem_battlegrounds} VP Battlegrounds`)
dem_vp += presence.dem_battlegrounds
- }
+ }
if (!presence.dem_spaces)
logi(`+${dem_vp} VP`)
log('Communist:')
if (presence.com_control) {
logi(`-${value_control} VP Control`)
- com_vp -= value_control
+ com_vp -= value_control
}
else if (presence.com_domination) {
logi(`-${value_domination} VP Domination`)
@@ -3035,14 +3035,14 @@ function score_country(country) {
log_h4(`Total: ${dem_vp + com_vp} VP`)
if (game.vp > 0)
log(`Score is +${game.vp} VP`)
- else
+ else
log(`Score is ${game.vp} VP`)
} else {
let final_vp = dem_vp + com_vp + game.vp_roll + game.vp_retain
if (final_vp > 0)
log_h4(`Power Struggle total: +${final_vp} VP`)
- else
- log_h4(`Power Struggle total: ${final_vp} VP`)
+ else
+ log_h4(`Power Struggle total: ${final_vp} VP`)
}
}
@@ -3745,7 +3745,6 @@ function end_round() {
card_check = card_check.sort((a, b) => a - b)
if (check_duplicates(card_check)) {
const duplicates = find_duplicates(card_check)
- console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.persistent_events', game.persistent_events, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand)
throw new Error(`Duplicate cards detected: ${duplicates.join(', ')}`)
}
if (game.turn <= 3) {
@@ -3759,7 +3758,7 @@ function end_round() {
} else if (card_check.length !== 110) {
throw new Error(`Wrong number of cards: ${card_check.length}`)
}
-
+
// Check if last round and if so resolve end turn events
if (game.round_player === DEM && game.round === 7) {
if (game.persistent_events.includes(C_HONECKER)) {
@@ -4100,7 +4099,7 @@ function reset_power() {
game.dem_pwr_hand = []
game.com_pwr_hand = []
game.is_pwr_struggle = false
- delete game.return_state
+ delete game.return_state
delete game.phase
delete game.raised_stakes_round
delete game.raised_stakes
@@ -4965,7 +4964,7 @@ function vm_remove_limited_opp_infl() {
function vm_do_remove_limited_infl(space, max_infl) {
push_undo()
game.vm_available_ops --
- if (!game.vm_influence_added)
+ if (!game.vm_influence_added)
game.vm_influence_added = {}
if (!game.vm_influence_added[space])
game.vm_influence_added[space] = 0
@@ -6445,7 +6444,7 @@ states.vm_1_support_check_prep = {
space(space) {
push_undo()
game.selected_space = space
- if (
+ if (
game.active === DEM &&
game.persistent_events.includes(C_AUSTRIA_HUNGARY_BORDER_REOPENED) &&
spaces[space].country === 'East_Germany'
@@ -6648,7 +6647,7 @@ states.vm_common_european_home_play = {
gen_action('influence')
gen_action('support_check')
if (game.active === DEM && game.vm_event === C_KOHL_PROPOSES_REUNIFICATION) {
- return
+ return
}
},
influence() {
@@ -6724,8 +6723,8 @@ states.vm_play_event_from_discard = {
if (
(game.active === DEM && cards[card].side === 'C') ||
(game.active === COM && cards[card].side === 'D')
- )
- change_player()
+ )
+ change_player()
}
game.vm_event = card
game.vm_available_ops = cards[card].ops