summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--events.txt30
-rw-r--r--play.css2
-rw-r--r--play.html32
-rw-r--r--play.js138
-rw-r--r--rules.js170
5 files changed, 195 insertions, 177 deletions
diff --git a/events.txt b/events.txt
index 44a3fbb..4287c90 100644
--- a/events.txt
+++ b/events.txt
@@ -27,7 +27,7 @@ EVENT 1
SHADED 1
log "Civic Action requires at least 2 Troops and 2 Police."
- shaded_capability CAP_1ST_DIV
+ capability S_CAP_1ST_DIV
EVENT 2
log "Sweep costs 1 Resource per space."
@@ -35,7 +35,7 @@ EVENT 2
SHADED 2
log "Sweep Operations may target only 1 space per card."
- shaded_capability CAP_OSPINA
+ capability S_CAP_OSPINA
EVENT 3
log "Assault costs 1 Resource per space."
@@ -43,7 +43,7 @@ EVENT 3
SHADED 3
log "Assault Operations may target only 1 space per card."
- shaded_capability CAP_TAPIAS
+ capability S_CAP_TAPIAS
EVENT 4
prompt "Add twice Econ of unsabotaged pipelines to Government Resources."
@@ -100,7 +100,7 @@ EVENT 7
SHADED 7
log "Sabotage phase - Sabotage LoCs with any Guerrillas equal to cubes."
- shaded_capability CAP_7TH_SF
+ capability S_CAP_7TH_SF
EVENT 8
current GOVT
@@ -117,7 +117,7 @@ EVENT 9
SHADED 9
log "Assault in Mountain removes only 1 piece for 4 Troops."
- shaded_capability CAP_MTN_BNS
+ capability S_CAP_MTN_BNS
EVENT 10
log "Air Lift moves any number of Troops."
@@ -125,7 +125,7 @@ EVENT 10
SHADED 10
log "Air Lift moves only 1 Troops cube."
- shaded_capability CAP_BLACK_HAWKS
+ capability S_CAP_BLACK_HAWKS
EVENT 11
log "1 Police may enter each Sweep space."
@@ -133,7 +133,7 @@ EVENT 11
SHADED 11
log "Operation Activates Guerrillas via Troops or Police, not both."
- shaded_capability CAP_NDSC
+ capability S_CAP_NDSC
EVENT 12
resources GOVT (Math.min(game.aid,20))
@@ -149,7 +149,7 @@ EVENT 13
SHADED 13
log "Patrols do not conduct a free Assault."
- shaded_capability CAP_METEORO
+ capability S_CAP_METEORO
EVENT 14
current GOVT
@@ -615,8 +615,18 @@ EVENT 42
SHADED 42
log `No Sweep or Assault against ${faction_name[game.current]} until next Propaganda.`
- asm game.senado = game.current
- momentum MOM_SENADO_CAMARA
+ if game.current === GOVT
+ log "No effect."
+ endif
+ if game.current === FARC
+ momentum MOM_SENADO_FARC
+ endif
+ if game.current === AUC
+ momentum MOM_SENADO_AUC
+ endif
+ if game.current === CARTELS
+ momentum MOM_SENADO_CARTELS
+ endif
EVENT 43
# 5.1.3 - farc bases if possible
diff --git a/play.css b/play.css
index f429a40..912b43c 100644
--- a/play.css
+++ b/play.css
@@ -80,7 +80,7 @@ main { background-color: #777; }
pointer-events: none;
display: flex;
flex-wrap: wrap;
- gap: 17px;
+ gap: 20px;
}
/* SPACES */
diff --git a/play.html b/play.html
index 6cc1412..6a1f3bc 100644
--- a/play.html
+++ b/play.html
@@ -150,20 +150,32 @@
<div id="mom_17" class="momentum card card_17 hide"></div>
<div id="mom_22" class="momentum card card_22 hide"></div>
<div id="mom_27" class="momentum card card_27 hide"></div>
-<div id="mom_42" class="momentum card card_42 hide"></div>
+<div id="mom_42_farc" class="momentum card card_42 hide"></div>
+<div id="mom_42_auc" class="momentum card card_42 hide"></div>
+<div id="mom_42_cartels" class="momentum card card_42 hide"></div>
<div id="mom_67" class="momentum card card_67 hide"></div>
</div>
<div id="capabilities" style="position:absolute;top:508px;left:223px;width:208px;height:102px">
-<div id="cap_first_div" class="hide token shaded first_div"></div>
-<div id="cap_ospina" class="hide token shaded ospina"></div>
-<div id="cap_tapias" class="hide token shaded tapias"></div>
-<div id="cap_seventh_sf" class="hide token shaded seventh_sf"></div>
-<div id="cap_mtn_bns" class="hide token shaded mtn_bns"></div>
-<div id="cap_black_hawks" class="hide token shaded black_hawks"></div>
-<div id="cap_ndsc" class="hide token shaded ndsc"></div>
-<div id="cap_meteoro" class="hide token shaded meteoro"></div>
-<div id="rem_senado" class="token reminder hide"></div>
+<div id="cap_first_div" class="hide token unshaded first_div"></div>
+<div id="cap_ospina" class="hide token unshaded ospina"></div>
+<div id="cap_tapias" class="hide token unshaded tapias"></div>
+<div id="cap_seventh_sf" class="hide token unshaded seventh_sf"></div>
+<div id="cap_mtn_bns" class="hide token unshaded mtn_bns"></div>
+<div id="cap_black_hawks" class="hide token unshaded black_hawks"></div>
+<div id="cap_ndsc" class="hide token unshaded ndsc"></div>
+<div id="cap_meteoro" class="hide token unshaded meteoro"></div>
+<div id="s_cap_first_div" class="hide token shaded first_div"></div>
+<div id="s_cap_ospina" class="hide token shaded ospina"></div>
+<div id="s_cap_tapias" class="hide token shaded tapias"></div>
+<div id="s_cap_seventh_sf" class="hide token shaded seventh_sf"></div>
+<div id="s_cap_mtn_bns" class="hide token shaded mtn_bns"></div>
+<div id="s_cap_black_hawks" class="hide token shaded black_hawks"></div>
+<div id="s_cap_ndsc" class="hide token shaded ndsc"></div>
+<div id="s_cap_meteoro" class="hide token shaded meteoro"></div>
+<div id="rem_senado_farc" class="token reminder senado_farc hide"></div>
+<div id="rem_senado_auc" class="token reminder senado_auc hide"></div>
+<div id="rem_senado_cartels" class="token reminder senado_cartels hide"></div>
</div>
</div>
diff --git a/play.js b/play.js
index 11e2b28..3bf4126 100644
--- a/play.js
+++ b/play.js
@@ -207,6 +207,10 @@ const GUERRILLA = 1
const TROOPS = 2
const POLICE = 3
+const MOM_SENADO_FARC = 5
+const MOM_SENADO_AUC = 6
+const MOM_SENADO_CARTELS = 7
+
const META_WEST = 14
const first_piece = data.first_piece
@@ -233,34 +237,16 @@ const SOP_C2 = 6
const SOP_PASS = 7
const INELIGIBLE = 8
-const capability_events = [ 1, 2, 3, 7, 9, 10, 11, 13 ]
-const momentum_events = [ 12, 17, 22, 27, 42, 67 ]
-
-const CAP_1ST_DIV = 1
-const CAP_OSPINA = 2
-const CAP_TAPIAS = 3
-const CAP_7TH_SF = 7
-const CAP_MTN_BNS = 9
-const CAP_BLACK_HAWKS = 10
-const CAP_NDSC = 11
-const CAP_METEORO = 13
-
-const MOM_PLAN_COLOMBIA = 12
-const MOM_MADRID_DONORS = 17
-const MOM_ALFONSO_CANO = 22
-const MOM_MISIL_ANTIAEREO = 27
-const MOM_SENADO_CAMARA = 42
-const MOM_MEXICAN_TRAFFICKERS = 67
-
-const EVT_SUCUMBIOS = 33
-const EVT_DARIEN = 71
-
-const senado_class_list = [
- "token reminder hide",
- "token reminder senado_farc",
- "token reminder senado_auc",
- "token reminder senado_cartels",
-]
+const capability_cards = [ 1, 2, 3, 7, 9, 10, 11, 13, 1, 2, 3, 7, 9, 10, 11, 13, 17, 18 ]
+const momentum_cards = [ 12, 17, 22, 27, 67, 42, 42, 42 ]
+
+function has_momentum(bit) {
+ return view.momentum & (1 << bit)
+}
+
+function has_capability(bit) {
+ return view.capabilities & (1 << bit)
+}
let ui = {
map: document.getElementById("map"),
@@ -276,24 +262,36 @@ let ui = {
document.getElementById("role_FARC_+_Cartels"),
document.getElementById("role_AUC_+_Cartels"),
],
- capabilities: {
- [CAP_1ST_DIV]: document.getElementById("cap_first_div"),
- [CAP_OSPINA]: document.getElementById("cap_ospina"),
- [CAP_TAPIAS]: document.getElementById("cap_tapias"),
- [CAP_7TH_SF]: document.getElementById("cap_seventh_sf"),
- [CAP_MTN_BNS]: document.getElementById("cap_mtn_bns"),
- [CAP_BLACK_HAWKS]: document.getElementById("cap_black_hawks"),
- [CAP_NDSC]: document.getElementById("cap_ndsc"),
- [CAP_METEORO]: document.getElementById("cap_meteoro"),
- },
- momentum: {
- [MOM_PLAN_COLOMBIA]: document.getElementById("mom_12"),
- [MOM_MADRID_DONORS]: document.getElementById("mom_17"),
- [MOM_ALFONSO_CANO]: document.getElementById("mom_22"),
- [MOM_MISIL_ANTIAEREO]: document.getElementById("mom_27"),
- [MOM_SENADO_CAMARA]: document.getElementById("mom_42"),
- [MOM_MEXICAN_TRAFFICKERS]: document.getElementById("mom_67"),
- },
+ capabilities: [
+ document.getElementById("cap_first_div"),
+ document.getElementById("cap_ospina"),
+ document.getElementById("cap_tapias"),
+ document.getElementById("cap_seventh_sf"),
+ document.getElementById("cap_mtn_bns"),
+ document.getElementById("cap_black_hawks"),
+ document.getElementById("cap_ndsc"),
+ document.getElementById("cap_meteoro"),
+ document.getElementById("s_cap_first_div"),
+ document.getElementById("s_cap_ospina"),
+ document.getElementById("s_cap_tapias"),
+ document.getElementById("s_cap_seventh_sf"),
+ document.getElementById("s_cap_mtn_bns"),
+ document.getElementById("s_cap_black_hawks"),
+ document.getElementById("s_cap_ndsc"),
+ document.getElementById("s_cap_meteoro"),
+ document.getElementById("rem_darien"),
+ document.getElementById("rem_sucumbios"),
+ ],
+ momentum: [
+ document.getElementById("mom_12"),
+ document.getElementById("mom_17"),
+ document.getElementById("mom_22"),
+ document.getElementById("mom_27"),
+ document.getElementById("mom_67"),
+ document.getElementById("mom_42_farc"),
+ document.getElementById("mom_42_auc"),
+ document.getElementById("mom_42_cartels"),
+ ],
spaces: [],
control: [],
support: [],
@@ -311,9 +309,9 @@ let ui = {
oppose_plus_bases: document.getElementById("token_oppose_plus_bases"),
president: document.getElementById("token_el_presidente"),
propaganda: document.getElementById("token_prop_card"),
- senado: document.getElementById("rem_senado"),
- darien: document.getElementById("rem_darien"),
- sucumbios: document.getElementById("rem_sucumbios"),
+ senado_farc: document.getElementById("rem_senado_farc"),
+ senado_auc: document.getElementById("rem_senado_auc"),
+ senado_cartels: document.getElementById("rem_senado_cartels"),
},
pieces: [],
resources: [
@@ -455,13 +453,14 @@ function init_ui() {
ui.next_card.onmouseenter = on_focus_next_event
ui.next_card.onmouseleave = on_blur_event
- for (let c of momentum_events)
- register_card_tip(ui.momentum[c], c)
- for (let c of capability_events)
- register_card_tip(ui.capabilities[c], c)
- register_card_tip(ui.tokens.senado, MOM_SENADO_CAMARA)
- register_card_tip(ui.tokens.darien, EVT_DARIEN)
- register_card_tip(ui.tokens.sucumbios, EVT_SUCUMBIOS)
+ for (let i = 0; i < momentum_cards.length; ++i)
+ register_card_tip(ui.momentum[i], momentum_cards[i])
+ for (let i = 0; i < capability_cards.length; ++i)
+ register_card_tip(ui.capabilities[i], capability_cards[i])
+
+ register_card_tip(ui.tokens.senado_farc, 42)
+ register_card_tip(ui.tokens.senado_auc, 42)
+ register_card_tip(ui.tokens.senado_cartels, 42)
ui.farc_zones = [
document.getElementById("tokens").appendChild(create("div", { className: "hide" })),
@@ -1050,26 +1049,15 @@ function on_update() {
ui.player[AUC_CARTELS].classList.toggle("active", view.current === AUC || view.current === CARTELS)
ui.tokens.president.style.left = [ 0, "254px", "337px", "420px" ][view.president]
- ui.tokens.senado.classList = senado_class_list[view.senado]
-
- ui.tokens.darien.classList.toggle("hide", !set_has(view.capabilities, EVT_DARIEN))
- ui.tokens.sucumbios.classList.toggle("hide", !set_has(view.capabilities, EVT_SUCUMBIOS))
-
- for (let cap of capability_events) {
- let shaded = set_has(view.capabilities, -cap)
- let unshaded = set_has(view.capabilities, cap)
- if (shaded || unshaded) {
- ui.capabilities[cap].classList.toggle("shaded", shaded)
- ui.capabilities[cap].classList.toggle("unshaded", unshaded)
- ui.capabilities[cap].classList.toggle("hide", false)
- } else {
- ui.capabilities[cap].classList.toggle("hide", true)
- }
- }
- for (let cap of momentum_events) {
- ui.momentum[cap].classList.toggle("hide", !set_has(view.momentum, cap))
- }
+ ui.tokens.senado_farc.classList.toggle("hide", !has_momentum(MOM_SENADO_FARC))
+ ui.tokens.senado_auc.classList.toggle("hide", !has_momentum(MOM_SENADO_AUC))
+ ui.tokens.senado_cartels.classList.toggle("hide", !has_momentum(MOM_SENADO_CARTELS))
+
+ for (let i = 0; i < capability_cards.length; ++i)
+ ui.capabilities[i].classList.toggle("hide", !has_capability(i))
+ for (let i = 0; i < momentum_cards.length; ++i)
+ ui.momentum[i].classList.toggle("hide", !has_momentum(i))
if (view.propaganda > 0) {
ui.tokens.propaganda.style.top = "744px"
diff --git a/rules.js b/rules.js
index 278dded..7f20b4c 100644
--- a/rules.js
+++ b/rules.js
@@ -35,24 +35,35 @@ const NAME_GOVT_AUC = "Government + AUC"
const NAME_FARC_CARTELS = "FARC + Cartels"
const NAME_AUC_CARTELS = "AUC + Cartels"
-const CAP_1ST_DIV = 1
-const CAP_OSPINA = 2
-const CAP_TAPIAS = 3
-const CAP_7TH_SF = 7
-const CAP_MTN_BNS = 9
-const CAP_BLACK_HAWKS = 10
-const CAP_NDSC = 11
-const CAP_METEORO = 13
-
-const MOM_PLAN_COLOMBIA = 12
-const MOM_MADRID_DONORS = 17
-const MOM_ALFONSO_CANO = 22
-const MOM_MISIL_ANTIAEREO = 27
-const MOM_SENADO_CAMARA = 42
-const MOM_MEXICAN_TRAFFICKERS = 67
-
-const EVT_SUCUMBIOS = 33
-const EVT_DARIEN = 71
+const CAP_1ST_DIV = 0
+const CAP_OSPINA = 1
+const CAP_TAPIAS = 2
+const CAP_7TH_SF = 3
+const CAP_MTN_BNS = 4
+const CAP_BLACK_HAWKS = 5
+const CAP_NDSC = 6
+const CAP_METEORO = 7
+
+const S_CAP_1ST_DIV = 8
+const S_CAP_OSPINA = 9
+const S_CAP_TAPIAS = 10
+const S_CAP_7TH_SF = 11
+const S_CAP_MTN_BNS = 12
+const S_CAP_BLACK_HAWKS = 13
+const S_CAP_NDSC = 14
+const S_CAP_METEORO = 15
+
+const EVT_SUCUMBIOS = 16
+const EVT_DARIEN = 17
+
+const MOM_PLAN_COLOMBIA = 0
+const MOM_MADRID_DONORS = 1
+const MOM_ALFONSO_CANO = 2
+const MOM_MISIL_ANTIAEREO = 3
+const MOM_MEXICAN_TRAFFICKERS = 4
+const MOM_SENADO_FARC = 5
+const MOM_SENADO_AUC = 6
+const MOM_SENADO_CARTELS = 7
const PROPAGANDA = 73
@@ -259,7 +270,8 @@ exports.setup = function (seed, scenario, options) {
scenario: 4,
president: 0,
- senado: 0,
+ capabilities: 0,
+ momentum: 0,
aid: 0,
marked: 0,
govt_control: 0,
@@ -273,8 +285,6 @@ exports.setup = function (seed, scenario, options) {
support: Array(23).fill(NEUTRAL),
deck: [],
- momentum: [],
- capabilities: [], // positive = unshaded, negative = shaded
farc_zones: [],
terror: [],
sabotage: [],
@@ -860,17 +870,17 @@ function is_next_to_venezuela(s) {
function is_space(s) {
if (s === PANAMA)
- return set_has(game.capabilities, EVT_DARIEN)
+ return has_capability(EVT_DARIEN)
if (s === ECUADOR)
- return set_has(game.capabilities, EVT_SUCUMBIOS)
+ return has_capability(EVT_SUCUMBIOS)
return true
}
function is_dept(s) {
if (s === PANAMA)
- return set_has(game.capabilities, EVT_DARIEN)
+ return has_capability(EVT_DARIEN)
if (s === ECUADOR)
- return set_has(game.capabilities, EVT_SUCUMBIOS)
+ return has_capability(EVT_SUCUMBIOS)
return s >= first_dept && s <= last_dept
}
@@ -912,16 +922,12 @@ function is_zero_pop_forest(s) {
// === MISC DYNAMIC QUERIES ===
-function has_momentum(c) {
- return set_has(game.momentum, c)
+function has_momentum(bit) {
+ return game.momentum & (1 << bit)
}
-function has_capability(c) {
- return set_has(game.capabilities, c)
-}
-
-function has_shaded_capability(c) {
- return set_has(game.capabilities, -c)
+function has_capability(bit) {
+ return game.capabilities & (1 << bit)
}
function is_farc_zone(s) {
@@ -1444,9 +1450,9 @@ function can_replace_with(s, faction, piece) {
function can_stack_any(s, faction) {
if (s === PANAMA)
- return set_has(game.capabilities, EVT_DARIEN)
+ return has_capability(EVT_DARIEN)
if (s === ECUADOR)
- return set_has(game.capabilities, EVT_SUCUMBIOS) && count_faction_pieces(s, faction) < 2
+ return has_capability(EVT_SUCUMBIOS) && count_faction_pieces(s, faction) < 2
if (faction === GOVT)
return !is_farc_zone(s)
return true
@@ -2890,7 +2896,7 @@ function end_patrol_assault_space() {
}
function can_patrol_assault() {
- if (has_shaded_capability(CAP_METEORO))
+ if (has_capability(S_CAP_METEORO))
return false
if (game.op.limited)
return can_patrol_assault_space(game.op.limop_space)
@@ -2978,7 +2984,7 @@ states.patrol_done = {
function goto_sweep() {
init_operation("Sweep")
game.state = "sweep"
- if (has_shaded_capability(CAP_OSPINA))
+ if (has_capability(S_CAP_OSPINA))
game.op.limited = 1
}
@@ -3032,9 +3038,9 @@ function can_sweep_activate(s, target = 0) {
if (target === FARC)
return has_underground_guerrilla(s, FARC)
return (
- (game.senado !== FARC && has_underground_guerrilla(s, FARC)) ||
- (game.senado !== AUC && has_underground_guerrilla(s, AUC)) ||
- (game.senado !== CARTELS && has_underground_guerrilla(s, CARTELS))
+ (!has_momentum(MOM_SENADO_FARC) && has_underground_guerrilla(s, FARC)) ||
+ (!has_momentum(MOM_SENADO_AUC) && has_underground_guerrilla(s, AUC)) ||
+ (!has_momentum(MOM_SENADO_CARTELS) && has_underground_guerrilla(s, CARTELS))
)
}
@@ -3169,7 +3175,7 @@ function do_sweep_activate() {
n_troops += count_pieces(game.op.where, AUC, GUERRILLA)
game.op.count = n_troops + n_police
- if (has_shaded_capability(CAP_NDSC))
+ if (has_capability(S_CAP_NDSC))
game.op.count = Math.max(n_troops, n_police)
if (is_forest(game.op.where))
@@ -3189,11 +3195,11 @@ states.sweep_activate = {
if (game.op.faction === FARC) {
gen_underground_guerrillas(game.op.where, FARC)
} else {
- if (game.senado !== FARC)
+ if (!has_momentum(MOM_SENADO_FARC))
gen_underground_guerrillas(game.op.where, FARC)
- if (game.senado !== AUC)
+ if (!has_momentum(MOM_SENADO_AUC))
gen_underground_guerrillas(game.op.where, AUC)
- if (game.senado !== CARTELS)
+ if (!has_momentum(MOM_SENADO_CARTELS))
gen_underground_guerrillas(game.op.where, CARTELS)
}
@@ -3223,7 +3229,7 @@ function do_sweep_next() {
function goto_assault() {
init_operation("Assault")
game.state = "assault"
- if (has_shaded_capability(CAP_TAPIAS))
+ if (has_capability(S_CAP_TAPIAS))
game.op.limited = 1
}
@@ -3309,13 +3315,11 @@ function has_assault_target(s, target) {
if (dept && has_momentum(MOM_MADRID_DONORS))
return false
- for (let faction = 1; faction < 4; ++faction) {
- if (game.senado === faction)
- continue
- if (has_exposed_piece(s, faction))
- return true
- }
- return false
+ return (
+ (!has_momentum(MOM_SENADO_FARC) && has_exposed_piece(s, FARC)) ||
+ (!has_momentum(MOM_SENADO_AUC) && exposed_piece(s, AUC)) ||
+ (!has_momentum(MOM_SENADO_CARTELS) && exposed_piece(s, CARTELS))
+ )
}
function has_exposed_piece(s, faction) {
@@ -3340,7 +3344,7 @@ function assault_kill_count(s, target) {
if (is_mountain(s)) {
if (has_capability(CAP_MTN_BNS))
return n
- if (has_shaded_capability(CAP_MTN_BNS))
+ if (has_capability(S_CAP_MTN_BNS))
return n >> 2
return n >> 1
}
@@ -3356,7 +3360,7 @@ function assault_kill_count(s, target) {
if (is_mountain(s)) {
if (has_capability(CAP_MTN_BNS))
return n + count_pieces(s, GOVT, POLICE)
- if (has_shaded_capability(CAP_MTN_BNS))
+ if (has_capability(S_CAP_MTN_BNS))
return n >> 2
return n >> 1
}
@@ -3415,11 +3419,11 @@ states.assault_space = {
} else if (game.faction === AUC) {
gen_exposed_piece(game.op.where, AUC)
} else {
- if (game.senado !== FARC)
+ if (!has_momentum(MOM_SENADO_FARC))
gen_exposed_piece(game.op.where, FARC)
- if (game.senado !== AUC)
+ if (!has_momentum(MOM_SENADO_AUC))
gen_exposed_piece(game.op.where, AUC)
- if (game.senado !== CARTELS)
+ if (!has_momentum(MOM_SENADO_CARTELS))
gen_exposed_piece(game.op.where, CARTELS)
}
@@ -4233,7 +4237,7 @@ function goto_air_lift() {
game.state = "air_lift_from"
if (has_capability(CAP_BLACK_HAWKS))
game.sa.count = 30
- if (has_shaded_capability(CAP_BLACK_HAWKS))
+ if (has_capability(S_CAP_BLACK_HAWKS))
game.sa.count = 1
}
@@ -5374,7 +5378,7 @@ function can_sabotage_phase_space(s) {
if (!has_sabotage(s)) {
if (is_adjacent_to_city_farc_control(s))
return true
- if (has_shaded_capability(CAP_7TH_SF))
+ if (has_capability(S_CAP_7TH_SF))
return count_guerrillas(s) >= count_cubes(s)
return count_guerrillas(s) > count_cubes(s)
}
@@ -5529,7 +5533,7 @@ states.drug_profits_space = {
function can_civic_action(s) {
if (can_shift_support(s) && has_govt_control(s)) {
- if (has_shaded_capability(CAP_1ST_DIV))
+ if (has_capability(S_CAP_1ST_DIV))
return count_pieces(s, GOVT, TROOPS) >= 2 && count_pieces(s, GOVT, POLICE) >= 2
return has_piece(s, GOVT, TROOPS) && has_piece(s, GOVT, POLICE)
}
@@ -5818,7 +5822,7 @@ function goto_reset_phase() {
game.terror = []
game.sabotage = []
- game.momentum = []
+ game.momentum = 0
game.cylinder[GOVT] = ELIGIBLE
game.cylinder[FARC] = ELIGIBLE
@@ -6105,17 +6109,12 @@ function vm_log() {
}
function vm_momentum() {
- set_add(game.momentum, vm_operand(1))
+ game.momentum |= (1 << vm_operand(1))
vm_next()
}
function vm_capability() {
- set_add(game.capabilities, vm_operand(1))
- vm_next()
-}
-
-function vm_shaded_capability() {
- set_add(game.capabilities, -vm_operand(1))
+ game.capabilities |= (1 << vm_operand(1))
vm_next()
}
@@ -7120,8 +7119,9 @@ exports.view = function (state, role) {
scenario: game.scenario,
current: game.current,
deck: [ this_card, next_card, deck_size ],
+ capabilities: game.capabilities,
+ momentum: game.momentum,
president: game.president,
- senado: game.senado,
aid: game.aid,
cylinder: game.cylinder,
resources: game.resources,
@@ -7132,8 +7132,6 @@ exports.view = function (state, role) {
farc_control: game.farc_control,
support: game.support,
farc_zones: game.farc_zones,
- capabilities: game.capabilities,
- momentum: game.momentum,
terror: game.terror,
sabotage: game.sabotage,
}
@@ -7445,7 +7443,7 @@ CODE[1 * 2 + 0] = [
// SHADED 1
CODE[1 * 2 + 1] = [
[ vm_log, "Civic Action requires at least 2 Troops and 2 Police." ],
- [ vm_shaded_capability, CAP_1ST_DIV ],
+ [ vm_capability, S_CAP_1ST_DIV ],
[ vm_return ],
]
@@ -7459,7 +7457,7 @@ CODE[2 * 2 + 0] = [
// SHADED 2
CODE[2 * 2 + 1] = [
[ vm_log, "Sweep Operations may target only 1 space per card." ],
- [ vm_shaded_capability, CAP_OSPINA ],
+ [ vm_capability, S_CAP_OSPINA ],
[ vm_return ],
]
@@ -7473,7 +7471,7 @@ CODE[3 * 2 + 0] = [
// SHADED 3
CODE[3 * 2 + 1] = [
[ vm_log, "Assault Operations may target only 1 space per card." ],
- [ vm_shaded_capability, CAP_TAPIAS ],
+ [ vm_capability, S_CAP_TAPIAS ],
[ vm_return ],
]
@@ -7554,7 +7552,7 @@ CODE[7 * 2 + 0] = [
// SHADED 7
CODE[7 * 2 + 1] = [
[ vm_log, "Sabotage phase - Sabotage LoCs with any Guerrillas equal to cubes." ],
- [ vm_shaded_capability, CAP_7TH_SF ],
+ [ vm_capability, S_CAP_7TH_SF ],
[ vm_return ],
]
@@ -7583,7 +7581,7 @@ CODE[9 * 2 + 0] = [
// SHADED 9
CODE[9 * 2 + 1] = [
[ vm_log, "Assault in Mountain removes only 1 piece for 4 Troops." ],
- [ vm_shaded_capability, CAP_MTN_BNS ],
+ [ vm_capability, S_CAP_MTN_BNS ],
[ vm_return ],
]
@@ -7597,7 +7595,7 @@ CODE[10 * 2 + 0] = [
// SHADED 10
CODE[10 * 2 + 1] = [
[ vm_log, "Air Lift moves only 1 Troops cube." ],
- [ vm_shaded_capability, CAP_BLACK_HAWKS ],
+ [ vm_capability, S_CAP_BLACK_HAWKS ],
[ vm_return ],
]
@@ -7611,7 +7609,7 @@ CODE[11 * 2 + 0] = [
// SHADED 11
CODE[11 * 2 + 1] = [
[ vm_log, "Operation Activates Guerrillas via Troops or Police, not both." ],
- [ vm_shaded_capability, CAP_NDSC ],
+ [ vm_capability, S_CAP_NDSC ],
[ vm_return ],
]
@@ -7639,7 +7637,7 @@ CODE[13 * 2 + 0] = [
// SHADED 13
CODE[13 * 2 + 1] = [
[ vm_log, "Patrols do not conduct a free Assault." ],
- [ vm_shaded_capability, CAP_METEORO ],
+ [ vm_capability, S_CAP_METEORO ],
[ vm_return ],
]
@@ -8273,8 +8271,18 @@ CODE[42 * 2 + 0] = [
// SHADED 42
CODE[42 * 2 + 1] = [
[ vm_log, ()=>`No Sweep or Assault against ${faction_name[game.current]} until next Propaganda.` ],
- [ vm_asm, ()=>game.senado = game.current ],
- [ vm_momentum, MOM_SENADO_CAMARA ],
+ [ vm_if, ()=>game.current === GOVT ],
+ [ vm_log, "No effect." ],
+ [ vm_endif ],
+ [ vm_if, ()=>game.current === FARC ],
+ [ vm_momentum, MOM_SENADO_FARC ],
+ [ vm_endif ],
+ [ vm_if, ()=>game.current === AUC ],
+ [ vm_momentum, MOM_SENADO_AUC ],
+ [ vm_endif ],
+ [ vm_if, ()=>game.current === CARTELS ],
+ [ vm_momentum, MOM_SENADO_CARTELS ],
+ [ vm_endif ],
[ vm_return ],
]