From c61a160e7a798e9914aeb77770228b41e2e50ab9 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Tue, 16 May 2023 15:28:49 +0300 Subject: [PATCH] feat(client): give players buys and plays on start --- client/src/game_status/parser.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/game_status/parser.rs b/client/src/game_status/parser.rs index dcf535c..f7174ea 100644 --- a/client/src/game_status/parser.rs +++ b/client/src/game_status/parser.rs @@ -152,8 +152,10 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) { // set player to idle invoker.state = PlayerState::Idle; - // clear currency + // clear stats invoker.currency = 0; + invoker.plays = 0; + invoker.buys = 0; let start_turn_action = Action::new( &game.id, @@ -172,6 +174,10 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) { // set the target to the play phase target.state = PlayerState::PlayPhase; + // give a play and a buy at the start + target.plays = 1; + target.buys = 1; + let draw_action = Action::new( &game.id, &action.target, -- 2.44.1