summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js77
1 files changed, 56 insertions, 21 deletions
diff --git a/rules.js b/rules.js
index 3f1c570..3dc0acc 100644
--- a/rules.js
+++ b/rules.js
@@ -1653,8 +1653,10 @@ states.vp_roll = {
let roll = get_aftermath_roll()
let vp_change = vp_roll[roll]
if (game.active === DEM) {
+ game.vp_roll = vp_change
logi(`+${vp_change} VP`)
} else {
+ game.vp_roll = -vp_change
logi(`-${vp_change} VP`)
}
if (game.active === DEM) {
@@ -2292,7 +2294,7 @@ function add_infl(space, ops) {
}
let end_control = check_control(space)
- log_summary('£ in %' + space + get_icons(starting_control,end_control))
+ log_summary('£ in %' + space) /* + get_icons(starting_control,end_control))*/
check_tyrant()
// Check Austria Hungary Border Reopened is true and condition has been met
@@ -2364,7 +2366,7 @@ function remove_infl(space, ops) {
}
}
let end_control = check_control(space)
- log_summary('£ from %' + space + get_icons(starting_control,end_control))
+ log_summary('£ from %' + space) /* + get_icons(starting_control,end_control))*/
check_tyrant()
game[ops]--
if (game.vm_influence_added && game.vm_influence_added[space] >= 0) {
@@ -2527,7 +2529,7 @@ function do_sc(space) {
}
let end_control = check_control(space)
//logi('%' + space + ': ' +change_infl + ' SP' + get_icons(starting_control, end_control))
- log(change_infl + ' SP for ' + game.active + '.' + get_icons(starting_control, end_control))
+ log(change_infl + ' SP for ' + game.active + '.') /* + get_icons(starting_control, end_control))*/
check_tyrant_sc()
} else {
@@ -2807,7 +2809,7 @@ function check_control(space) {
else
return "none"
}
-
+/*
function get_icons(starting_control, end_control) {
if (game.state === 'place_starting_infl')
return ''
@@ -2848,6 +2850,7 @@ function get_icons(starting_control, end_control) {
return ''
}
}
+ */
function do_tst_attempt() {
let roll = roll_d6()
@@ -3041,11 +3044,12 @@ function retain_power(country) {
let vp_gain = get_value(country) * game.times_held[find_country_index(country)]
log(`Communist retains power.`)
logi(`-${vp_gain} VP`)
+ game.vp_retain = -vp_gain
game.vp -= vp_gain
}
function score_country(country) {
- log_h4(`Scoring: ${country}`)
+ log_h5(`Scoring: ${country}`)
// Get scoring values
let value_presence = get_value(country)
@@ -3147,6 +3151,35 @@ function score_country(country) {
} else {
logi(`${change_vp} VP`)
}
+
+ // Scoring Summary
+ log_h4(`Power Struggle ${country}: Summary`)
+ console.log('game.vp_gain', game.vp_gain, 'game.vp_retain', game.vp_retain)
+ if (game.vp_roll >= 0)
+ log_gap('+' + game.vp_roll + ' VP from VP roll')
+ else
+ log_gap(game.vp_roll)
+ if (game.vp_retain)
+ log(game.vp_retain + ' VP from holding power')
+ if (change_vp > 0)
+ log('+' + change_vp + ' VP from country scoring')
+ else
+ log(change_vp + ' VP from country scoring')
+ let total_vp
+ if (game.vp_retain)
+ total_vp = game.vp_roll + game.vp_retain + change_vp
+ else
+ total_vp = game.vp_roll + change_vp
+ log_h5('Total:')
+ if (total_vp > 0)
+ logi('+' + total_vp + ' VP' )
+ else
+ logi('' + total_vp + ' VP' )
+
+ if (game.vp > 0)
+ log_gap('Score is +' + game.vp + ' VP.')
+ else
+ log_gap('Score is ' + game.vp + ' VP.')
}
function get_value(country) {
@@ -4220,6 +4253,8 @@ function reset_power() {
delete game.tactics_fails
delete game.view_opp_power_hand
delete game.ps_round
+ delete game.vp_roll
+ delete game.vp_retain
let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU]
for (let e of scoring_events) {
@@ -4468,7 +4503,7 @@ function pop_summary() {
}
game.summary = []
}
-/*
+
function pop_summary_i() {
if (game.summary.length > 0) {
for (let [n, msg] of game.summary) {
@@ -4476,8 +4511,8 @@ function pop_summary_i() {
}
}
game.summary = []
-} */
-
+}
+/*
function pop_summary_i() {
console.log('game.summary', game.summary)
if (game.summary.length > 0) {
@@ -4551,7 +4586,7 @@ function pop_summary_i() {
game.summary = []
}
-
+*/
function do_log_summary() {
if (game.summary.length > 0) {
pop_summary_i()
@@ -5001,9 +5036,9 @@ function vm_take_control(space) {
game.valid_spaces = game.valid_spaces.filter(id => id !== space)
let end_control = check_control(space)
if (game.state === 'vm_kremlin_coup_take_control')
- logi('Took control of %' + space + '.' + get_icons(starting_control, end_control))
+ logi('Took control of %' + space + '.') /*+ get_icons(starting_control, end_control)) */
else
- log('Took control of %' + space +'.' + get_icons(starting_control, end_control))
+ log('Took control of %' + space +'.') /*+ get_icons(starting_control, end_control))*/
}
function vm_do_add_infl_free(space) {
@@ -5015,7 +5050,7 @@ function vm_do_add_infl_free(space) {
game.demInfl[space]++
}
let end_control = check_control(space)
- log_summary('£ in %' + space + get_icons(starting_control,end_control))
+ log_summary('£ in %' + space) /*+ get_icons(starting_control,end_control))*/
game.vm_available_ops--
check_tyrant()
}
@@ -5053,7 +5088,7 @@ function vm_do_add_x_infl(space) {
game.demInfl[space] += game.vm_available_ops
}
let end_control = check_control(space)
- logi(`${game.vm_available_ops} in %${space}${get_icons(starting_control, end_control)}`)
+ logi(`${game.vm_available_ops} in %${space}`) /*${get_icons(starting_control, end_control)}`)*/
check_tyrant()
game.vm_available_ops = 0
game.valid_spaces = []
@@ -5086,7 +5121,7 @@ function vm_do_add_limited_infl(space, max_infl) {
}
let end_control = check_control(space)
- log_summary('£ in %' + space + get_icons(starting_control,end_control))
+ log_summary('£ in %' + space) /*+ get_icons(starting_control,end_control))*/
game.vm_influence_added[space] ++
if (game.vm_influence_added[space] === max_infl) {
@@ -5158,7 +5193,7 @@ function vm_do_remove_x_infl(space) {
}
}
let end_control = check_control(space)
- logi(`${game.vm_available_ops} from %${space}${get_icons(starting_control, end_control)}`)
+ logi(`${game.vm_available_ops} from %${space}`) /*${get_icons(starting_control, end_control)}`)*/
check_tyrant()
game.vm_available_ops = 0
game.valid_spaces = []
@@ -5204,7 +5239,7 @@ function vm_do_remove_limited_infl(space, max_infl) {
}
let end_control = check_control(space)
- log_summary('£ from %' + space + get_icons(starting_control,end_control))
+ log_summary('£ from %' + space) /*+ get_icons(starting_control,end_control))*/
check_tyrant()
if (game.vm_available_ops === 0) {
game.valid_spaces = []
@@ -5223,11 +5258,11 @@ function vm_do_remove_all_infl(space) {
if (game.active === COM) {
game.demInfl[space] = 0
let end_control = check_control(space)
- log(`Removed all Democratic SP from %${space}${get_icons(starting_control, end_control)}`)
+ log(`Removed all Democratic SP from %${space}`) /*${get_icons(starting_control, end_control)}`)*/
} else {
game.comInfl[space] = 0
let end_control = check_control(space)
- log(`Removed all Communist SP from %${space}${get_icons(starting_control, end_control)}`)
+ log(`Removed all Communist SP from %${space}`) /*${get_icons(starting_control, end_control)}`)*/
}
check_tyrant()
@@ -5235,11 +5270,11 @@ function vm_do_remove_all_infl(space) {
if (game.active === COM) {
game.comInfl[space] = 0
let end_control = check_control(space)
- log(`Removed all Communist SP from %${space}${get_icons(starting_control, end_control)}`)
+ log(`Removed all Communist SP from %${space}`) /*${get_icons(starting_control, end_control)}`)*/
} else {
game.demInfl[space] = 0
let end_control = check_control(space)
- log(`Removed all Democratic SP from %${space}${get_icons(starting_control, end_control)}`)
+ log(`Removed all Democratic SP from %${space}`) /*${get_icons(starting_control, end_control)}`)*/
}
check_tyrant()
}
@@ -5293,7 +5328,7 @@ function vm_switch_infl(space) {
game.demInfl[space] -= game.vm_available_ops
game.comInfl[space] += game.vm_available_ops
let end_control = check_control(space)
- log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in %${space}. ${get_icons(starting_control,end_control)}`)
+ log(`Replaced ${pluralize(game.vm_available_ops,'SP')} in %${space}.`) /* ${get_icons(starting_control,end_control)}`)*/
game.vm_available_ops = 0
check_tyrant()
}