From f0ad2d92162d5faab8a5537a50f778febc442e9c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 21 Jun 2023 15:49:27 +0200 Subject: Mobs (place and display). --- rules.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'rules.js') 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) { -- cgit v1.2.3