summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-27 14:57:00 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-27 14:57:00 +0100
commit16b1f95927d53fc85c9f14b33ee1f0356e89202f (patch)
treecbad93ce87984e2f30ca5a5ff8ea113c17d58058 /rules.js
parent0b0e15dc9cd4eb5f4d1edda083bfc01e74d0c191 (diff)
downloadvotes-for-women-16b1f95927d53fc85c9f14b33ee1f0356e89202f.tar.gz
change cleanup
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js42
1 files changed, 20 insertions, 22 deletions
diff --git a/rules.js b/rules.js
index 1e67743..9f58ac2 100644
--- a/rules.js
+++ b/rules.js
@@ -1112,28 +1112,14 @@ function end_player_round() {
begin_player_round()
}
-function goto_cleanup_phase() {
- log_h2("Cleanup")
- game.state = "cleanup_phase"
-}
-
-states.cleanup_phase = {
- inactive: "do Cleanup.",
- prompt() {
- view.prompt = "Cleanup."
- gen_action("done")
- },
- done() {
- end_cleanup_phase()
- }
-}
-
function discard_persistent_card(cards, c) {
log(`C${c} discarded.`)
array_remove_item(cards, c)
}
-function end_cleanup_phase() {
+function goto_cleanup_phase() {
+ log_h2("Cleanup")
+
if (game.turn < 6) {
// any cards in the “Cards in Effect for the Rest of the Turn box”
// are placed in the appropriate discard pile.
@@ -1145,9 +1131,6 @@ function end_cleanup_phase() {
throw Error("ASSERT game.support_hand.length === 1")
if (game.opposition_hand.length !== 1)
throw Error("ASSERT game.opposition_hand.length === 1")
-
- start_turn()
- return
}
// At the end of Turn 6, if the Nineteenth
@@ -1173,10 +1156,25 @@ function end_cleanup_phase() {
discard_persistent_card(game.persistent_game, c)
}
- goto_final_voting()
+ game.state = "cleanup_phase"
}
-
+states.cleanup_phase = {
+ inactive: "do Cleanup.",
+ prompt() {
+ view.prompt = "Cleanup."
+ if (game.turn < 6)
+ gen_action("next_turn")
+ else
+ gen_action("final_voting")
+ },
+ next_turn() {
+ start_turn()
+ },
+ final_voting() {
+ goto_final_voting()
+ }
+}
function goto_final_voting() {
log_h1("Final Voting")