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)
|
|
|
|
|
2017-07-18 23:28:49 +00:00
|
|
|
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!
|
2017-07-18 23:28:49 +00:00
|
|
|
self.player.message(s.error_no_uses)
|
2017-07-06 16:49:06 +00:00
|
|
|
return
|
2017-07-17 23:06:30 +00:00
|
|
|
target = self.player.game.findplayerbyusername(arg)
|
2017-07-06 16:49:06 +00:00
|
|
|
if target is None:
|
|
|
|
# Username non valido
|
2017-07-18 23:28:49 +00:00
|
|
|
self.player.message(s.error_username)
|
2017-07-06 16:49:06 +00:00
|
|
|
return
|
|
|
|
# Utilizza il potere su quella persona
|
|
|
|
self.poweruses -= 1
|
2017-12-29 16:23:45 +00:00
|
|
|
self.player.message(s.detective_discovery.format(target_score=100, target=target.tusername, icon=target.role.icon, role=target.role.name))
|
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
|
|
|
# Ripristina il potere
|
2017-07-08 12:31:37 +00:00
|
|
|
self.poweruses = self.refillpoweruses
|