summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-08 18:41:10 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-08 18:41:10 +0100
commitdd918e42f7b872457c6811659d66fde48c538c85 (patch)
tree24ffc6b753fb846f629f6bde97f16921a90f4cf0
parent5b5883d5b9bc6deecc28d0ff87b2dd321314d964 (diff)
downloadvotes-for-women-dd918e42f7b872457c6811659d66fde48c538c85.tar.gz
fix The Great 1906 San Francisco Earthquake
-rw-r--r--rules.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index a6f250e..5660b4a 100644
--- a/rules.js
+++ b/rules.js
@@ -2689,7 +2689,10 @@ states.vm_remove_cubes = {
inactive: "remove a cube.",
prompt() {
if (game.vm.all) {
- event_prompt(`Remove all ${COLOR_NAMES[game.vm.cubes]} cubes.`)
+ if (game.vm.cubes === PURPLE_OR_YELLOW)
+ event_prompt(`Remove all Purple and Yellow cubes.`)
+ else
+ event_prompt(`Remove all ${COLOR_NAMES[game.vm.cubes]} cubes.`)
} else {
event_prompt(`Remove ${pluralize(game.vm.count, COLOR_NAMES[game.vm.cubes] + ' cube')}`)
if (game.vm.limit)
@@ -2697,14 +2700,24 @@ states.vm_remove_cubes = {
view.prompt += '.'
}
+ let can_remove = false
for (let s of game.vm.us_states) {
- if ((game.vm.cubes === PURPLE || game.vm.cubes === PURPLE_OR_YELLOW) && purple_cubes(s))
+ if ((game.vm.cubes === PURPLE || game.vm.cubes === PURPLE_OR_YELLOW) && purple_cubes(s)) {
gen_action_purple_cube(s)
- if ((game.vm.cubes === YELLOW || game.vm.cubes === PURPLE_OR_YELLOW) && yellow_cubes(s))
+ can_remove = true
+ }
+ if ((game.vm.cubes === YELLOW || game.vm.cubes === PURPLE_OR_YELLOW) && yellow_cubes(s)) {
gen_action_yellow_cube(s)
- if (game.vm.cubes === RED && red_cubes(s))
+ can_remove = true
+ }
+ if (game.vm.cubes === RED && red_cubes(s)) {
gen_action_red_cube(s)
+ can_remove = true
+ }
}
+
+ if (!can_remove)
+ gen_action("next")
},
purple_cube(s) {
push_undo()
@@ -2720,6 +2733,9 @@ states.vm_remove_cubes = {
push_undo()
remove_cube(RED, s)
after_vm_remove_cube(s)
+ },
+ next() {
+ vm_next()
}
}