WIP: Add new role witch #2

Manually merged
yoxu merged 6 commits from dev into main 2025-09-06 20:59:12 +02:00
Owner

This pr adds new role witch who can revive or kill players

This pr adds new role witch who can revive or kill players
main.py Outdated
@ -162,3 +168,3 @@
# else just kill them
log.debug("Killed %s" % p)
log.info("Killed %s" % player)
Owner

Why would this be announced now?

Why would this be announced now?
anavoi marked this conversation as resolved
main.py Outdated
@ -240,0 +252,4 @@
print(self.players)
while True:
potionchoice = input("What do you want to use Revive or Death potion: ")
if potionchoice == "Revive" and "Revive" not in self.used_potions:
Owner

no fuzzy matching? could have used what was added earlier

no fuzzy matching? could have used what was added earlier
anavoi marked this conversation as resolved
main.py Outdated
@ -240,0 +259,4 @@
self.revive(player)
return
elif player not in self.dead_this_night:
log.info("This player didn't died this night.")
Owner

"Didn't died?"
Hasn't died or didn't die??

"Didn't died?" Hasn't died or didn't die??
anavoi marked this conversation as resolved
main.py Outdated
@ -240,0 +261,4 @@
elif player not in self.dead_this_night:
log.info("This player didn't died this night.")
elif "Revive" not in self.used_potions:
log.info("This potion is already used.")
Owner

was

was
anavoi marked this conversation as resolved
anavoi changed title from Add new role witch to WIP: Add new role witch 2025-09-04 21:26:02 +02:00
main.py Outdated
@ -240,0 +248,4 @@
@role
def witch(self) -> None:
"""Interactively choose to kill or revive someone"""
log.info("Choose if you want to use your revive potion")
Owner

"Choose a potion to help the village."

"Choose a potion to help the village."
anavoi marked this conversation as resolved
main.py Outdated
@ -240,0 +249,4 @@
def witch(self) -> None:
"""Interactively choose to kill or revive someone"""
log.info("Choose if you want to use your revive potion")
print(self.players)
Owner

Why print the players?

Why print the players?
anavoi marked this conversation as resolved
main.py Outdated
@ -240,0 +251,4 @@
log.info("Choose if you want to use your revive potion")
print(self.players)
while True:
potionchoice = input("What do you want to use Revive or Death potion: ")
Owner

"Do you want to use your Revive or Death potion?"

"Do you want to use your Revive or Death potion?"
anavoi marked this conversation as resolved
main.py Outdated
@ -240,0 +269,4 @@
self.kill(player)
return
elif not self.players[player]:
self.used_potions.append("Death")
Owner

The potion is sprayed in the air now??

The potion is sprayed in the air now??
anavoi marked this conversation as resolved
@ -240,0 +272,4 @@
self.used_potions.append("Death")
return
elif potionchoice in self.used_potions:
log.info("You already used all of your potions")
Owner

So we first ask the user to choose a potion then we tell them that they have no choice.

Would you mind adding a check before asking?

So we first ask the user to choose a potion then we tell them that they have no choice. Would you mind adding a check before asking?
yoxu marked this conversation as resolved
anavoi left a comment
Owner

Add checks for impossible cases to fail fast in case of a critical error.

Add checks for impossible cases to fail fast in case of a critical error.
@ -240,0 +279,4 @@
else:
while True:
options = ("Death", "Revive", "Nothing")
potionchoice = self.choose_between(options)
Owner

potionchoice = self.choose_between(options).capitalise()

`potionchoice = self.choose_between(options).capitalise()`
anavoi marked this conversation as resolved
yoxu manually merged commit b7276da8d8 into main 2025-09-06 20:59:12 +02:00
anavoi deleted branch dev 2025-09-07 12:48:37 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yoxu/WereWolfGame!2
No description provided.