diff options
-rw-r--r-- | rules.js | 92 |
1 files changed, 53 insertions, 39 deletions
@@ -1472,14 +1472,6 @@ states.increase_prussian_collaboration_trigger_done = { // === CRISIS TRACK & CUBE POOLS === -function is_commune_first_to_breach_final() { - return count_versailles_cubes(BLUE_CRISIS_TRACK[3]) === 2 -} - -function is_versailles_first_to_breach_final() { - return count_commune_cubes(RED_CRISIS_TRACK[3]) === 2 -} - function goto_crisis_breach(next) { game.breach_active = game.active game.breach_next = next @@ -1504,42 +1496,60 @@ function end_crisis_breach() { } } -function assess_commune_crisis_track(i, an, bn) { +function assess_commune_crisis_track(i, an) { let a = count_commune_cubes(RED_CRISIS_TRACK[i+1]) - let b = count_commune_cubes(RED_BONUS_CUBES[i]) if (a < an) { - if (b === bn) { + let b = count_commune_cubes(RED_BONUS_CUBES[i]) + if (game.red_breach < i + 1) { + game.red_breach = i + 1 log_h3("Commune - " + crisis_names[i]) - if (i === 2 && is_commune_first_to_breach_final()) + if (i === 2 && game.blue_breach < 3) { add_political_vp(COMMUNE, -1) + } } return b > 0 } return false } -function assess_versailles_crisis_track(i, an, bn) { +function assess_versailles_crisis_track(i, an) { let a = count_versailles_cubes(BLUE_CRISIS_TRACK[i+1]) - let b = count_versailles_cubes(BLUE_BONUS_CUBES[i]) if (a < an) { - if (b === bn) { + let b = count_versailles_cubes(BLUE_BONUS_CUBES[i]) + if (game.blue_breach < i + 1) { + game.blue_breach = i + 1 log_h3("Versailles - " + crisis_names[i]) - if (i === 2 && is_versailles_first_to_breach_final()) + if (i === 2 && game.red_breach < 3) { add_political_vp(VERSAILLES, -1) + } } return b > 0 } return false } +function assess_commune_final_crisis_track() { + if (game.red_breach > 2) + return count_versailles_cubes(BLUE_BONUS_CUBES[2]) > 0 + return false +} + +function assess_versailles_final_crisis_track() { + if (game.blue_breach > 2) + return count_commune_cubes(RED_BONUS_CUBES[2]) > 0 + return false +} + function goto_commune_crisis_breach() { game.active = COMMUNE game.state = "commune_crisis_breach" - if (assess_commune_crisis_track(0, 2, 2)) + if (assess_commune_crisis_track(0, 2)) return - if (assess_commune_crisis_track(1, 2, 2)) + if (assess_commune_crisis_track(1, 2)) return - if (assess_commune_crisis_track(2, 2, 2)) + if (assess_commune_crisis_track(2, 2)) + return + if (assess_commune_final_crisis_track()) return end_commune_crisis_breach() } @@ -1547,11 +1557,13 @@ function goto_commune_crisis_breach() { function goto_versailles_crisis_breach() { game.active = VERSAILLES game.state = "versailles_crisis_breach" - if (assess_versailles_crisis_track(0, 2, 1)) + if (assess_versailles_crisis_track(0, 2)) + return + if (assess_versailles_crisis_track(1, 1)) return - if (assess_versailles_crisis_track(1, 1, 1)) + if (assess_versailles_crisis_track(2, 2)) return - if (assess_versailles_crisis_track(2, 2, 2)) + if (assess_versailles_final_crisis_track()) return end_versailles_crisis_breach() } @@ -1568,22 +1580,22 @@ states.commune_crisis_breach = { inactive: "move bonus cubes", prompt() { view.prompt = "Crisis Breach: Move bonus cubes to Pool." - if (count_commune_cubes(RED_CRISIS_TRACK[1]) < 2) + if (game.red_breach > 2 && count_versailles_cubes(BLUE_BONUS_CUBES[2]) > 0) { + view.prompt = "Crisis Breach: Remove opponent's bonus cubes." + for_each_versailles_cube(BLUE_BONUS_CUBES[2], gen_action_piece) + } + else if (game.red_breach > 0 && count_commune_cubes(RED_BONUS_CUBES[0]) > 0) for_each_commune_cube(RED_BONUS_CUBES[0], gen_action_piece) - if (count_commune_cubes(RED_CRISIS_TRACK[2]) < 2) + else if (game.red_breach > 1 && count_commune_cubes(RED_BONUS_CUBES[1]) > 0) for_each_commune_cube(RED_BONUS_CUBES[1], gen_action_piece) - if (count_commune_cubes(RED_CRISIS_TRACK[3]) < 2) { - if (count_versailles_cubes(BLUE_BONUS_CUBES[2]) > 0) { - view.prompt = "Crisis Breach: Remove bonus cubes." - for_each_versailles_cube(BLUE_BONUS_CUBES[2], gen_action_piece) - } else - for_each_commune_cube(RED_BONUS_CUBES[2], gen_action_piece) - } + else if (game.red_breach > 2 && count_commune_cubes(RED_BONUS_CUBES[2]) > 0) + for_each_commune_cube(RED_BONUS_CUBES[2], gen_action_piece) }, piece(p) { if (is_versailles_cube(p)) { remove_piece_from_play(p) log("Removed BC from bonus.") + goto_commune_crisis_breach() } else { remove_piece(p) if (game.pieces[p] < 0) @@ -1599,22 +1611,22 @@ states.versailles_crisis_breach = { inactive: "move bonus cubes", prompt() { view.prompt = "Crisis Breach: Move bonus cubes to Pool." - if (count_versailles_cubes(BLUE_CRISIS_TRACK[1]) < 2) + if (game.blue_breach > 0 && count_versailles_cubes(BLUE_BONUS_CUBES[0]) > 0) for_each_versailles_cube(BLUE_BONUS_CUBES[0], gen_action_piece) - if (count_versailles_cubes(BLUE_CRISIS_TRACK[2]) < 1) + else if (game.blue_breach > 1 && count_versailles_cubes(BLUE_BONUS_CUBES[1]) > 0) for_each_versailles_cube(BLUE_BONUS_CUBES[1], gen_action_piece) - if (count_versailles_cubes(BLUE_CRISIS_TRACK[3]) < 2) { - if (count_commune_cubes(RED_BONUS_CUBES[2]) > 0) { - view.prompt = "Crisis Breach: Remove opponent's bonus cubes." - for_each_commune_cube(RED_BONUS_CUBES[2], gen_action_piece) - } else - for_each_versailles_cube(BLUE_BONUS_CUBES[2], gen_action_piece) + else if (game.blue_breach > 2 && count_versailles_cubes(BLUE_BONUS_CUBES[2]) > 0) + for_each_versailles_cube(BLUE_BONUS_CUBES[2], gen_action_piece) + else if (game.blue_breach > 2 && count_commune_cubes(RED_BONUS_CUBES[2]) > 0) { + view.prompt = "Crisis Breach: Remove opponent's bonus cubes." + for_each_commune_cube(RED_BONUS_CUBES[2], gen_action_piece) } }, piece(p) { if (is_commune_cube(p)) { remove_piece_from_play(p) log("Removed RC from bonus.") + goto_versailles_crisis_breach() } else { remove_piece(p) log("Added BC to Pool.") @@ -3377,12 +3389,14 @@ exports.setup = function (seed, scenario, options) { red_set_aside: [], red_objective: [], red_fulfilled: 0, + red_breach: 0, blue_final: 17, blue_hand: [], blue_set_aside: [], blue_objective: [], blue_fulfilled: 0, + blue_breach: 0, presence: 0, control: 0, |