2021-03-13 06:28:43 +01:00
2021-03-09 22:30:28 +01:00
2021-03-13 06:28:43 +01:00

PyWerwolf

Trying to rebuild https://github.com/foin137/werwolfonline.eu in python

Phases of the game

@startuml(id=overview)
hide empty description

state WaitingForPlayers <<fork>>
[*] --> 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 <<join>>

Player --> WaitingForPlayersEnd: Ready


GameMaster --> GameMaster:  start &&\nlen(Players)>=len(special roles) &&\nnum_werewolfes > 1
GameMaster --> WaitingForPlayersEnd: start &&\n(len(Players)<len(special roles) ||\n  num_werewolfes < 1)

WaitingForPlayersEnd --> 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
}
MainPhaseNight --> Award: No Villagers left
MainPhaseNight --> MainPhaseDay: Some Villagers left
state MainPhaseDay {
 !include https://gitea.d1v3.de/matthias/pywerewolf/raw/branch/master/README.md!TheDay
}
MainPhaseDay --> Award: No Werewolfes left
MainPhaseDay --> MainPhaseNight: Some Werewolfes left
@enduml
@startuml(id=TheNight)
hide empty description
state NightPhaseCupin <<fork>>
[*] --> NightPhaseCupin: Game has Cupin
[*] --> NightPhaseMain: no Cupin


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

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
@startuml(id=TheDay)
hide empty description
[*] --> 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 : Accuse ok
Poll --> ShootTheConvict: Poll successfull
Poll --> Voting: Poll unsuccessfull
Voting --> ShootTheConvict: Voting Completed
ShootTheConvict --> [*]: Done
@enduml
@startuml(id=NightPhaseMain)
hide empty description
state NightPhaseMainStart <<fork>>
[*] --> NightPhaseMainStart
NightPhaseMainStart --> SelectVictim: Werewolfes || Spy
NightPhaseMainStart --> SelectIdentity: Seer
NightPhaseMainStart --> SelectProtectee: Protector
NightPhaseMainStart --> SeeWerewolfes: ParanormalInvestigator && FirstRound*
NightPhaseMainStart --> Sleep: Villager


state NightPhaseMainEnd <<join>>
SelectVictim --> NightPhaseMainEnd: Werewolfes || Spy
SelectIdentity --> NightPhaseMainEnd: Done
SelectProtectee --> NightPhaseMainEnd: Done
SeeWerewolfes --> NightPhaseMainEnd: Done
Sleep --> NightPhaseMainEnd: Ready

NightPhaseMainEnd --> [*]

@enduml
@startuml(id=NightPhaseLate)
hide empty description
state NightPhaseLateStart <<fork>>
[*] --> NightPhaseLateStart
state "Witch selects\nHealing or Poison" as SelectHealOrPoison
state "Leaderwolf selects victim\nfor conversion" as SelectLeaderVictim
NightPhaseLateStart --> SelectHealOrPoison: Witch
NightPhaseLateStart --> SelectLeaderVictim: Leaderwolf
NightPhaseLateStart --> SleepAgain: Villager



state NightPhaseLateEnd <<join>>
SelectHealOrPoison --> NightPhaseLateEnd: Selection finished
SelectHealOrPoison -left-> SelectHealOrPoison: Next selection
SelectLeaderVictim --> NightPhaseLateEnd: Done
SleepAgain --> NightPhaseLateEnd

NightPhaseLateEnd --> [*]

@enduml
Description
Werewolf game in python
Readme 111 KiB
Languages
Python 90.2%
HTML 4.9%
Jinja 4.9%