summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-03-14 00:33:16 +0100
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:15 +0200
commitb6957996cdedb3e87460f3c6389655b41273cc8e (patch)
tree1fbac04917ab21566cfd12f9ed5b8283a7907cd3
parent80c8991a117fe20d583ff7df272fa50f7cdd2f5c (diff)
downloadandean-abyss-b6957996cdedb3e87460f3c6389655b41273cc8e.tar.gz
Permanently removed out of play pieces (AUC guerrillas from event).
-rw-r--r--play.js4
-rw-r--r--rules.js17
2 files changed, 13 insertions, 8 deletions
diff --git a/play.js b/play.js
index ec27b0f..daec377 100644
--- a/play.js
+++ b/play.js
@@ -32,6 +32,7 @@ const last_loc = data.last_loc
// Spaces
const AVAILABLE = -1
+const OUT_OF_PLAY = -2
// Sequence of Play options
const ELIGIBLE = 0
@@ -878,6 +879,9 @@ function on_update() {
for (; tix < 40; ++tix)
ui.terror[tix].className = "hide"
+ for (let i = first_piece[AUC][GUERRILLA]; i <= last_piece[AUC][GUERRILLA]; ++i)
+ ui.pieces[i].classList.toggle("hide", view.pieces[i] === OUT_OF_PLAY)
+
list.length = 0
for (let i = 0; i < 4; ++i) {
let shx = view.shipments[i]
diff --git a/rules.js b/rules.js
index cf68314..20462f3 100644
--- a/rules.js
+++ b/rules.js
@@ -115,6 +115,7 @@ const PASTRANA = 2
const URIBE = 3
const AVAILABLE = -1
+const OUT_OF_PLAY = -2
// Cities
const BOGOTA = 0
@@ -1296,18 +1297,18 @@ states.remove_pieces = {
prompt() {
view.prompt = "Remove pieces to Available Forces."
for (let p = first_piece[game.current][BASE]; p <= last_piece[game.current][BASE]; ++p)
- if (game.pieces[p] !== AVAILABLE)
+ if (game.pieces[p] >= 0)
gen_action_piece(p)
if (game.current === GOVT) {
for (let p = first_piece[game.current][TROOPS]; p <= last_piece[game.current][TROOPS]; ++p)
- if (game.pieces[p] !== AVAILABLE)
+ if (game.pieces[p] >= 0)
gen_action_piece(p)
for (let p = first_piece[game.current][POLICE]; p <= last_piece[game.current][POLICE]; ++p)
- if (game.pieces[p] !== AVAILABLE)
+ if (game.pieces[p] >= 0)
gen_action_piece(p)
} else {
for (let p = first_piece[game.current][GUERRILLA]; p <= last_piece[game.current][GUERRILLA]; ++p)
- if (game.pieces[p] !== AVAILABLE)
+ if (game.pieces[p] >= 0)
gen_action_piece(p)
}
view.actions.done = 1
@@ -2168,11 +2169,11 @@ states.patrol = {
if (game.op.who < 0) {
for_each_piece(GOVT, TROOPS, p => {
- if (game.pieces[p] !== AVAILABLE && !set_has(game.op.pieces, p))
+ if (game.pieces[p] >= 0 && !set_has(game.op.pieces, p))
gen_action_piece(p)
})
for_each_piece(GOVT, POLICE, p => {
- if (game.pieces[p] !== AVAILABLE && !set_has(game.op.pieces, p))
+ if (game.pieces[p] >= 0 && !set_has(game.op.pieces, p))
gen_action_piece(p)
})
@@ -2784,7 +2785,7 @@ states.rally_move = {
view.prompt = `Rally: Move any Guerrillas to ${space_name[game.op.where]} then flip all Underground.`
for_each_piece(game.current, GUERRILLA, p => {
- if (game.pieces[p] !== game.op.where && game.pieces[p] !== AVAILABLE)
+ if (game.pieces[p] !== game.op.where && game.pieces[p] >= 0)
gen_action_piece(p)
})
@@ -3799,7 +3800,7 @@ states.cultivate_move = {
view.prompt = `Cultivate: Relocate Base to ${space_name[game.sa.where]}.`
view.where = game.sa.where
for_each_piece(CARTELS, BASE, p => {
- if (game.pieces[p] !== game.sa.where && game.pieces[p] !== AVAILABLE)
+ if (game.pieces[p] !== game.sa.where && game.pieces[p] >= 0)
gen_action_piece(p)
})
},