summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-17 12:38:58 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-17 12:38:58 +0100
commit7171b89dd6ade39965f7d06ad45454ca3649c503 (patch)
tree8a5200ba66c5a8d863221e9bb7b6d7ebc731e4e5 /rules.js
parent699ea2411ccdc70c4f6023f7efd09f2f03d5b80f (diff)
download1989-dawn-of-freedom-7171b89dd6ade39965f7d06ad45454ca3649c503.tar.gz
Updates to scoring in log
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js48
1 files changed, 29 insertions, 19 deletions
diff --git a/rules.js b/rules.js
index 57ffa48..e98d92c 100644
--- a/rules.js
+++ b/rules.js
@@ -981,6 +981,9 @@ states.draw_power_cards = {
draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand_limit, game.com_pwr_hand_limit)
game.valid_cards = all_power_cards
+ log(`Communist: ${game.com_pwr_hand.length} cards`)
+ log(`Democrat: ${game.dem_pwr_hand.length} cards`)
+
//Check if The Crowd Turns Against Ceausescu occurs
if (game.persistent_events['the_crowd_turns_against_ceausescu'] && game.pwr_struggle_in === 'Romania') {
if (game.active === COM) {
@@ -1714,13 +1717,14 @@ states.general_strike = {
log(`Rolled a ${roll}`)
log(`+${game.available_ops} from C${cards[game.played_card].number}.`)
let total = roll + game.available_ops
+ log(`Modified total: ${total}`)
if (total > 5) {
log('The strike is over.')
permanently_remove(5)
game.persistent_events['general_strike'] = false
} else {
- log('The strike continues.')
+ log('The strike continues. Required 6 or more')
}
game.phase = 1
},
@@ -2606,38 +2610,44 @@ function score_country(country) {
//Check for domination or control
if (presence.dem_control || presence.dem_domination) {
+ log(`Democrat:`)
if (presence.dem_control) {
- log(`Democrat has control: gains ${value_control} VP`)
+ log(`Control: ${value_control} VP`)
}
else {
- log(`Democrat has domination: gains ${value_domination} VP`)
+ log(`Domination: ${value_domination} VP`)
}
- log(`And ${presence.dem_battlegrounds} battlegrounds: gains ${presence.dem_battlegrounds} VP`)
+ log(`Battlegrounds: ${presence.dem_battlegrounds} VP`)
+ log_gap('Communist:')
if (presence.com_spaces > 0) {
- log(`Communist has presence: gains ${value_presence} VP`)
+ log(`Presence: ${value_presence} VP`)
+ if (presence.com_battlegrounds >0) {
+ log(`Battlegrounds: ${presence.com_battlegrounds} VP`)
+ }
} else {
- log('Communist has no presence')
- }
- if (presence.com_battlegrounds >0) {
- log(`And ${presence.com_battlegrounds} battlegrounds: gains ${presence.com_battlegrounds} VP`)
+ log('No presence: 0 VP')
}
+
}
else if (presence.com_control || presence.com_domination) {
+ log('Communist:')
if (presence.com_control) {
- log(`Communist has control: gains ${value_control} VP`)
+ log(`Control: ${value_control} VP`)
}
else {
- log(`Communist has domination: gains ${value_domination} VP`)
+ log(`Domination: ${value_domination} VP`)
}
- log(`And ${presence.com_battlegrounds} battlegrounds: gains ${presence.com_battlegrounds} VP`)
+ log(`Battlegrounds: ${presence.com_battlegrounds} VP`)
+ log_gap('Democrat:')
if (presence.dem_spaces > 0) {
- log(`Democrat has presence: gains ${value_presence} VP`)
+ log(`Presence: ${value_presence} VP`)
+ if (presence.dem_battlegrounds > 0) {
+ log(`Battlegrounds: ${presence.dem_battlegrounds} VP`)
+ }
} else {
- log('Democrat has no presence')
- }
- if (presence.dem_battlegrounds > 0) {
- log(`And ${presence.dem_battlegrounds} battlegrounds: gains ${presence.dem_battlegrounds} VP`)
+ log('No presence: 0 VP')
}
+
}
// Otherwise, score for battlegrounds
@@ -3155,7 +3165,6 @@ function silent_discard(card) {
game.democrat_hand.splice(find_card, 1)
}
game.strategy_discard.push(card)
- log(`Discarded C${cards[card].number}`)
} else if (game.is_pwr_struggle) {
if (game.active === COM) {
@@ -3166,7 +3175,6 @@ function silent_discard(card) {
game.dem_pwr_hand.splice(find_card, 1);
}
game.power_struggle_discard.push(card)
- //log(`Discarded P${power_cards[card].number}`)
}
}
@@ -3693,6 +3701,7 @@ function vm_valid_spaces_country () {
}
function vm_valid_spaces_sc () {
+ console.log('in vm_valid_spaces_sc: game.persistent_events[we_are_the_people]', game.persistent_events['we_are_the_people'])
let valid_spaces = []
for (let space of game.pieces) {
if (!space) continue
@@ -6989,6 +6998,7 @@ states.vm_tst_6 = {
},
sc(space) {
push_undo()
+ console.log('in vm_valid_spaces_sc: game.persistent_events[we_are_the_people]', game.persistent_events['we_are_the_people'])
game.selected_space = find_space_index(space)
game.state = 'vm_tst_6_sc'
},