summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-09 15:46:02 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-09 15:46:02 +0100
commit70c284bd4410478831afa53c0d4b247e53601edf (patch)
treed90154d30e01e1185a18cac864b8578e15c873e9
parent82b21e6c164fe02e38f0db5c53d5fdc19443202b (diff)
downloadvotes-for-women-70c284bd4410478831afa53c0d4b247e53601edf.tar.gz
combine cleanup and planning
-rw-r--r--rules.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/rules.js b/rules.js
index f69902f..c3685cd 100644
--- a/rules.js
+++ b/rules.js
@@ -826,12 +826,12 @@ function start_turn() {
game.turn += 1
log_h1("Turn " + game.turn)
- goto_planning_phase()
-}
-
-function goto_planning_phase() {
log_h2("Planning")
- game.state = "planning_phase"
+
+ if (game.turn === 1)
+ game.state = "planning_phase"
+ else
+ end_planning_phase()
}
states.planning_phase = {
@@ -841,19 +841,19 @@ states.planning_phase = {
gen_action("draw")
},
draw() {
- for (let n = 0; n < 6; ++n) {
- game.support_hand.push(draw_card(game.support_deck))
- game.opposition_hand.push(draw_card(game.opposition_deck))
- }
-
- log("Suffragist drew 6 cards.")
- log("Opposition drew 6 cards.")
-
end_planning_phase()
}
}
function end_planning_phase() {
+ for (let n = 0; n < 6; ++n) {
+ game.support_hand.push(draw_card(game.support_deck))
+ game.opposition_hand.push(draw_card(game.opposition_deck))
+ }
+
+ log("Suffragist drew 6 cards.")
+ log("Opposition drew 6 cards.")
+
if (game.support_hand.length !== 7)
throw Error("ASSERT game.support_hand.length === 7")
if (game.opposition_hand.length !== 7)