summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-24 15:38:18 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commitf944c920db683e2b345b08df55bc51aa35232b77 (patch)
treee04d5972a65d853974a94048129971d5fea8fa30 /rules.js
parent0b55f794a180c8afc87a71775e858fcc01fc3bf2 (diff)
downloadtime-of-crisis-f944c920db683e2b345b08df55bc51aa35232b77.tar.gz
Place Governor / Create Army steps.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js60
1 files changed, 49 insertions, 11 deletions
diff --git a/rules.js b/rules.js
index 7ad0685..326cfe8 100644
--- a/rules.js
+++ b/rules.js
@@ -1707,13 +1707,15 @@ states.take_actions = {
// Place Governor
if (game.selected_governor >= 0 && where === AVAILABLE) {
- gen_place_governor()
+ view.actions.place_governor = 1
+ // gen_place_governor()
}
// Create Army
if (game.selected_general >= 0 && where === AVAILABLE) {
if (mip >= 1 && find_unused_legion() >= 0)
- gen_create_army()
+ // gen_create_army()
+ view.actions.create_army = 1
}
// Governor Actions
@@ -1900,6 +1902,18 @@ states.take_actions = {
recall_governor()
},
+ place_governor() {
+ push_undo()
+ spend_senate(1)
+ game.count = 1
+ game.state = "place_governor_where"
+ },
+
+ create_army() {
+ push_undo()
+ game.state = "create_army"
+ },
+
support() {
push_undo()
improve_support()
@@ -2170,12 +2184,9 @@ function recall_governor() {
// ACTION: PLACE GOVERNOR
function gen_place_governor() {
- let sip = game.ip[SENATE]
- if (sip >= 1) {
- for (let where = 0; where < 12; ++where)
- if (can_place_governor(where))
- gen_action_region(where)
- }
+ for (let where = 0; where < 12; ++where)
+ if (can_place_governor(where))
+ gen_action_region(where)
}
function reduce_support(where) {
@@ -2259,6 +2270,20 @@ function calc_needed_votes(where, pg) {
return Math.max(1, n)
}
+states.place_governor_where = {
+ prompt() {
+ prompt("Place Governor: Choose a province.")
+ view.color = SENATE
+ view.selected_governor = game.selected_governor
+ gen_place_governor()
+ },
+ region(where) {
+ push_undo()
+ game.where = where
+ game.state = "place_governor"
+ },
+}
+
states.place_governor = {
prompt() {
let sip = game.ip[SENATE]
@@ -2496,6 +2521,19 @@ function create_army(where) {
game.state = "take_actions"
}
+states.create_army = {
+ prompt() {
+ prompt("Create Army: Choose a province you govern.")
+ view.color = MILITARY
+ view.selected_general = game.selected_general
+ gen_create_army()
+ },
+ region(where) {
+ push_undo()
+ create_army(where)
+ },
+}
+
// ACTION: MOVE ARMY
function gen_move_army() {
@@ -2566,7 +2604,7 @@ function play_castra() {
states.castra = {
prompt() {
- prompt("Castra: Select an army you command.")
+ prompt("Castra: Choose an army you command.")
for (let where = 0; where < 12; ++where)
if (!has_militia_castra(where) && has_lone_militia(where) && is_own_province(where))
gen_action_militia(where)
@@ -2605,7 +2643,7 @@ function play_quaestor() {
states.quaestor = {
prompt() {
- prompt("Quaestor: Select a province you govern.")
+ prompt("Quaestor: Choose a province you govern.")
view.color = POPULACE
for (let where = 0; where < 12; ++where)
if (!has_quaestor(where) && !is_breakaway(where) && !is_seat_of_power(where) && is_own_province(where))
@@ -2712,7 +2750,7 @@ function play_foederati() {
states.foederati = {
prompt() {
- prompt("Foederati: Select an army you command...")
+ prompt("Foederati: Choose an army you command...")
for (let i = 0; i < 6; ++i) {
let id = game.current * 6 + i
let where = get_general_location(id)