2017-07-06 16:49:06 +00:00
|
|
|
from .Role import Role
|
|
|
|
import strings as s
|
|
|
|
|
|
|
|
class Derek(Role):
|
|
|
|
"""Derek muore. Quando gli pare."""
|
|
|
|
icon = s.derek_icon
|
|
|
|
team = "Good"
|
|
|
|
name = s.derek_name
|
|
|
|
powerdesc = s.derek_power_description
|
|
|
|
|
|
|
|
def __init__(self, player):
|
|
|
|
super().__init__(player)
|
|
|
|
# Per qualche motivo assurdo ho deciso di tenere l'oggetto Player qui
|
|
|
|
self.deathwish = False
|
|
|
|
self.chaos = False
|
|
|
|
|
|
|
|
def __repr__(self) -> str:
|
|
|
|
return "<Role: Derek>"
|
|
|
|
|
2017-07-18 23:28:49 +00:00
|
|
|
def power(self, arg):
|
2017-07-06 16:49:06 +00:00
|
|
|
# Attiva / disattiva la morte alla fine del round
|
|
|
|
self.deathwish = not self.deathwish
|
|
|
|
if self.deathwish:
|
2017-07-18 23:28:49 +00:00
|
|
|
self.player.message(s.derek_deathwish_unset)
|
2017-07-06 16:49:06 +00:00
|
|
|
else:
|
|
|
|
|
2017-07-18 23:28:49 +00:00
|
|
|
self.player.message(s.derek_deathwish_set)
|
2017-07-06 16:49:06 +00:00
|
|
|
|
2017-07-18 23:28:49 +00:00
|
|
|
def onendday(self):
|
2017-07-06 16:49:06 +00:00
|
|
|
if self.deathwish:
|
2017-07-18 23:28:49 +00:00
|
|
|
self.player.game.message(s.derek_deathwish_successful.format(name=self.player.tusername))
|
|
|
|
self.player.kill(self.player.game)
|
2017-07-06 16:49:06 +00:00
|
|
|
self.chaos = True
|