From 6f1a3ae0ae68bcca7df261662ded93474f4912f2 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Fri, 24 Nov 2023 13:31:21 +0100 Subject: remove end event prompt. fix add campaigner --- events.txt | 2 +- rules.js | 15 ++++++++------- 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 ], ] -- cgit v1.2.3