summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-12 15:20:10 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-12 15:20:10 +0100
commiteaeccb83ba422b34f0763a7cf682cb8cb8523f86 (patch)
treec89985ce5f8a7de0fbb36145e9970a99f61bddea
parent450b5af109596d4cec22a0bf994f2a4947be784c (diff)
downloadvotes-for-women-eaeccb83ba422b34f0763a7cf682cb8cb8523f86.tar.gz
Strategy Phase: don't overcommit, auto-match/defer if opp can't afford otherwise
-rw-r--r--rules.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 72d532b..9e1eb22 100644
--- a/rules.js
+++ b/rules.js
@@ -889,7 +889,7 @@ states.strategy_phase = {
prompt() {
if (game.active === SUF) {
view.prompt = `Strategy: ${pluralize(game.support_committed, 'button')} committed.`
- if (game.support_buttons > 0) {
+ if (game.support_buttons > 0 && game.support_committed < game.opposition_buttons + 1) {
gen_action("commit_1_button")
}
gen_action("commit")
@@ -900,16 +900,22 @@ states.strategy_phase = {
view.actions.supersede = 0
if (game.support_committed > 0) {
view.actions.defer = 1
- view.prompt += ` Defer with 0 buttons.`
+ view.prompt += " Spend 0 to defer"
}
if (game.opposition_buttons >= game.support_committed) {
view.actions.match = 1
- view.prompt += ` Match with ${pluralize(game.support_committed, 'button')}.`
+ if (view.actions.defer) {
+ view.prompt += ","
+ } else {
+ view.prompt += " Spend"
+ }
+ view.prompt += ` ${game.support_committed} to match`
}
if (game.opposition_buttons > game.support_committed) {
view.actions.supersede = 1
- view.prompt += ` Supersede with ${pluralize(game.support_committed + 1, 'button')}.`
+ view.prompt += `, ${game.support_committed + 1} to supersede`
}
+ view.prompt += '.'
}
},
commit_1_button() {
@@ -922,6 +928,11 @@ states.strategy_phase = {
clear_undo()
log(`Suffragist committed ${game.support_committed} BM`)
game.active = OPP
+ if (!game.support_committed && !game.opposition_buttons) {
+ this.match()
+ } else if (game.support_committed > game.opposition_buttons) {
+ this.defer()
+ }
},
defer() {
log(`Opposition deferred.`)