summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-24 13:31:21 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-24 13:31:21 +0100
commit6f1a3ae0ae68bcca7df261662ded93474f4912f2 (patch)
treef1d55aa16cda7718c7e39a9f8466464ba9d35810
parentf6b23c2e03ba1d38cfa392a9d1d069c5af1a6473 (diff)
downloadvotes-for-women-6f1a3ae0ae68bcca7df261662ded93474f4912f2.tar.gz
remove end event prompt. fix add campaigner
-rw-r--r--events.txt2
-rw-r--r--rules.js15
2 files changed, 9 insertions, 8 deletions
diff --git a/events.txt b/events.txt
index 1af104a..06b2122 100644
--- a/events.txt
+++ b/events.txt
@@ -374,7 +374,7 @@ CARD 70 - Old Dixie
CARD 71 - NAOWS Forms
# Add 1 :red_campaigner in the Northeast region. Receive 2 :button.
- add_campaigner NORTHEAST
+ add_campaigner RED NORTHEAST
receive_buttons 2
CARD 72 - Woman and the Republic
diff --git a/rules.js b/rules.js
index 4e961de..bb0d0f4 100644
--- a/rules.js
+++ b/rules.js
@@ -187,14 +187,14 @@ function us_state_region(s) {
return US_STATES[s].region
}
-function free_campaigner(campaigners, color) {
- const start = color === YELLOW ? 2 : color === RED ? 4 : 0
- const index = campaigners.indexOf(0, start)
- return index > start + 1 ? -1 : index
+function free_campaigner(color) {
+ const start = (color === YELLOW) ? 2 : color === RED ? 4 : 0
+ const index = game.campaigners.indexOf(0, start)
+ return index > (start + 1) ? -1 : index
}
function add_campaigner(color, region) {
- const index = free_campaigner(game.campaigners, color)
+ const index = free_campaigner(color)
if (index !== -1) {
game.campaigners[index] = region
} else {
@@ -1767,7 +1767,8 @@ function vm_goto() {
}
function vm_return() {
- game.state = "vm_return"
+ // game.state = "vm_return"
+ end_event()
}
states.vm_return = {
@@ -3467,7 +3468,7 @@ CODE[70] = [ // Old Dixie
]
CODE[71] = [ // NAOWS Forms
- [ vm_add_campaigner, NORTHEAST ],
+ [ vm_add_campaigner, RED, NORTHEAST ],
[ vm_receive_buttons, 2 ],
[ vm_return ],
]