From d68a8f5426e335fce66c8b366646657115bbe65a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 20 Jun 2023 18:10:33 +0200 Subject: Clickable support boxes. This reverts commit 0a1c421615aebefd26accf668c4ec640be917344. --- rules.js | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 8a3d25c..7b7cc40 100644 --- a/rules.js +++ b/rules.js @@ -1088,7 +1088,7 @@ states.take_actions_governor = { let support = game.support[where] if (where !== ITALIA && support < 4) { if (pip > support) - view.actions.support = 1 + gen_action_support(where, support + 1) } // Place Militia @@ -1127,19 +1127,12 @@ states.take_actions_governor = { else goto_battle_vs_general(get_governor_location(game.who), -1, id) }, - recruit() { push_undo() log("Recruited Governor " + (game.who % 6) + ".") spend_ip(SENATE, game.who % 6) set_governor_location(game.who, AVAILABLE) }, - place() { - push_undo() - spend_ip(SENATE, 1) - game.state = "place_governor_where" - game.misc = { spend: 1 } - }, recall() { push_undo() let where = get_governor_location(game.who) @@ -1186,7 +1179,7 @@ states.take_actions_governor = { push_undo() spend_ip(SENATE, 1) game.misc = { spend: 1, where: where } - game.state = "place_governor_spend" + game.state = "place_governor" }, barbarian(id) { @@ -1411,23 +1404,7 @@ function calc_needed_votes(where) { return Math.max(1, n) } -states.place_governor_where = { - prompt() { - prompt("Place Governor.") - view.selected_governor = game.who - for (let where = 0; where < 12; ++where) { - if (can_place_governor(where)) - gen_action_region(where) - } - }, - region(where) { - push_undo() - game.misc.where = where - game.state = "place_governor_spend" - }, -} - -states.place_governor_spend = { +states.place_governor = { prompt() { let [ mip, sip, pip ] = game.ip let need = calc_needed_votes(game.misc.where) @@ -2355,6 +2332,10 @@ function gen_action_capital(where) { gen_action("capital", where) } +function gen_action_support(where, level) { + gen_action("support", where << 3 | level) +} + function gen_action_card(c) { gen_action("card", c) } -- cgit v1.2.3