From 31de990f98d06b0de29084a46094a18159762d52 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 28 Sep 2024 11:51:58 +0100 Subject: Updates to Kremlin Coup --- rules.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/rules.js b/rules.js index 3c10004..1877208 100644 --- a/rules.js +++ b/rules.js @@ -2517,11 +2517,11 @@ function valid_spaces_support_falters() { */ function valid_spaces_infl() { - if (game.state.startsWith('vm')) { + /*if (game.state.startsWith('vm')) { console.log('valid_spaces_infl called from VM') } else { console.log('valid_spaces_infl called not from VM') - } + }*/ // Check if function is called from the VM or not, take relevant ops variable let ops = game.state.startsWith('vm') ? game.vm_available_ops : game.available_ops; @@ -2530,38 +2530,38 @@ function valid_spaces_infl() { for (let i = 1; i < game.pieces.length; i++) { piece = game.pieces[i] space = spaces[i] - console.log('checking piece:', space.name_unique) + // console.log('checking piece:', space.name_unique) let player_influence = game.active === COM ? piece.comInfl : piece.demInfl; // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { - console.log(space.name_unique, 'added to set') + // console.log(space.name_unique, 'added to set') valid_spaces_set.add(space.space_id); // Check adjacency information let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { - console.log('adj_space_id', adj_space_id) + //console.log('adj_space_id', adj_space_id) if (adj_space_id) { - console.log('checking adjacent space', spaces[adj_space_id].name_unique) + //console.log('checking adjacent space', spaces[adj_space_id].name_unique) const adj_piece = spaces[adj_space_id]; - console.log('adjacent piece name', adj_piece.name_unique) + //console.log('adjacent piece name', adj_piece.name_unique) // Check if the adjacent space is controlled by the opponent const opponent_control = check_opp_control(adj_piece.space_id) - console.log('controlled?', opponent_control) - console.log('genscher?', game.persistent_events['genscher']) + //console.log('controlled?', opponent_control) + //console.log('genscher?', game.persistent_events['genscher']) //Check for Genscher. Can always place in East Germany even with 1 op if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events['genscher']){ - console.log('space added with genscher') + // console.log('space added with genscher') valid_spaces_set.add(adj_piece.space_id) } // Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent if (ops >= 2 || !opponent_control) { - console.log('space added normally') + // console.log('space added normally') valid_spaces_set.add(adj_piece.space_id) } } @@ -5054,7 +5054,7 @@ function vm_kremlin_coup() { game.valid_spaces.push(space); } }) - game.state = 'vm_kremlin_coup_take_control' + game.state = 'vm_kremlin_coup_choose_country' } function vm_laszlo_tokes() { -- cgit v1.2.3