From 7437d683ad5a48e08f7124f1121ff9f1f6e12f36 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Sun, 14 Mar 2021 14:04:57 +0100 Subject: [PATCH] updated states --- README.md | 14 ++++++++------ pywerwolf/gamelogic.py | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b44d350..cdecc9d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,13 @@ WaitingForPlayers --> StartGame: Start && ready StartGame : Assign Player Roles StartGame : Show Introduction -StartGame --> MainPhaseNight : all ready +StartGame --> MainPhaseNight : No Cupin +StartGame --> CupinSelect: Cupin + +state "Inform Loved Ones" as InformLovedOnes + +CupinSelect --> InformLovedOnes: Cupin selected +InformLovedOnes --> MainPhaseNight: ack state MainPhaseNight { !include https://gitea.d1v3.de/matthias/pywerewolf/raw/branch/master/README.md!TheNight } @@ -33,11 +39,7 @@ MainPhaseDay --> MainPhaseNight: Some Werewolfes left ```plantuml @startuml(id=TheNight) hide empty description -[*] --> NightPhaseCupin: - -NightPhaseCupin --> InformLovedOnes: Cupin selected -InformLovedOnes --> NightPhaseMain: ack -NightPhaseCupin --> NightPhaseMain : Cupin already selected or No Cupin +[*] --> NightPhaseMain ' state NightPhaseCupinEnd <> ' NightPhaseCupin --> WaitToContinueCupin: !Cupin ' NightPhaseCupin --> SelectLovedOnes: Cupin diff --git a/pywerwolf/gamelogic.py b/pywerwolf/gamelogic.py index d1fbec1..03b7da3 100644 --- a/pywerwolf/gamelogic.py +++ b/pywerwolf/gamelogic.py @@ -149,6 +149,22 @@ class Game(object): next=GameState.start_game, ) ], + GameState.start_game: [ + TransitionObject( + name = "StartGame 2 MainPhaseNight", + inputType=GameMasterStartGame, + condition=[self.players_ready, self.no_cupin], + transition=self.assign_roles, + next=GameState.night_phase, + ), + TransitionObject( + name = "StartGame 2 CupinSelect", + inputType=GameMasterStartGame, + condition=[self.has_cupin], + transition=self.assign_roles, + next=GameState.night_phase, + ) + ], } if game_id is None: