WIP: Add new role witch #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pr adds new role witch who can revive or kill players
@ -162,3 +168,3 @@# else just kill themlog.debug("Killed %s" % p)log.info("Killed %s" % player)Why would this be announced now?
@ -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:no fuzzy matching? could have used what was added earlier
@ -240,0 +259,4 @@self.revive(player)returnelif player not in self.dead_this_night:log.info("This player didn't died this night.")"Didn't died?"
Hasn't died or didn't die??
@ -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.")was
Add new role witchto WIP: Add new role witch@ -240,0 +248,4 @@@roledef witch(self) -> None:"""Interactively choose to kill or revive someone"""log.info("Choose if you want to use your revive potion")"Choose a potion to help the village."
@ -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)Why print the players?
@ -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: ")"Do you want to use your Revive or Death potion?"
@ -240,0 +269,4 @@self.kill(player)returnelif not self.players[player]:self.used_potions.append("Death")The potion is sprayed in the air now??
@ -240,0 +272,4 @@self.used_potions.append("Death")returnelif potionchoice in self.used_potions:log.info("You already used all of your potions")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?
c55315fa3e28aeb84c50Add 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)potionchoice = self.choose_between(options).capitalise()