updated roles, init tests, added states

This commit is contained in:
2021-03-12 00:59:38 +01:00
parent 8654e795fe
commit c6e8cc7d29
6 changed files with 193 additions and 39 deletions

View File

@@ -1,3 +1,53 @@
# PyWerwolf
Trying to rebuild [https://github.com/foin137/werwolfonline.eu](https://github.com/foin137/werwolfonline.eu) in python
## Phases of the game
```plantuml
@startuml
[*] --> WaitingForPlayers: Created
WaitingForPlayers : Show the game id/link
WaitingForPlayers : Create game in Database
WaitingForPlayers : Allow setting of rules
WaitingForPlayers --> StartGame: len(Players)>=len(special roles) && start && num_werewolfes > 1
WaitingForPlayers --> WaitingForPlayers: start && (len(Players)<len(special roles) || num_werewolfes < 1)
StartGame : Assign Player Roles
StartGame : Show Introduction
state GameHasCupin <<choice>>
state NightPhaseCupin <<fork>>
StartGame --> GameHasCupin : all ready
GameHasCupin --> NightPhaseCupin: Game has Cupin
GameHasCupin --> NightPhaseMain: no Cupin
NightPhaseMain : Werewolfes awake & select (vote) their victim
NightPhaseMain : Seer/Spy/Protector/ParanormalInvestigator awaken & access feat
NightPhaseMain : sleep & confirm
state NightPhaseCupinEnd <<join>>
NightPhaseCupin --> WaitToContinueCupin: !Cupin
NightPhaseCupin --> SelectLovedOnes: Cupin
WaitToContinueCupin --> NightPhaseCupinEnd
SelectLovedOnes --> NightPhaseCupinEnd: selected and confirmed loved ones
state NightPhaseLovedOnes <<fork>>
state NightPhaseLovedOnesEnd <<fork>>
NightPhaseCupinEnd --> NightPhaseLovedOnes
NightPhaseLovedOnes --> LovedOnesAwake: Selected Loved Ones
NightPhaseLovedOnes --> WaitForLovedOnes: other
LovedOnesAwake --> NightPhaseLovedOnesEnd: ready
WaitForLovedOnes --> NightPhaseLovedOnesEnd
NightPhaseLovedOnesEnd --> NightPhaseMain : all ready
NightPhaseMain --> NightPhaseLate : Witch/Leaderwolf && voted && actions done and all ready
NightPhaseLate: LeaderWolf selects victim to convert
NightPhaseLate: witch is allowed to select heal/murder
NightPhaseMain --> ShowDead: no Witch/Leaderwolf && voted && actions done and all ready
NightPhaseLate --> ShowDead: actions taken
@enduml
```