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

37 lines
1.2 KiB
Python
Raw Normal View History

2017-07-06 16:49:06 +00:00
from .Role import Role
import strings as s
class Corrotto(Role):
"""Il corrotto è un investigatore che lavora per la Mifia."""
2017-07-06 16:54:09 +00:00
icon = s.corrupt_icon
2017-07-06 16:49:06 +00:00
team = 'Evil'
2017-07-06 16:54:09 +00:00
name = s.corrupt_name
powerdesc = s.corrupt_power_description
2017-07-06 16:49:06 +00:00
refillpoweruses = 1
def __init__(self, player):
super().__init__(player)
self.poweruses = self.refillpoweruses
def __repr__(self) -> str:
return "<Role: Corrotto, {uses} uses left>".format(uses=self.poweruses)
def power(self, arg):
2017-07-06 16:49:06 +00:00
# Indaga sul vero ruolo di una persona, se sono ancora disponibili usi del potere.
if self.poweruses <= 0:
# Non hai abbastanza cariche!
self.player.message(s.error_no_uses)
2017-07-06 16:49:06 +00:00
return
target = self.player.game.findplayerbyusername(arg)
2017-07-06 16:49:06 +00:00
if target is None:
# Username non valido
self.player.message(s.error_username)
2017-07-06 16:49:06 +00:00
return
# Utilizza il potere su quella persona
self.poweruses -= 1
self.player.message(s.detective_discovery.format(target=target.tusername, icon=target.role.icon, role=target.role.name, left=self.poweruses))
2017-07-06 16:49:06 +00:00
def onendday(self):
2017-07-06 16:49:06 +00:00
# Ripristina il potere
2017-07-08 12:31:37 +00:00
self.poweruses = self.refillpoweruses