summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-18 17:31:08 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-18 17:31:08 +0100
commitaec7c36487d2e102fdcd45654527ebb127b9f324 (patch)
tree145c756a7bb7cf1b0b5976bf1c70b67a065b0bc5 /rules.js
parent8375df4b77eb7b64663be9a572d8b94283e190ef (diff)
download1989-dawn-of-freedom-aec7c36487d2e102fdcd45654527ebb127b9f324.tar.gz
Updates to scoring
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js35
1 files changed, 28 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index 47ecd29..ef07391 100644
--- a/rules.js
+++ b/rules.js
@@ -2636,6 +2636,9 @@ function score_country(country) {
value_control = 4
}
//Log for scoring
+
+ let dem_vp = 0
+ let com_vp = 0
//Check for presence
let presence = check_presence(country)
console.log('presence: ', presence)
@@ -2645,17 +2648,25 @@ function score_country(country) {
log(`Democrat:`)
if (presence.dem_control) {
log(`Control: +${value_control} VP`)
+ dem_vp += value_control
}
else {
log(`Domination: +${value_domination} VP`)
+ dem_vp += value_domination
}
log(`Battlegrounds: +${presence.dem_battlegrounds} VP`)
+ dem_vp += presence.dem_battlegrounds
+ log(`Total: ${dem_vp} VP`)
+
log_gap('Communist:')
if (presence.com_spaces > 0) {
log(`Presence: -${value_presence} VP`)
+ com_vp -= value_presence
if (presence.com_battlegrounds >0) {
- log(`Battlegrounds: -${presence.com_battlegrounds} VP`)
+ log(`Battlegrounds: -${presence.com_battlegrounds} VP`)
+ com_vp -= presence.com_battlegrounds
}
+ log(`Total: ${com_vp} VP`)
} else {
log('No presence: 0 VP')
}
@@ -2665,17 +2676,25 @@ function score_country(country) {
log('Communist:')
if (presence.com_control) {
log(`Control: -${value_control} VP`)
+ com_vp -= value_control
}
else {
log(`Domination: -${value_domination} VP`)
+ com_vp -= value_domination
}
log(`Battlegrounds: -${presence.com_battlegrounds} VP`)
+ com_vp -= presence.com_battlegrounds
+ log(`Total: ${com_vp} VP`)
+
log_gap('Democrat:')
if (presence.dem_spaces > 0) {
log(`Presence: +${value_presence} VP`)
+ dem_vp += value_presence
if (presence.dem_battlegrounds > 0) {
- log(`Battlegrounds: +${presence.dem_battlegrounds} VP`)
+ log(`Battlegrounds: +${presence.dem_battlegrounds} VP`)
+ dem_vp += presence.dem_battlegrounds
}
+ log (`Total: ${dem_vp} VP`)
} else {
log('No presence: 0 VP')
}
@@ -2690,6 +2709,7 @@ function score_country(country) {
log(`Presence: -${value_presence} VP`)
if (presence.com_battlegrounds > 0) {
log(`Battlegrounds: -${presence.com_battlegrounds} VP`)
+ com_vp -= presence.com_battlegrounds
}
} else {
log('No presence: 0 VP')
@@ -2699,6 +2719,7 @@ function score_country(country) {
log(`Presence: +${value_presence} VP`)
if (presence.dem_battlegrounds > 0) {
log(`Battlegrounds: +${presence.dem_battlegrounds} VP`)
+ dem_vp += presence.dem_battlegrounds
}
} else {
log('No presence: 0 VP')
@@ -2707,11 +2728,11 @@ function score_country(country) {
//Calculate change VP
- let dem_vp = 0
+ /*let dem_vp = 0
if (presence.dem_spaces > 0) {dem_vp += value_presence}
if (presence.dem_domination) {dem_vp += value_presence}
if (presence.dem_control && country !== "Hungary") {
- dem_vp += value
+ dem_vp += value_control
}
else if (presence.dem_control && country === "Hungary") {dem_vp += 2}
dem_vp += presence.dem_battlegrounds
@@ -2721,9 +2742,9 @@ function score_country(country) {
if (presence.com_domination) {com_vp += value_presence}
if (presence.com_control && country !== "Hungary") {com_vp += value_presence}
else if (presence.com_control && country === "Hungary") {com_vp += 2}
- com_vp += presence.com_battlegrounds
- let change_vp = dem_vp - com_vp
- game.vp += change_vp
+ com_vp += presence.com_battlegrounds */
+ let change_vp = dem_vp + com_vp
+ game.vp += change_vp
log_gap(`Final VP: ${change_vp} VP`)
}