From 43cecdee88ba3749ec908ae18fb89ec2d29066f6 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Tue, 16 May 2023 14:58:19 +0300 Subject: [PATCH] feat(client): draw 4 cards on turn start --- client/src/game_status/parser.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/game_status/parser.rs b/client/src/game_status/parser.rs index b11fe77..b3d9a21 100644 --- a/client/src/game_status/parser.rs +++ b/client/src/game_status/parser.rs @@ -166,6 +166,21 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) { Command::StartTurn {} => { // set the target to the play phase target.state = PlayerState::PlayPhase; + + let draw_action = Action::new( + &game.id, + &action.target, + &action.target, + &Command::Draw { + amount: 4, + }, + seed_gen!(), + ); + game_status + .actions + .insert(action_pos + 1, draw_action.clone()); + + parse_action(&draw_action, game, game_status); } Command::ChangePlayerState { state } => { target.state = *state; -- 2.44.1