diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-21 15:49:27 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | f0ad2d92162d5faab8a5537a50f778febc442e9c (patch) | |
tree | 74928175d4746a7d7da96718485fe9d7134cbee2 /rules.js | |
parent | 8b075ffb322b7f885aebe67d4712ffd008cb4878 (diff) | |
download | time-of-crisis-f0ad2d92162d5faab8a5537a50f778febc442e9c.tar.gz |
Mobs (place and display).
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -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) { |