From 70c284bd4410478831afa53c0d4b247e53601edf Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Sat, 9 Dec 2023 15:46:02 +0100 Subject: combine cleanup and planning --- rules.js | 26 +++++++++++++------------- 1 file 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) -- cgit v1.2.3