From 23bc441db1a06ba5caf3bd98bfab9929a8964180 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 7 May 2023 20:31:29 +0200 Subject: Les Amis d'Ordre - must place 2 cubes in Paris spaces. --- events.txt | 1 + rules.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/events.txt b/events.txt index dd2076d..bb6cff4 100644 --- a/events.txt +++ b/events.txt @@ -43,6 +43,7 @@ CARD 7 - Général Espivent remove_up_to 2 SOCIAL_MOVEMENTS CARD 8 - Les Amis de l'Ordre + # must place 2 in paris spaces place 2 PARIS CARD 9 - Socialist Newspaper Ban diff --git a/rules.js b/rules.js index 036684d..0aac4cc 100644 --- a/rules.js +++ b/rules.js @@ -380,6 +380,17 @@ function can_play_event(c) { if (game.active !== game.initiative) return false + // Les Amis de l'Ordre - must place 2 cubes in Paris + if (c === 8) { + if (count_available_versailles_cubes() < 2) + return false + let n = count_versailles_cubes(BUTTE_MONTMARTRE) + + count_versailles_cubes(BUTTE_AUX_CAILLES) + + count_versailles_cubes(PERE_LACHAISE) + if (n > 12 - 2) + return false + } + // Otto von Bismarck - must remove blue cube from National Assembly if (c === 12) if (!has_versailles_cube(NATIONAL_ASSEMBLY)) @@ -764,6 +775,16 @@ function find_available_cube(removed=0) { return -1 } +function count_available_versailles_cubes() { + return ( + count_versailles_cubes(BLUE_CUBE_POOL) + + count_versailles_cubes(BLUE_CRISIS_TRACK[0]) + + count_versailles_cubes(BLUE_CRISIS_TRACK[1]) + + count_versailles_cubes(BLUE_CRISIS_TRACK[2]) + + count_versailles_cubes(BLUE_CRISIS_TRACK[3]) + ) +} + function for_each_enemy_cube(s, f) { if (game.active === COMMUNE) for_each_versailles_cube(s, f) -- cgit v1.2.3