diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-07-09 20:58:55 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-09 20:58:55 +0200 |
commit | 093a1472f49be6324d36e0af0636c6dba50a1fc0 (patch) | |
tree | 27e9da9e2802c63ef34e4ea674c92d6ff8101704 | |
parent | 49226230915adaa273f85070071f7866143d7851 (diff) | |
download | time-of-crisis-093a1472f49be6324d36e0af0636c6dba50a1fc0.tar.gz |
Log grow mobs and place militia.
-rw-r--r-- | rules.js | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -2095,6 +2095,7 @@ states.take_actions = { place_militia() { push_undo() let where = get_governor_location(game.selected_governor) + log("Place Militia in %" + where + ".") spend_populace(2) add_militia(where) resume_take_actions() @@ -5023,15 +5024,17 @@ function goto_end_of_turn() { } function goto_grow_mobs() { - for (let where = 0; where < 12; ++where) { - if ((game.count & (1 << where)) === 0) { - if (is_own_province(where) && get_mobs(where) && !has_amphitheater(where)) { - game.state = "grow_mobs" - return - } - } + game.count = 0 + for (let where = 0; where < 12; ++where) + if ((game.count & (1 << where)) === 0) + if (is_own_province(where) && get_mobs(where) && !has_amphitheater(where)) + game.count |= (1 << where) + if (game.count) { + game.state = "grow_mobs" + log_br() + } else { + goto_flip_inactive_barbarians() } - goto_flip_inactive_barbarians() } states.grow_mobs = { @@ -5040,15 +5043,16 @@ states.grow_mobs = { prompt("End of Turn: Add a mob in each province you govern with mob and no amphitheater.") view.color = POPULACE for (let where = 0; where < 12; ++where) - if ((game.count & (1 << where)) === 0) - if (is_own_province(where) && get_mobs(where) && !has_amphitheater(where)) - gen_action_region(where) + if (game.count & (1 << where)) + gen_action_region(where) }, region(where) { push_undo() - game.count |= (1 << where) + log("Mob grows in %" + where + ".") set_mobs(where, get_mobs(where) + 1) - goto_grow_mobs() + game.count &= !(1 << where) + if (game.count === 0) + goto_flip_inactive_barbarians() }, } |