summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-24 21:38:29 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commit4fdda6328e67b25db6ff30c0f18fb7d5ffef97b9 (patch)
tree1ea2fb072131c5bce020dad8d009317bb78b8fec
parent3763ffe1363a9e5837d2ae9d048dc7d66ef39005 (diff)
downloadandean-abyss-4fdda6328e67b25db6ff30c0f18fb7d5ffef97b9.tar.gz
Fix free Assault events.
-rw-r--r--events.txt8
-rw-r--r--rules.js4
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 ],