1
Fork 0
mirror of https://github.com/RYGhub/royal-mifia.git synced 2024-11-26 23:54:18 +00:00
royal-mifia/roles/Stagista.py

39 lines
1.5 KiB
Python
Raw Normal View History

2017-07-06 16:49:06 +00:00
from .Role import Role
from .Derek import Derek
from .SignoreDelCaos import SignoreDelCaos
from .Servitore import Servitore
import strings as s
class Stagista(Role):
"""Lo stagista sceglie una persona da cui andare in stage e prende il suo ruolo."""
icon = s.intern_icon
team = 'Good'
name = s.intern_name
powerdesc = s.intern_power_description
def __init__(self, player):
super().__init__(player)
self.master = None
def __repr__(self) -> str:
return "<Role: Stagista>"
def power(self, arg):
target = self.player.game.findplayerbyusername(arg)
2017-07-06 16:49:06 +00:00
if target is not None and target is not self.player and target.alive:
self.master = target
self.player.message(s.intern_started_internship.format(master=self.master.tusername))
2017-07-06 16:49:06 +00:00
else:
self.player.message(s.error_no_username)
2017-07-06 16:49:06 +00:00
def onendday(self):
2017-07-06 16:49:06 +00:00
if self.master is not None:
if isinstance(self.master.role, Derek) and self.master.role.chaos:
self.player.game.message(s.intern_chaos_summoned)
2017-07-06 16:49:06 +00:00
self.master.alive = True
self.player.game.changerole(self.master, SignoreDelCaos)
self.player.game.changerole(self.player, Servitore)
2017-07-06 16:49:06 +00:00
else:
self.player.game.message(s.intern_changed_role.format(icon=self.master.role.__class__.icon, role=self.master.role.__class__.name))
self.player.game.changerole(self.player, self.master.role.__class__)