From dd918e42f7b872457c6811659d66fde48c538c85 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:41:10 +0100 Subject: fix The Great 1906 San Francisco Earthquake --- rules.js | 24 ++++++++++++++++++++---- 1 file 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() } } -- cgit v1.2.3