# PyWerwolf Trying to rebuild [https://github.com/foin137/werwolfonline.eu](https://github.com/foin137/werwolfonline.eu) in python ## Phases of the game ```plantuml @startuml(id=overview) state WaitingForPlayers <> [*] --> WaitingForPlayers: Created WaitingForPlayers --> GameMaster: Creator WaitingForPlayers --> Player: Player GameMaster : Show the game id/link WaitingForPlayers : Create game in Database EditRules -> GameMaster: close Rules GameMaster -> EditRules: edit rules state WaitingForPlayersEnd <> Player --> WaitingForPlayersEnd: Ready GameMaster --> GameMaster: start &&\nlen(Players)>=len(special roles) &&\nnum_werewolfes > 1 GameMaster --> WaitingForPlayersEnd: start &&\n(len(Players) StartGame StartGame : Assign Player Roles StartGame : Show Introduction StartGame --> MainPhaseNight : all ready state MainPhaseNight { !include https://gitea.d1v3.de/matthias/pywerewolf/raw/branch/master/README.md!TheNight } NightPhaseMain --> Award: No Villagers left MainPhaseNight --> MainPhaseDay state MainPhaseDay { !include https://gitea.d1v3.de/matthias/pywerewolf/raw/branch/master/README.md!TheDay } NightPhaseMain --> Award: No Werewolfes left NightPhaseMain --> MainPhaseNight @enduml ``` ```plantuml @startuml(id=TheNight) state NightPhaseCupin <> [*] --> NightPhaseCupin: Game has Cupin [*] --> NightPhaseMain: no Cupin state NightPhaseCupinEnd <> NightPhaseCupin --> WaitToContinueCupin: !Cupin NightPhaseCupin --> SelectLovedOnes: Cupin WaitToContinueCupin --> NightPhaseCupinEnd SelectLovedOnes --> NightPhaseCupinEnd: selected and confirmed loved ones state NightPhaseLovedOnes <> state NightPhaseLovedOnesEnd <> NightPhaseCupinEnd --> NightPhaseLovedOnes NightPhaseLovedOnes --> LovedOnesAwake: Selected Loved Ones NightPhaseLovedOnes --> WaitForLovedOnes: other LovedOnesAwake --> NightPhaseLovedOnesEnd: ready WaitForLovedOnes --> NightPhaseLovedOnesEnd NightPhaseLovedOnesEnd --> NightPhaseMain : all ready state NightPhaseMain { !include https://gitea.d1v3.de/matthias/pywerewolf/raw/branch/master/README.md!NightPhaseMain } NightPhaseMain --> NightPhaseLate : Witch/Leaderwolf &&\nvoted &&\nactions done and all ready state NightPhaseLate { !include https://gitea.d1v3.de/matthias/pywerewolf/raw/branch/master/README.md!NightPhaseLate } NightPhaseMain --> [*]: no Witch/Leaderwolf &&\nvoted &&\nactions done and all ready NightPhaseLate --> [*]: actions taken @enduml ``` ```plantuml @startuml(id=TheDay) [*] --> ShowDead: Done ShowDead: Show the Dead of the night ShowDead --> Election: No Major Election --> Discussion: Major elected ShowDead --> Discussion: all ready || major ready Discussion --> Accuse: time is up / major forwarded Accuse --> Poll: Poll --> Shoot: Poll successfull Poll --> Voting: Poll unsuccessfull Voting --> ShootTheWolf ShootTheWolf --> [*]: Done @enduml ``` ```plantuml @startuml(id=NightPhaseMain) state NightPhaseMainStart <> [*] --> NightPhaseMainStart NightPhaseMainStart --> SelectVictim: Werewolfes || Spy NightPhaseMainStart --> SelectIdentity: Seer NightPhaseMainStart --> SelectProtectee: Protector NightPhaseMainStart --> SeeWerewolfes: ParanormalInvestigator && FirstRound* NightPhaseMainStart --> Sleep: Villager state NightPhaseMainEnd <> SelectVictim --> NightPhaseMainEnd: Werewolfes || Spy SelectIdentity --> NightPhaseMainEnd: Done SelectProtectee --> NightPhaseMainEnd: Done SeeWerewolfes --> NightPhaseMainEnd: Done Sleep --> NightPhaseMainEnd: Ready NightPhaseMainEnd --> [*] @enduml ``` ```plantuml @startuml(id=NightPhaseLate) state NightPhaseLateStart <> [*] --> NightPhaseLateStart NightPhaseLateStart --> SelectHealOrPoison: Witch NightPhaseLateStart --> SelectLeaderVictim: Leaderwolf NightPhaseLateStart --> SleepAgain: Villager state NightPhaseLateEnd <> SelectHealOrPoison --> NightPhaseLateEnd: Selection finished SelectHealOrPoison -left-> SelectHealOrPoison: Next selection SelectLeaderVictim --> NightPhaseLateEnd: Done SleepAgain --> NightPhaseLateEnd NightPhaseLateEnd --> [*] @enduml ```