From 2963cf5d82063c3a7583feea0fad94d55aad91c9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 28 Apr 2023 19:35:46 +0200 Subject: Manual +4 Aid for Eradicate. No Resources prompt for Bribe. --- rules.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 69b39b9..7721f2a 100644 --- a/rules.js +++ b/rules.js @@ -4961,18 +4961,31 @@ states.eradicate = { }, space(s) { game.sa.where = s + game.state = "eradicate_aid" log_space(game.sa.where, "Eradicate") + } +} + +states.eradicate_aid = { + prompt() { + view.prompt = "Eradicate: Add +4 Aid." + view.actions.aid = 1 + }, + aid() { logi("Aid +4") add_aid(4) - - if (has_piece(s, CARTELS, BASE)) - game.state = "eradicate_base" - else - goto_eradicate_shift() + resume_eradicate_base() } } +function resume_eradicate_base() { + if (has_piece(game.sa.where, CARTELS, BASE)) + game.state = "eradicate_base" + else + goto_eradicate_shift() +} + states.eradicate_base = { prompt() { view.prompt = `Eradicate: Remove Cartel Bases in ${space_name[game.sa.where]}.` @@ -4982,8 +4995,7 @@ states.eradicate_base = { piece(p) { logi("Removed Cartels Base") remove_piece(p) - if (!has_piece(game.sa.where, CARTELS, BASE)) - goto_eradicate_shift() + resume_eradicate_base() } } @@ -5697,11 +5709,13 @@ function resume_bribe() { states.bribe = { prompt() { - view.prompt = `Bribe: Select up to 3 spaces.` if (game.resources[CARTELS] >= 3) { + view.prompt = `Bribe: Select up to 3 spaces.` for (let s = first_space; s <= last_space; ++s) if (!set_has(game.sa.spaces, s) && has_enemy_piece(s)) gen_action_space(s) + } else { + view.prompt = "Bribe: No Resources." } view.actions.end_bribe = 1 }, -- cgit v1.2.3