summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-21 15:49:27 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commitf0ad2d92162d5faab8a5537a50f778febc442e9c (patch)
tree74928175d4746a7d7da96718485fe9d7134cbee2 /rules.js
parent8b075ffb322b7f885aebe67d4712ffd008cb4878 (diff)
downloadtime-of-crisis-f0ad2d92162d5faab8a5537a50f778febc442e9c.tar.gz
Mobs (place and display).
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index ee5ea7f..b267844 100644
--- a/rules.js
+++ b/rules.js
@@ -1195,11 +1195,13 @@ states.take_actions = {
gen_action_card(c)
if (game.selected_governor >= 0) {
+ view.color = SENATE
view.selected_governor = game.selected_governor
where = get_governor_location(game.selected_governor)
}
if (game.selected_general >= 0) {
+ view.color = MILITARY
view.selected_general = game.selected_general
where = get_general_location(game.selected_general)
}
@@ -1642,7 +1644,7 @@ states.place_governor = {
let votes = game.misc.spend
if (game.misc.where === ITALIA)
votes += count_own_basilicas()
- view.selected_governor = game.selected_governor
+ view.color = SENATE
view.selected_region = game.misc.where
prompt(`Place Governor: ${sip} Senate. Rolling ${votes} dice. ${need} votes needed.`)
@@ -1890,6 +1892,34 @@ states.foederati = {
},
}
+// CARD: MOB
+
+function can_play_mob() {
+ for (let where = 0; where < 12; ++where)
+ if (!has_mob(where) && is_enemy_province(where))
+ return true
+ return false
+}
+
+function play_mob() {
+ game.state = "mob"
+}
+
+states.mob = {
+ prompt() {
+ prompt("Mob: Place a Mob in a province.")
+ view.color = POPULACE
+ for (let where = 0; where < 12; ++where)
+ if (!has_mob(where) && is_enemy_province(where))
+ gen_action_region(where)
+ },
+ region(where) {
+ log("Mob in S" + where)
+ add_one_mob(where)
+ game.state = "take_actions"
+ },
+}
+
// === COMBAT ===
function goto_battle_vs_general(where, attacker, target) {