mirror of
https://github.com/RYGhub/royal-mifia.git
synced 2024-11-26 15:44:19 +00:00
42 lines
1.6 KiB
Python
42 lines
1.6 KiB
Python
|
from .Role import Role
|
||
|
import strings as s
|
||
|
|
||
|
class Disastro(Role):
|
||
|
"""L'investigatore sbadato investiga, ma giunge a conclusioni sbagliate..."""
|
||
|
icon = s.detective_icon
|
||
|
team = 'Good'
|
||
|
name = s.detective_name
|
||
|
powerdesc = s.detective_power_description
|
||
|
refillpoweruses = 1
|
||
|
|
||
|
def __init__(self, player):
|
||
|
super().__init__(player)
|
||
|
self.poweruses = self.refillpoweruses
|
||
|
|
||
|
def __repr__(self) -> str:
|
||
|
return "<Role: Investigatore, {uses} uses left>".format(uses=self.poweruses)
|
||
|
|
||
|
def power(self, bot, game, arg):
|
||
|
# Indaga sul vero ruolo di una persona, se sono ancora disponibili usi del potere.
|
||
|
if self.poweruses > 0:
|
||
|
target = game.findplayerbyusername(arg)
|
||
|
if target is not None:
|
||
|
self.poweruses -= 1
|
||
|
randomrole = random.sample(rolepriority, 1)[0]
|
||
|
self.player.message(bot, s.detective_discovery.format(target=target.tusername,
|
||
|
icon=randomrole.icon,
|
||
|
role=randomrole.name,
|
||
|
left=self.poweruses))
|
||
|
else:
|
||
|
self.player.message(bot, s.error_username)
|
||
|
else:
|
||
|
self.player.message(bot, s.error_no_uses)
|
||
|
|
||
|
def onendday(self, bot, game):
|
||
|
# Ripristina il potere
|
||
|
self.poweruses = self.refillpoweruses
|
||
|
|
||
|
def ondeath(self, bot, game):
|
||
|
self.icon = s.disaster_icon
|
||
|
self.name = s.disaster_name
|