diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-08 17:57:54 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-08 17:57:54 +0100 |
commit | 4bf965a01aa9c1216d0fb0b5c15a9e764142a8d9 (patch) | |
tree | 1bd08ecd6cf9d2efaa35ff2dc401d62a50a9a822 /rules.js | |
parent | 0418e6317230770d3d4493b13fd1ebaacd370a7a (diff) | |
download | 1989-dawn-of-freedom-4bf965a01aa9c1216d0fb0b5c15a9e764142a8d9.tar.gz |
Debugging for AHBR
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -2509,7 +2509,7 @@ function add_infl(space) { }
// Check Genscher
- if (game.persistent_events.includes(63) && game.active === DEM && spaces[clicked_space].country === 'East_Germany' && check_com_control(clicked_space)) {
+ if (game.persistent_events.includes(63) && game.active === DEM && spaces[clicked_space].country === 'East_Germany') {
game.available_ops--
log_summary(`(-1 op due to C63)`)
} else if (check_opp_control(clicked_space)) {
@@ -3065,11 +3065,11 @@ function check_control(space_id) { function check_opp_control(space_id) {
if (spaces[space_id].country === 'Romania') {
- console.log('in check opp control, space', spaces[space_id].name_unique)
+ //console.log('in check opp control, space', spaces[space_id].name_unique)
}
if (game.active === DEM && ((game.comInfl[space_id] - game.demInfl[space_id]) >= spaces[space_id].stability)) {
if (spaces[space_id].country === 'Romania') {
- console.log('control true')
+ //console.log('control true')
}
return true;
} else if (game.active === COM && ((game.demInfl[space_id] - game.comInfl[space_id]) >= spaces[space_id].stability)) {
@@ -4599,12 +4599,12 @@ function vm_goto(op, nop, dir, step) { }
function event_prompt(str) {
- console.log('event_prompt called with', str)
+ //console.log('event_prompt called with', str)
if (typeof str === "undefined")
str = CODE[game.vm.fp][game.vm.prompt][1]
if (typeof str === "function")
str = str()
- console.log('str:', str)
+ //console.log('str:', str)
if (!str) {
str = ""
}
@@ -4932,7 +4932,7 @@ function vm_take_control(space) { function vm_do_add_infl(space) {
push_undo()
- console.log('in vm_do_add_infl, space', space)
+ console.log('in vm_do_add_infl, space', space, ops, game.vm_available_ops, 'ahbr tracker', game.austria_hungary_border_reopened_tracker, 'ahbr in events', game.persistent_events.includes(58))
const clicked_space = find_space_index(space)
//log(`Added 1 influence in %${clicked_space}.`)
@@ -4949,6 +4949,7 @@ function vm_do_add_infl(space) { // Check Genscher
if (game.persistent_events.includes(63) && game.active === DEM && spaces[clicked_space].country === 'East_Germany') {
game.vm_available_ops--
+ log_summary(`(-1 op due to C63)`)
} else if (check_opp_control(clicked_space)) {
game.vm_available_ops -= 2
//Check if Austria Hungary Border Reopened was used to place last SP in a controlled space in East Germany. If so, game.vm_available_op will be negative
@@ -4969,8 +4970,10 @@ function vm_do_add_infl(space) { // Check whether spaces are controlled
check_control_change(clicked_space)
+ console.log('before check, ahbr in events', game.persistent_events.includes(58), 'tracker', game.austria_hungary_border_reopened_tracker)
// Check Austria Hungary Border Reopened is true and condition has been met
if (game.vm_available_ops === 0 && game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) {
+ console.log('in award extra op')
game.vm_available_ops ++
log('+1 Op from C58')
game.austria_hungary_border_reopened_tracker = false
|