diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-09-18 17:31:08 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-09-18 17:31:08 +0100 |
commit | aec7c36487d2e102fdcd45654527ebb127b9f324 (patch) | |
tree | 145c756a7bb7cf1b0b5976bf1c70b67a065b0bc5 | |
parent | 8375df4b77eb7b64663be9a572d8b94283e190ef (diff) | |
download | 1989-dawn-of-freedom-aec7c36487d2e102fdcd45654527ebb127b9f324.tar.gz |
Updates to scoring
-rw-r--r-- | rules.js | 35 |
1 files changed, 28 insertions, 7 deletions
@@ -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`)
}
|