summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-20 18:10:33 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commitd68a8f5426e335fce66c8b366646657115bbe65a (patch)
treecd509fbc50bddbb65d725652a2a86e9c388a8256 /rules.js
parent8fb42cd1821020f433d19c01ce70fa45b4797ec4 (diff)
downloadtime-of-crisis-d68a8f5426e335fce66c8b366646657115bbe65a.tar.gz
Clickable support boxes.
This reverts commit 0a1c421615aebefd26accf668c4ec640be917344.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js33
1 files changed, 7 insertions, 26 deletions
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)
}