summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--events.txt35
-rw-r--r--rules.js28
-rw-r--r--tools/gencode.js11
3 files changed, 7 insertions, 67 deletions
diff --git a/events.txt b/events.txt
index c9e60a9..f54cd6b 100644
--- a/events.txt
+++ b/events.txt
@@ -5,13 +5,6 @@
# Notes on difficult events:
#
-# 5.1.3 - must do max possible
-# event 14, shaded 14, shaded 34, shaded 49 - place base and N troops/guerrillas
-# shaded 24 - remove 2 troops
-# event 30 - remove farc zone and remove farc base
-# event 43 - place terror and remove farc base
-# event 65 - (place or remove shipment) and (place or remove insurgent base)
-#
# Replace pieces - may only remove when unable to place available piece (check stacking if piece is available)
# 35, shaded 39, 40, shaded 50, 54, 57, shaded 57, 72
#
@@ -155,10 +148,8 @@ SHADED 13
EVENT 14
current GOVT
- # 5.1.3 - place base if possible!
prompt "Place 1 Base and 3 Troops into any Department."
- if_space is_dept(s) && can_place_base_and_n(s, GOVT, 3, TROOPS)
- or_space is_dept(s) && can_stack_any(s, GOVT)
+ space 1 is_dept(s) && can_stack_any(s, GOVT)
auto_place GOVT BASE
auto_place GOVT TROOPS
auto_place GOVT TROOPS
@@ -166,10 +157,8 @@ EVENT 14
endspace
SHADED 14
- # 5.1.3 - remove both base and cube if possible
prompt "Remove 1 Government Base and 1 cube from a Department."
- if_space is_dept(s) && ( has_govt_base(s) && has_cube(s) )
- or_space is_dept(s) && ( has_govt_base(s) || has_cube(s) )
+ space 1 is_dept(s) && ( has_govt_base(s) || has_cube(s) )
prompt "Remove 1 Government Base."
piece 1 is_piece_in_event_space(p) && is_govt_base(p)
remove
@@ -307,10 +296,8 @@ EVENT 24
ineligible FARC
SHADED 24
- # 5.1.3 - 2 troops priority
prompt "Remove 2 Troops from a space with FARC pieces."
- if_space has_farc_piece(s) && count_pieces(s, GOVT, TROOPS) >= 2
- or_space has_farc_piece(s) && has_troops(s)
+ space 1 has_farc_piece(s) && has_troops(s)
prompt "Remove 2 Troops."
piece 2 is_piece_in_event_space(p) && is_troops(p)
remove
@@ -417,10 +404,8 @@ SHADED 29
endspace
EVENT 30
- # 5.1.3 - remove both farc zone and farc base if possible
prompt "Remove 1 FARC Zone and 1 FARC Base there."
- if_space is_farc_zone(s) && has_piece(s, FARC, BASE)
- or_space is_farc_zone(s)
+ space 1 is_farc_zone(s)
remove_farc_zone
prompt "Remove 1 FARC Base."
piece 1 is_piece_in_event_space(p) && is_farc_base(p)
@@ -480,10 +465,8 @@ EVENT 34
SHADED 34
current FARC_AUC_CARTELS
- # 5.1.3 - place base if possible
prompt "Place 2 Guerrillas and 1 Base into a 0 Population Department."
- if_space is_zero_pop_dept(s) && can_place_base_and_n(s, game.current, 2, GUERRILLA)
- or_space is_zero_pop_dept(s) && can_stack_any(s, game.current)
+ space 1 is_zero_pop_dept(s) && can_stack_any(s, game.current)
auto_place (game.current) BASE
auto_place (game.current) GUERRILLA
auto_place (game.current) GUERRILLA
@@ -643,10 +626,8 @@ SHADED 42
endif
EVENT 43
- # 5.1.3 - farc bases if possible
prompt "Place 2 Terror and remove all FARC Bases from a Department with Troops."
- if_space is_dept(s) && has_troops(s) && has_piece(s, FARC, BASE)
- or_space is_dept(s) && has_troops(s)
+ space 1 is_dept(s) && has_troops(s)
terror
terror
prompt "Remove all FARC Bases."
@@ -774,10 +755,8 @@ EVENT 49
remove_permanently AUC GUERRILLA
SHADED 49
- # 5.1.3 - place base if possible
prompt "Place an AUC Guerrilla and Base in any Department."
- if_space is_dept(s) && can_place_base_and_n(s, AUC, 1, GUERRILLA)
- or_space is_dept(s) && can_stack_any(s, AUC)
+ space 1 is_dept(s) && can_stack_any(s, AUC)
auto_place AUC BASE
auto_place AUC GUERRILLA
endspace
diff --git a/rules.js b/rules.js
index 99ae982..10ee21e 100644
--- a/rules.js
+++ b/rules.js
@@ -8853,11 +8853,7 @@ CODE[13 * 2 + 1] = [
CODE[14 * 2 + 0] = [
[ vm_current, GOVT ],
[ vm_prompt, "Place 1 Base and 3 Troops into any Department." ],
- [ vm_if, ()=>can_vm_space(1,(s)=>is_dept(s) && can_place_base_and_n(s, GOVT, 3, TROOPS)) ],
- [ vm_space, true, 1, 1, (s)=>is_dept(s) && can_place_base_and_n(s, GOVT, 3, TROOPS) ],
- [ vm_else ],
[ vm_space, true, 1, 1, (s)=>is_dept(s) && can_stack_any(s, GOVT) ],
- [ vm_endif ],
[ vm_auto_place, false, 0, GOVT, BASE ],
[ vm_auto_place, false, 0, GOVT, TROOPS ],
[ vm_auto_place, false, 0, GOVT, TROOPS ],
@@ -8869,11 +8865,7 @@ CODE[14 * 2 + 0] = [
// SHADED 14
CODE[14 * 2 + 1] = [
[ vm_prompt, "Remove 1 Government Base and 1 cube from a Department." ],
- [ vm_if, ()=>can_vm_space(1,(s)=>is_dept(s) && ( has_govt_base(s) && has_cube(s) )) ],
- [ vm_space, true, 1, 1, (s)=>is_dept(s) && ( has_govt_base(s) && has_cube(s) ) ],
- [ vm_else ],
[ vm_space, true, 1, 1, (s)=>is_dept(s) && ( has_govt_base(s) || has_cube(s) ) ],
- [ vm_endif ],
[ vm_prompt, "Remove 1 Government Base." ],
[ vm_piece, false, 1, 1, (p,s)=>is_piece_in_event_space(p) && is_govt_base(p) ],
[ vm_remove ],
@@ -9067,11 +9059,7 @@ CODE[24 * 2 + 0] = [
// SHADED 24
CODE[24 * 2 + 1] = [
[ vm_prompt, "Remove 2 Troops from a space with FARC pieces." ],
- [ vm_if, ()=>can_vm_space(1,(s)=>has_farc_piece(s) && count_pieces(s, GOVT, TROOPS) >= 2) ],
- [ vm_space, true, 1, 1, (s)=>has_farc_piece(s) && count_pieces(s, GOVT, TROOPS) >= 2 ],
- [ vm_else ],
[ vm_space, true, 1, 1, (s)=>has_farc_piece(s) && has_troops(s) ],
- [ vm_endif ],
[ vm_prompt, "Remove 2 Troops." ],
[ vm_piece, false, 2, 2, (p,s)=>is_piece_in_event_space(p) && is_troops(p) ],
[ vm_remove ],
@@ -9207,11 +9195,7 @@ CODE[29 * 2 + 1] = [
// EVENT 30
CODE[30 * 2 + 0] = [
[ vm_prompt, "Remove 1 FARC Zone and 1 FARC Base there." ],
- [ vm_if, ()=>can_vm_space(1,(s)=>is_farc_zone(s) && has_piece(s, FARC, BASE)) ],
- [ vm_space, true, 1, 1, (s)=>is_farc_zone(s) && has_piece(s, FARC, BASE) ],
- [ vm_else ],
[ vm_space, true, 1, 1, (s)=>is_farc_zone(s) ],
- [ vm_endif ],
[ vm_remove_farc_zone ],
[ vm_prompt, "Remove 1 FARC Base." ],
[ vm_piece, false, 1, 1, (p,s)=>is_piece_in_event_space(p) && is_farc_base(p) ],
@@ -9297,11 +9281,7 @@ CODE[34 * 2 + 0] = [
CODE[34 * 2 + 1] = [
[ vm_current, FARC_AUC_CARTELS ],
[ vm_prompt, "Place 2 Guerrillas and 1 Base into a 0 Population Department." ],
- [ vm_if, ()=>can_vm_space(1,(s)=>is_zero_pop_dept(s) && can_place_base_and_n(s, game.current, 2, GUERRILLA)) ],
- [ vm_space, true, 1, 1, (s)=>is_zero_pop_dept(s) && can_place_base_and_n(s, game.current, 2, GUERRILLA) ],
- [ vm_else ],
[ vm_space, true, 1, 1, (s)=>is_zero_pop_dept(s) && can_stack_any(s, game.current) ],
- [ vm_endif ],
[ vm_auto_place, false, 0, ()=>(game.current), BASE ],
[ vm_auto_place, false, 0, ()=>(game.current), GUERRILLA ],
[ vm_auto_place, false, 0, ()=>(game.current), GUERRILLA ],
@@ -9509,11 +9489,7 @@ CODE[42 * 2 + 1] = [
// EVENT 43
CODE[43 * 2 + 0] = [
[ vm_prompt, "Place 2 Terror and remove all FARC Bases from a Department with Troops." ],
- [ vm_if, ()=>can_vm_space(1,(s)=>is_dept(s) && has_troops(s) && has_piece(s, FARC, BASE)) ],
- [ vm_space, true, 1, 1, (s)=>is_dept(s) && has_troops(s) && has_piece(s, FARC, BASE) ],
- [ vm_else ],
[ vm_space, true, 1, 1, (s)=>is_dept(s) && has_troops(s) ],
- [ vm_endif ],
[ vm_terror ],
[ vm_terror ],
[ vm_prompt, "Remove all FARC Bases." ],
@@ -9674,11 +9650,7 @@ CODE[49 * 2 + 0] = [
// SHADED 49
CODE[49 * 2 + 1] = [
[ vm_prompt, "Place an AUC Guerrilla and Base in any Department." ],
- [ vm_if, ()=>can_vm_space(1,(s)=>is_dept(s) && can_place_base_and_n(s, AUC, 1, GUERRILLA)) ],
- [ vm_space, true, 1, 1, (s)=>is_dept(s) && can_place_base_and_n(s, AUC, 1, GUERRILLA) ],
- [ vm_else ],
[ vm_space, true, 1, 1, (s)=>is_dept(s) && can_stack_any(s, AUC) ],
- [ vm_endif ],
[ vm_auto_place, false, 0, AUC, BASE ],
[ vm_auto_place, false, 0, AUC, GUERRILLA ],
[ vm_endspace ],
diff --git a/tools/gencode.js b/tools/gencode.js
index d4d8d23..cc789b3 100644
--- a/tools/gencode.js
+++ b/tools/gencode.js
@@ -54,17 +54,6 @@ for (let line of fs.readFileSync("events.txt", "utf-8").split("\n")) {
console.log("CODE[" + line[1] + " * 2 + 1] = [")
break
- case "if_space":
- emit([ "if", "()=>can_vm_space(1,(s)=>" + line.slice(1).join(" ") + ")" ])
- emit([ "space", true, 1, 1, "(s)=>" + line.slice(1).join(" ") ])
- emit([ "else" ])
- break
-
- case "or_space":
- emit([ "space", true, 1, 1, "(s)=>" + line.slice(1).join(" ") ])
- emit([ "endif" ])
- break
-
case "space_no_undo":
emit([ "space", false, line[1], line[1], "(s)=>" + line.slice(2).join(" ") ])
break