summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-08-13 21:50:50 +0200
committerTor Andersson <tor@ccxvii.net>2023-08-13 21:50:50 +0200
commitce9ac19b171a23d04939ca13a48258d5a26eac7e (patch)
tree8eb64525cfc13a068b6a2cb8caa0ea4d54d86649
parentca43b789e4ad9ffd866cd10ab57f0e26bc87860d (diff)
downloadtime-of-crisis-ce9ac19b171a23d04939ca13a48258d5a26eac7e.tar.gz
Place Governor: Automatic vs players if enough guaranteed votes.
From Ambitus or Populace Emperor malus.
-rw-r--r--rules.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 90f42d4..56798fe 100644
--- a/rules.js
+++ b/rules.js
@@ -2450,19 +2450,20 @@ function format_votes(need, extra, dice) {
return s
}
-function gen_place_governor_spend(ip, enough, action) {
+function gen_place_governor_spend(ip, need, extra, dice, action) {
+ let enough = need - extra - dice
view.selected_region = game.where
view.selected_governor = game.selected_governor
// Don't prompt "Ambitus" if already enough votes for automatic success.
- if (!is_neutral_province(game.where) || enough > 0) {
+ if (!(is_neutral_province(game.where) || extra >= need) || enough > 0) {
if (game.ambitus < game.count && has_card_event(CARD_P2X)) {
view.prompt += " Ambitus?"
gen_card_event(CARD_P2X)
}
}
- if (is_neutral_province(game.where)) {
+ if (is_neutral_province(game.where) || extra >= need) {
if (enough > 0) {
view.actions[action] = (ip >= 1) ? 1 : 0
view.actions.automatic = 0
@@ -2486,7 +2487,7 @@ states.place_governor = {
let dice = calc_used_dice()
view.color = SENATE
prompt("Place Governor: " + game.sip + " senate. " + format_votes(need, extra, dice))
- gen_place_governor_spend(game.sip, need - extra - dice, "spend_senate")
+ gen_place_governor_spend(game.sip, need, extra, dice, "spend_senate")
},
card(c) {
push_undo()
@@ -2522,7 +2523,7 @@ states.praetorian_guard = {
let dice = calc_used_dice()
view.color = MILITARY
prompt("Praetorian Guard: " + game.mip + " military. " + format_votes(need, extra, dice))
- gen_place_governor_spend(game.mip, need - extra - dice, "spend_military")
+ gen_place_governor_spend(game.mip, need, extra, dice, "spend_military")
},
card(c) {
push_undo()