2017-07-06 16:49:06 +00:00
|
|
|
from .Role import Role
|
|
|
|
import strings as s
|
|
|
|
import random
|
|
|
|
|
|
|
|
class Mamma(Role):
|
2017-12-28 18:41:48 +00:00
|
|
|
"""La mamma sente le voci in giro per la città e scopre un nuovo ruolo ogni tanto..."""
|
2017-07-06 16:49:06 +00:00
|
|
|
icon = s.mom_icon
|
|
|
|
team = 'Good'
|
|
|
|
name = s.mom_name
|
|
|
|
powerdesc = s.mom_power_description
|
|
|
|
|
|
|
|
def __repr__(self) -> str:
|
|
|
|
return "<Role: Mamma>"
|
|
|
|
|
2017-07-18 23:28:49 +00:00
|
|
|
def onstartgame(self):
|
2017-07-06 16:49:06 +00:00
|
|
|
# Scegli un bersaglio casuale che non sia il giocatore stesso
|
2017-07-17 23:06:30 +00:00
|
|
|
possibletargets = self.player.game.players.copy()
|
2017-07-07 20:24:08 +00:00
|
|
|
possibletargets.remove(self.player)
|
2017-07-06 16:49:06 +00:00
|
|
|
target = random.sample(possibletargets, 1)[0]
|
2017-07-18 23:28:49 +00:00
|
|
|
self.player.message(s.mom_discovery.format(target=target.tusername, icon=target.role.icon, role=target.role.name))
|
2017-12-28 18:41:48 +00:00
|
|
|
|
|
|
|
def onendday(self):
|
|
|
|
if random.randrange(0, 10) > 7:
|
|
|
|
# Scegli un bersaglio casuale che non sia il giocatore stesso
|
|
|
|
possibletargets = self.player.game.players.copy()
|
|
|
|
possibletargets.remove(self.player)
|
|
|
|
target = random.sample(possibletargets, 1)[0]
|
|
|
|
self.player.message(
|
|
|
|
s.mom_discovery.format(target=target.tusername, icon=target.role.icon, role=target.role.name))
|