diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-01-09 16:10:26 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:12:55 +0100 |
commit | 71e9b55381f573a19919e89f1dcf444551401ed3 (patch) | |
tree | 1c341ae2bedf8054b6a6c055ad873a2498c7c42a | |
parent | 043d001a97f8e0a793a066b1cf17ba65a6a960b6 (diff) | |
download | richard-iii-71e9b55381f573a19919e89f1dcf444551401ed3.tar.gz |
Manually reduce blocks during plague event.
-rw-r--r-- | rules.js | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -1531,17 +1531,38 @@ states.plague_event = { }, area: function (where) { log("Plague ravages " + has_city(where) + "!"); - for (let b in BLOCKS) { + game.where = where; + game.plague = []; + for (let b in BLOCKS) if (game.location[b] === where) - reduce_block(b); - } - end_player_turn(); + game.plague.push(b); + game.active = game.p2; + game.state = 'apply_plague'; }, pass: function () { end_player_turn(); } } +states.apply_plague = { + prompt: function (view, current) { + if (is_inactive_player(current)) + return view.prompt = "Plague: Waiting for " + game.active + " to reduce blocks in " + has_city(game.where) + "."; + view.prompt = "Plague: Reduce blocks in " + has_city(game.where) + "."; + for (let b of game.plague) + gen_action(view, 'block', b); + }, + block: function (b) { + reduce_block(b); + remove_from_array(game.plague, b); + if (game.plague.length === 0) { + delete game.plague; + game.active = game.p1; + end_player_turn(); + } + }, +} + function goto_muster_event() { game.state = 'muster_event'; game.turn_log = []; |