summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-23 06:24:05 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-23 06:25:41 +0100
commit03c4a354b436f134371b9b878a9c212772ee60e2 (patch)
tree5366a4d139451e6fb80caadfd6a5e81a7769799a
parenta47216b161ef15762626d221bfcfe90947f0ce05 (diff)
downloadvotes-for-women-03c4a354b436f134371b9b878a9c212772ee60e2.tar.gz
Superior Lobbying
-rw-r--r--events.txt7
-rw-r--r--rules.js37
2 files changed, 35 insertions, 9 deletions
diff --git a/events.txt b/events.txt
index 56c7ffb..52fcf8e 100644
--- a/events.txt
+++ b/events.txt
@@ -578,7 +578,12 @@ CARD 109 - Bellwether State
CARD 110 - Superior Lobbying
# Roll 4 :d8. For each 6, 7 or 8 rolled, add 1 :congressional_marker to Congress or remove 1 :congressional_marker from Congress.
- todo
+ roll_list 4 D8
+ if (game.active === SUF)
+ add_congress (game.vm.roll.filter(x => x >= 6).length)
+ else
+ remove_congress (game.vm.roll.filter(x => x >= 6).length)
+ endif
CARD 111 - The Winning Plan
# Draw 6 cards from your Draw Deck. Play 1 card for its event immediately. Place any number of the remaining 5 cards on the top of your Draw Deck and the rest at the bottom of your Draw Deck.
diff --git a/rules.js b/rules.js
index 1ff165c..12d10bd 100644
--- a/rules.js
+++ b/rules.js
@@ -1862,8 +1862,8 @@ function vm_replace() {
}
function vm_add_congress() {
- if (!game.nineteenth_amendment) {
- game.vm.count = vm_operand(1)
+ game.vm.count = vm_operand(1)
+ if (!game.nineteenth_amendment && game.vm.count) {
game.state = "vm_add_congress"
} else {
vm_next()
@@ -1871,8 +1871,8 @@ function vm_add_congress() {
}
function vm_remove_congress() {
- if (!game.nineteenth_amendment && game.congress > 0) {
- game.vm.count = vm_operand(1)
+ game.vm.count = vm_operand(1)
+ if (!game.nineteenth_amendment && game.congress > 0 && game.vm.count) {
game.state = "vm_remove_congress"
} else {
vm_next()
@@ -1885,6 +1885,13 @@ function vm_roll() {
game.state = "vm_roll"
}
+function vm_roll_list() {
+ game.vm.count = vm_operand(1)
+ game.vm.d = vm_operand(2)
+ game.vm.roll_list = true
+ game.state = "vm_roll"
+}
+
function vm_move_each_player_campaigner_free() {
if (has_player_active_campaigners()) {
game.vm.moved = []
@@ -2450,7 +2457,10 @@ states.vm_roll = {
inactive: "roll dice.",
prompt() {
if (game.vm.roll) {
- event_prompt(`You rolled ${game.vm.roll}.`)
+ if (game.vm.roll_list)
+ event_prompt(`You rolled ${game.vm.roll.join(", ")}.`)
+ else
+ event_prompt(`You rolled ${game.vm.roll}.`)
} else if (game.vm.count === 1) {
event_prompt("Roll a die.")
} else {
@@ -2465,11 +2475,17 @@ states.vm_roll = {
}
},
roll() {
- game.vm.roll = roll_ndx(game.vm.count, game.vm.d)
+ if (game.vm.roll_list)
+ game.vm.roll = roll_ndx_list(game.vm.count, game.vm.d)
+ else
+ game.vm.roll = roll_ndx(game.vm.count, game.vm.d)
},
reroll() {
decrease_player_buttons(1)
- game.vm.roll = roll_ndx(game.vm.count, game.vm.d, "B", "Re-rolled")
+ if (game.vm.roll_list)
+ game.vm.roll = roll_ndx_list(game.vm.count, game.vm.d, "B", "Re-rolled")
+ else
+ game.vm.roll = roll_ndx(game.vm.count, game.vm.d, "B", "Re-rolled")
},
next() {
vm_next()
@@ -3572,7 +3588,12 @@ CODE[109] = [ // Bellwether State
]
CODE[110] = [ // Superior Lobbying
- [ vm_todo ],
+ [ vm_roll_list, 4, D8 ],
+ [ vm_if, ()=>(game.active === SUF) ],
+ [ vm_add_congress, ()=>(game.vm.roll.filter(x => x >= 6).length) ],
+ [ vm_else ],
+ [ vm_remove_congress, ()=>(game.vm.roll.filter(x => x >= 6).length) ],
+ [ vm_endif ],
[ vm_return ],
]