From dfef3ea74ea73966a9685f8f2c72ef556a6acc58 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 18 Apr 2023 21:40:26 +0200 Subject: Fix FARC Zone placement. --- events.txt | 1 + rules.js | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/events.txt b/events.txt index 37dd2e8..3355e66 100644 --- a/events.txt +++ b/events.txt @@ -500,6 +500,7 @@ SHADED 35 EVENT 36 eligible (game.current) + asm game.vm.zona_de_convivencia = 1 asm game.vm.save_current = game.current current GOVT place_farc_zone diff --git a/rules.js b/rules.js index d820f3d..eeb70ac 100644 --- a/rules.js +++ b/rules.js @@ -5,18 +5,15 @@ // TODO: optional place ambush // TODO: optional place rally -// TODO: check repeated alfonso +// TODO: log_br after free op/special -// TODO: Civic Action +// TODO: log Alfonso Cano +// TODO: log 1st division -// TODO: don't auto-end 7th sf remove terror/sabotage (no undo suprise) -// TODO: don't auto-end free Rally with elite backing (no undo suprise) +// TODO: Civic Action // TODO: if Assault and no valid assault targets, only allow air lift to enable Assault -// TODO: Government -> Govt -// TODO: Department -> Dept - // TODO: can_...operation - for space = ... check them all / can_rally - check that it is dept/city etc const AUTOMATIC = true @@ -1161,10 +1158,13 @@ function is_unsabotaged_pipeline(s) { // === MISC COMPOUND QUERIES == function is_possible_farc_zone(s) { - if (is_mountain(s) && !is_farc_zone(s)) { + let is_possible_space = is_dept + if (game.vm && game.vm.zona_de_convivencia) + is_possible_space = is_mountain + if (is_possible_space(s) && !is_farc_zone(s)) { let max = 0 for (let x = first_dept; x <= last_dept; ++x) { - if (is_mountain(x) && !is_farc_zone(x)) { + if (is_possible_space(x) && !is_farc_zone(x)) { let xn = count_pieces(x, FARC, BASE) + count_pieces(x, FARC, GUERRILLA) if (xn > max) max = xn @@ -6278,7 +6278,10 @@ function has_govt_in_farc_zone() { states.farc_zone_place = { prompt() { - view.prompt = "Place FARC Zone." + if (game.vm && game.vm.zona_de_convivencia) + view.prompt = "Place FARC Zone in a Mountain Department." + else + view.prompt = "Place FARC Zone." for (let s = first_dept; s <= last_dept; ++s) if (is_possible_farc_zone(s)) gen_action_space(s) @@ -8564,6 +8567,7 @@ CODE[35 * 2 + 1] = [ // EVENT 36 CODE[36 * 2 + 0] = [ [ vm_eligible, ()=>(game.current) ], + [ vm_asm, ()=>game.vm.zona_de_convivencia = 1 ], [ vm_asm, ()=>game.vm.save_current = game.current ], [ vm_current, GOVT ], [ vm_place_farc_zone ], -- cgit v1.2.3