Add werewolf role

This commit is contained in:
yoxu 2025-09-07 19:34:22 +02:00
commit 5b64565590
Signed by: yoxu
GPG key ID: CC1DC0EBE5E7D4E8

16
main.py
View file

@ -118,7 +118,7 @@ class Game:
if fuzz_score >= 60: if fuzz_score >= 60:
log.info("You meant %s!", fuzz_player.name) log.info("You meant %s!", fuzz_player.name)
log.debug("Fuzz score: %s" % fuzz_score) log.debug("Fuzz score: %s" % fuzz_score)
return fuzz_player return fuzz_player.name
def choose_between(self, options): def choose_between(self, options):
#Prompt the user to choose between options until a valid one is entered #Prompt the user to choose between options until a valid one is entered
@ -182,13 +182,13 @@ class Game:
return return
# in love? # in love?
if target in self.lovers: if player in self.lovers:
log.debug("%s is in love! Killing them and their lover.", target) log.debug("%s is in love! Killing them and their lover.", player)
for p in self.lovers: for p in self.lovers:
# kill them and their lover # kill them and their lover
log.debug("Killed %s", p) log.debug("Killed %s", p)
self.dead_this_night.append(p) self.dead_this_night.append(p)
p.alive = False self.players[p].alive = False
return return
# else just kill them # else just kill them
@ -313,6 +313,12 @@ class Game:
else: else:
log.critical("Unknown error: Invalid potion choice.") log.critical("Unknown error: Invalid potion choice.")
return return
@role
def werewolf(self) -> None:
log.info("You will choose someone to kill.")
player = self.select_someone()
self.kill(player)
# ------------------------- # -------------------------
# game flow # game flow
@ -320,7 +326,9 @@ class Game:
def first_day_cycle(self) -> None: def first_day_cycle(self) -> None:
log.info("All the villagers fall asleep.") log.info("All the villagers fall asleep.")
self.cupidon() self.cupidon()
print(self.lovers)
self.savior() self.savior()
self.werewolf()
self.witch() self.witch()