From 4fdda6328e67b25db6ff30c0f18fb7d5ffef97b9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 24 Apr 2023 21:38:29 +0200 Subject: Fix free Assault events. --- events.txt | 8 +++++--- rules.js | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/events.txt b/events.txt index b62a41d..d18e5c2 100644 --- a/events.txt +++ b/events.txt @@ -384,7 +384,9 @@ EVENT 29 piece all is_piece_in_event_space(p) && is_farc_guerrilla(p) && is_underground(p) activate endpiece - free_assault + if can_assault_in_space(game.vm.s) + free_assault + endif endspace SHADED 29 @@ -699,9 +701,9 @@ EVENT 47 endif current GOVT prompt "All Police free Assault AUC as if Troops." - space all has_police(s) && has_auc_piece(s) - # TODO: test this + space all can_assault_in_space_faction(s, AUC) free_assault_auc + # TODO transfer dropped shipments early endspace SHADED 47 diff --git a/rules.js b/rules.js index cf7a366..f508804 100644 --- a/rules.js +++ b/rules.js @@ -8529,7 +8529,9 @@ CODE[29 * 2 + 0] = [ [ vm_piece, false, 999, 999, (p,s)=>is_piece_in_event_space(p) && is_farc_guerrilla(p) && is_underground(p) ], [ vm_activate ], [ vm_endpiece ], + [ vm_if, ()=>can_assault_in_space(game.vm.s) ], [ vm_free_assault ], + [ vm_endif ], [ vm_endspace ], [ vm_return ], ] @@ -8947,7 +8949,7 @@ CODE[47 * 2 + 0] = [ [ vm_endif ], [ vm_current, GOVT ], [ vm_prompt, "All Police free Assault AUC as if Troops." ], - [ vm_space, true, 999, 999, (s)=>has_police(s) && has_auc_piece(s) ], + [ vm_space, true, 999, 999, (s)=>can_assault_in_space_faction(s, AUC) ], [ vm_free_assault_auc ], [ vm_endspace ], [ vm_return ], -- cgit v1.2.3