summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-30 00:08:57 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commit2a870a0df343cd07858631232d5793bc44d2ae35 (patch)
treee5a3c088e4366efd3054154cc1400aa120116e01
parent491a985f0ff639f337bfcb418b0022a35b5b6e86 (diff)
downloadandean-abyss-2a870a0df343cd07858631232d5793bc44d2ae35.tar.gz
Remove dead code.
-rw-r--r--events.txt2
-rw-r--r--rules.js74
2 files changed, 10 insertions, 66 deletions
diff --git a/events.txt b/events.txt
index 543a6ae..7ac5fef 100644
--- a/events.txt
+++ b/events.txt
@@ -371,7 +371,7 @@ SHADED 27
EVENT 28
prompt "Remove up to 3 Insurgent pieces from a space next to Venezuela."
space 1 is_next_to_venezuela(s) && has_insurgent_piece(s)
- # Note: up to negates requirement for maxiumum damage
+ # Note: up to negates requirement for maximumum damage
prompt "Remove up to 3 Insurgent pieces."
piece_opt 3 is_piece_in_event_space(p) && is_insurgent_piece(p)
remove
diff --git a/rules.js b/rules.js
index d7b83aa..0b88ec9 100644
--- a/rules.js
+++ b/rules.js
@@ -571,7 +571,7 @@ function pop_summary() {
game.summary = null
}
-function log_summary_place(p, to) {
+function log_summary_place(p) {
let from = piece_space(p)
if (from !== AVAILABLE)
log_summary("% " + piece_name(p) + " from S" + from)
@@ -579,10 +579,6 @@ function log_summary_place(p, to) {
log_summary("% " + piece_name(p))
}
-function log_summary_auto_place(f, t, to) {
- log_summary("% " + piece_faction_type_name[f][t])
-}
-
function log_summary_move_to_from(p, to) {
log_summary("% " + piece_name(p) + " to S" + to + " from S" + piece_space(p))
}
@@ -699,7 +695,6 @@ function is_govt_base(p) { return is_piece(p, GOVT, BASE) }
function is_troops(p) { return is_piece(p, GOVT, TROOPS) }
function is_police(p) { return is_piece(p, GOVT, POLICE) }
function is_cube(p) { return is_troops(p) || is_police(p) }
-function is_govt_piece(p) { return is_govt_base(p) || is_cube(p) }
function is_farc_base(p) { return is_piece(p, FARC, BASE) }
function is_farc_guerrilla(p) { return is_piece(p, FARC, GUERRILLA) }
@@ -814,24 +809,6 @@ function count_guerrillas(s) {
)
}
-function count_faction_underground_guerrillas(s, faction) {
- let first = first_piece[faction][GUERRILLA]
- let last = last_piece[faction][GUERRILLA]
- let n = 0
- for (let p = first; p <= last; ++p)
- if (piece_space(p) === s && is_underground(p))
- ++n
- return n
-}
-
-function count_any_underground_guerrillas(s) {
- return (
- count_faction_underground_guerrillas(s, FARC) +
- count_faction_underground_guerrillas(s, AUC) +
- count_faction_underground_guerrillas(s, CARTELS)
- )
-}
-
function find_piece(s, faction, type) {
let first = first_piece[faction][type]
let last = last_piece[faction][type]
@@ -888,7 +865,6 @@ function has_govt_base(s) { return has_piece(s, GOVT, BASE) }
function has_troops(s) { return has_piece(s, GOVT, TROOPS) }
function has_police(s) { return has_piece(s, GOVT, POLICE) }
function has_cube(s) { return has_piece(s, GOVT, TROOPS) || has_piece(s, GOVT, POLICE) }
-function has_govt_piece(s) { return has_piece(s, GOVT, BASE) || has_piece(s, GOVT, TROOPS) || has_piece(s, GOVT, POLICE) }
function has_farc_guerrilla(s) { return has_piece(s, FARC, GUERRILLA) }
function has_farc_piece(s) { return has_piece(s, FARC, BASE) || has_piece(s, FARC, GUERRILLA) }
@@ -2840,7 +2816,7 @@ states.train_place = {
view.actions.next = 1
},
piece(p) {
- log_summary_place(p, game.op.where)
+ log_summary_place(p)
place_piece(p, game.op.where)
if (--game.op.count === 0)
end_train_place()
@@ -4024,7 +4000,7 @@ states.rally_space = {
view.actions.skip = 1
},
piece(p) {
- log_summary_place(p, game.op.where)
+ log_summary_place(p)
place_piece(p, game.op.where)
game.state = "rally_guerrillas"
if (++game.op.count >= rally_count() || !can_stack_piece(game.op.where, game.current, GUERRILLA))
@@ -4050,7 +4026,7 @@ states.rally_guerrillas = {
view.actions.next = 1
},
piece(p) {
- log_summary_place(p, game.op.where)
+ log_summary_place(p)
place_piece(p, game.op.where)
game.state = "rally_guerrillas"
if (++game.op.count >= rally_count() || !can_stack_piece(game.op.where, game.current, GUERRILLA))
@@ -4567,13 +4543,6 @@ function vm_free_terror_with_piece() {
do_terror_piece(game.vm.p)
}
-function vm_free_terror_without_piece() {
- init_free_operation("Terror", game.vm.s)
- if (game.current === AUC)
- game.vm.auc_terror = 0
- do_terror_piece(game.vm.p)
-}
-
function can_terror() {
for (let s = first_space; s <= last_space; ++s)
if (can_terror_in_space(s))
@@ -5853,7 +5822,7 @@ states.contraband = {
resume_bribe()
},
remove() {
- log_transfor("Contraband - removed Shipment in S" + game.sa.where)
+ log_transfer("Contraband - removed Shipment in S" + game.sa.where)
remove_shipment(find_stealable_shipment())
if (!can_steal_dropped_shipments())
resume_bribe()
@@ -5984,25 +5953,11 @@ function goto_sabotage_phase() {
log_action("Sabotage")
- // TODO: manual or automatic sabotage
- if (false) {
- if (can_sabotage_phase()) {
- log_action("Sabotage")
- for (let s = first_loc; s <= last_loc; ++s) {
- if (can_sabotage_phase_space(s)) {
- logi("S" + s)
- place_sabotage(s)
- }
- }
- }
- goto_resources_phase()
+ if (can_sabotage_phase()) {
+ game.state = "sabotage"
} else {
- if (can_sabotage_phase()) {
- game.state = "sabotage"
- } else {
- logi("Nothing")
- end_sabotage_phase()
- }
+ logi("Nothing")
+ end_sabotage_phase()
}
}
@@ -6453,17 +6408,6 @@ function goto_redeploy_phase() {
game.state = "redeploy_mandatory"
}
-function is_redeploy_done() {
- for (let p = first_piece[GOVT][TROOPS]; p <= last_piece[GOVT][TROOPS]; ++p) {
- let s = piece_space(p)
- if (is_loc(s))
- return false
- if (is_dept(s) && !has_govt_base(s))
- return false
- }
- return true
-}
-
function find_first_redeploy_troops() {
let p0 = first_piece[GOVT][TROOPS]
let p1 = last_piece[GOVT][TROOPS]