diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-04-22 22:57:45 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-05-03 18:48:16 +0200 |
commit | 8148bf409dc791bf455d91128ec6d1d515011d2e (patch) | |
tree | a02447889caa82e795691287cb2234e830700d4f /rules.js | |
parent | b81b5afac811905146ba775c744b5154400cff74 (diff) | |
download | andean-abyss-8148bf409dc791bf455d91128ec6d1d515011d2e.tar.gz |
Revert "WIP extort" (DO NOT KEEP - ONLY FOR REPLAY)
This reverts commit d9f631cbdeb00c1d905be48106b2d0709cdf0591.
# Conflicts:
# rules.js
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 53 |
1 files changed, 24 insertions, 29 deletions
@@ -4899,37 +4899,25 @@ function goto_extort() { states.extort = { prompt() { - view.prompt = "Extort: Select space with Underground Guerrilla that you control." - for (let s = first_space; s <= last_space; ++s) { - if (set_has(game.sa.spaces, s)) - continue - if (has_underground_guerrilla(s, game.current)) { - if (game.current === FARC && has_farc_control(s)) - gen_action_space(s) - if (game.current === AUC && has_auc_control(s)) - gen_action_space(s) + if (game.sa.where < 0) { + view.prompt = "Extort: Select space with Underground Guerrilla that you control." + for (let s = first_space; s <= last_space; ++s) { + if (set_has(game.sa.spaces, s)) + continue + if (has_underground_guerrilla(s, game.current)) { + if (game.current === FARC && has_farc_control(s)) + gen_action_space(s) + if (game.current === AUC && has_auc_control(s)) + gen_action_space(s) + } } + } else { + view.prompt = `Extort in ${space_name[game.sa.where]}.` + view.where = game.sa.where + gen_underground_guerrillas(game.sa.where, game.current) } view.actions.end_extort = 1 }, - space(s) { - push_undo() - game.sa.where = s - set_add(game.sa.spaces, s) - game.state = "extort_space" - }, - end_extort() { - push_undo() - end_extort() - }, -} - -states.extort_space = { - prompt() { - view.prompt = `Extort in ${space_name[game.sa.where]}.` - view.where = game.sa.where - gen_underground_guerrillas(game.sa.where, game.current) - }, piece(p) { game.sa.count += 1 logi("S" + game.sa.where) @@ -4938,8 +4926,15 @@ states.extort_space = { game.sa.where = -1 if (!can_extort_again()) end_extort() - else - game.state = "extort" + }, + space(s) { + push_undo() + game.sa.where = s + set_add(game.sa.spaces, s) + }, + end_extort() { + push_undo() + end_extort() }, } |