summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-04-22 14:13:04 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-04-22 14:13:04 -0400
commit46041544e4e3ab913b8b70344bc8b4dca9430477 (patch)
treef55933525f63517b193d9bd9f4a63ebc910c3acd
parent65bd69a07b092a67918251035e07e0d0a9c336de (diff)
downloadvijayanagara-46041544e4e3ab913b8b70344bc8b4dca9430477.tar.gz
Rally count fix
-rw-r--r--rules.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index 4b8ba18..ec25027 100644
--- a/rules.js
+++ b/rules.js
@@ -1983,13 +1983,13 @@ function goto_rally() {
function goto_rally_space() {
push_summary()
+ game.cmd.count = rally_count()
let p = find_piece(AVAILABLE, game.current, ELITE)
- if (rally_count() === 1 && p > -1) {
+ if (game.cmd.count === 1 && p > -1) {
log_summary_place(p)
place_piece(p, game.cmd.where)
end_rally_space()
} else {
- game.cmd.count = 0
game.state = "rally_space"
}
}
@@ -2032,18 +2032,18 @@ states.rally_space = {
view.prompt = `Rally: No available ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.`
view.actions.next = 1
} else {
- view.prompt = `Rally: Place up to ${format_unit_count(game.current, ELITE, rally_count())}.`
+ view.prompt = `Rally: Place up to ${format_unit_count(game.current, ELITE, game.cmd.count)}.`
view.where = game.cmd.where
gen_place_piece(game.current, ELITE)
}
-
- if (game.cmd.count > 0)
- view.actions.next = 1
+ view.actions.next = 1
},
piece(p) {
+ push_undo()
log_summary_place(p)
place_piece(p, game.cmd.where)
- if (++game.cmd.count >= rally_count())
+ game.cmd.count -= 1
+ if (game.cmd.count === 0)
end_rally_space()
},
next() {