From 30c3503c856185833af21190995224cbaa1522a3 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 27 Sep 2024 11:17:54 +0100 Subject: Small fixes to remove references to demCtrl aand comCtrl --- rules.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index ef4431c..db84ced 100644 --- a/rules.js +++ b/rules.js @@ -2290,7 +2290,7 @@ function do_sc(space) { roll-- log('-1 from C59') } - if ((game.active === COM && game.persistent_events['stand_fast'] === DEM && game.pieces[clicked_space].demCtrl === 1) || (game.active === DEM && game.persistent_events['stand_fast'] === COM && game.pieces[clicked_space].comCtrl === 1)){ + if ((game.active === COM && game.persistent_events['stand_fast'] === DEM && check_dem_control(clicked_space)) || (game.active === DEM && game.persistent_events['stand_fast'] === COM && game.pieces[clicked_space].comCtrl === 1)){ roll-- log('-1 from C100') } @@ -2635,7 +2635,7 @@ function count_adj(name_unique) { return {dem_adj, com_adj} } -function count_adj_worker(space_id) { +/*function count_adj_worker(space_id) { const space = spaces[space_id] let dem_adj = 0 let com_adj = 0 @@ -2657,7 +2657,7 @@ function count_adj_worker(space_id) { } } return {dem_adj, com_adj} -} +} */ function check_control(space_id) { console.log('in check control, space', spaces[space_id].name_unique) @@ -4203,8 +4203,8 @@ function vm_take_control(space) { if ((current_infl - opponent_infl) < stability) { game.pieces[clicked_space].demInfl += stability - current_infl + opponent_infl - game.pieces[clicked_space].demCtrl = 1 - game.pieces[clicked_space].comCtrl = 0 + //game.pieces[clicked_space].demCtrl = 1 + //game.pieces[clicked_space].comCtrl = 0 } } else if (game.active === COM) { let current_infl = game.pieces[clicked_space].comInfl @@ -4213,8 +4213,8 @@ function vm_take_control(space) { if ((current_infl - opponent_infl) < stability) { game.pieces[clicked_space].comInfl += stability - current_infl + opponent_infl - game.pieces[clicked_space].comCtrl = 1 - game.pieces[clicked_space].demCtrl = 0 + //game.pieces[clicked_space].comCtrl = 1 + //game.pieces[clicked_space].demCtrl = 0 } } game.valid_spaces = game.valid_spaces.filter(id => id !== clicked_space) @@ -4273,13 +4273,13 @@ function vm_do_add_infl(space) { if (game.active === DEM) { if (game.persistent_events['genscher'] || (game.persistent_events['austria_hungary_border_reopened'] && game.austria_hungary_border_reopened_tracker)) { console.log('in gensher subcheck - remove non-East German controlled ') - game.valid_spaces = game.valid_spaces.filter(n => !(game.pieces[n].comCtrl === 1 && spaces[n].country !== 'East_Germany')) + game.valid_spaces = game.valid_spaces.filter(n => !(check_com_control(n) && spaces[n].country !== 'East_Germany')) } else { console.log('remove all controlled spaces') - game.valid_spaces = game.valid_spaces.filter(n => game.pieces[n].comCtrl !== 1) + game.valid_spaces = game.valid_spaces.filter(n => !check_com_control(n)) } } else { - game.valid_spaces = game.valid_spaces.filter(n => game.pieces[n].demCtrl !== 1) + game.valid_spaces = game.valid_spaces.filter(n => !check_dem_control(n)) } } @@ -4705,7 +4705,7 @@ function vm_civic_forum() { return } game.persistent_events['civic_forum'] = true - if (game.pieces[31].demCtrl === 1) { + if (check_dem_control(31)) { vm_next() } else { permanently_remove(90) @@ -5323,8 +5323,8 @@ function vm_the_crowd_turns_against_ceausescu() { } function vm_the_monday_demonstrations() { - if (game.pieces[6].demCtrl === 0) {game.valid_spaces.push(6)} - if (game.pieces[9].demCtrl === 0) {game.valid_spaces.push(9)} + if (!check_dem_control(6)) {game.valid_spaces.push(6)} + if (!check_dem_control(9)) {game.valid_spaces.push(9)} vm_next() } -- cgit v1.2.3