mirror of
https://github.com/RYGhub/royal-mifia.git
synced 2025-02-16 13:24:06 +00:00
Aggiunto nuovo ruolo: Vigilante
Il vigilante può scegliere una persona (a partita) da uccidere. E' dalla parte della Royal.
This commit is contained in:
parent
801e999883
commit
fe459cd1d6
5 changed files with 69 additions and 5 deletions
9
main.py
9
main.py
|
@ -326,7 +326,8 @@ class Game:
|
|||
"Mamma": 0,
|
||||
"Stagista": 0,
|
||||
"SignoreDelCaos": 0,
|
||||
"Servitore": 0
|
||||
"Servitore": 0,
|
||||
"Vigilante": 0
|
||||
}
|
||||
self.votingmifia = True
|
||||
self.message(s.preset_simple_selected.format(mifioso=self.roleconfig["Mifioso"],
|
||||
|
@ -346,7 +347,8 @@ class Game:
|
|||
"Mamma": 0,
|
||||
"Stagista": 0,
|
||||
"SignoreDelCaos": 0,
|
||||
"Servitore": 0
|
||||
"Servitore": 0,
|
||||
"Vigilante": 0
|
||||
}
|
||||
self.votingmifia = True
|
||||
self.message(s.preset_classic_selected.format(mifioso=self.roleconfig["Mifioso"], investigatore=self.roleconfig["Investigatore"], angelo=self.roleconfig["Angelo"], royal=len(self.players) - self.roleconfig["Mifioso"] - self.roleconfig["Investigatore"] - self.roleconfig["Angelo"], royalmenouno=len(self.players) - self.roleconfig["Mifioso"] - self.roleconfig["Investigatore"] - self.roleconfig["Angelo"] - 1))
|
||||
|
@ -363,7 +365,8 @@ class Game:
|
|||
"Mamma": 1,
|
||||
"Stagista": 1,
|
||||
"SignoreDelCaos": 0,
|
||||
"Servitore": 0
|
||||
"Servitore": 0,
|
||||
"Vigilante": 1
|
||||
}
|
||||
unassignedplayers = len(self.players) - 9
|
||||
availableroles = list()
|
||||
|
|
43
roles/Vigilante.py
Normal file
43
roles/Vigilante.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
from .Role import Role
|
||||
import strings as s
|
||||
|
||||
class Vigilante(Role):
|
||||
"""Il vigilante può uccidere una persona a sua scelta.
|
||||
Possibilmente un mifioso."""
|
||||
icon = s.vigilante_icon
|
||||
team = 'Good'
|
||||
name = s.vigilante_name
|
||||
powerdesc = s.vigilante_power_description
|
||||
|
||||
def __init__(self, player):
|
||||
super().__init__(player)
|
||||
self.target = None
|
||||
self.power_was_used = False
|
||||
|
||||
def __repr__(self) -> str:
|
||||
if self.target is None:
|
||||
return "<Role: Angelo>"
|
||||
else:
|
||||
return "<Role: Angelo, protecting {target}>".format(target=self.target.tusername)
|
||||
|
||||
def power(self, arg):
|
||||
# Imposta qualcuno come bersaglio
|
||||
selected = self.player.game.findplayerbyusername(arg)
|
||||
if self.power_was_used:
|
||||
self.player.message(s.error_no_uses)
|
||||
return
|
||||
if selected is None:
|
||||
self.player.message(s.error_username)
|
||||
return
|
||||
# Bersaglia il nuovo giocatore selezionato
|
||||
selected.protectedby = self.player
|
||||
self.target = selected
|
||||
self.player.message(s.vigilante_target_selected.format(target=self.target.tusername))
|
||||
|
||||
def onendday(self):
|
||||
# Resetta la protezione
|
||||
if self.target is not None:
|
||||
self.target.kill()
|
||||
self.player.game.message()
|
||||
self.power_was_used = True
|
||||
self.target = None
|
|
@ -1,4 +1,4 @@
|
|||
from .roles import *
|
||||
|
||||
# Ordine in cui vengono eseguiti i onendday dei vari ruoli.
|
||||
rolepriority = [Mifioso, Investigatore, Corrotto, Disastro, Angelo, Derek, Stagista, Terrorista, Mamma, SignoreDelCaos, Servitore]
|
||||
rolepriority = [Mifioso, Vigilante, Investigatore, Corrotto, Disastro, Angelo, Derek, Stagista, Terrorista, Mamma, SignoreDelCaos, Servitore]
|
||||
|
|
|
@ -11,4 +11,5 @@ from .Servitore import Servitore
|
|||
from .SignoreDelCaos import SignoreDelCaos
|
||||
from .Stagista import Stagista
|
||||
from .Terrorista import Terrorista
|
||||
from .priority import rolepriority
|
||||
from .Vigilante import Vigilante
|
||||
from .priority import rolepriority
|
17
strings.py
17
strings.py
|
@ -196,6 +196,23 @@ chaos_servant_icon = "\U0001F468\u200d\U0001F3A4"
|
|||
chaos_servant_power_description = "Il Signore del Caos ti cederà i suoi poteri quando sarà morto.\n" \
|
||||
"Facendo parte della fazione del Caos, hai automaticamente _vinto la partita_!"
|
||||
|
||||
# Vigilante: nome ruolo
|
||||
vigilante_name = "Vigilante"
|
||||
|
||||
# Vigilante: icona
|
||||
vigilante_icon = "🤠"
|
||||
|
||||
# Vigilante: descrizione potere
|
||||
vigilante_power_description = "In un qualsiasi momento della partita puoi scegliere una persona da uccidere anonimamente ignorando le votazioni.\n" \
|
||||
"Fai attenzione a non uccidere un tuo alleato Royal: sei in squadra con loro!"
|
||||
|
||||
# Vigilante: bersaglio scelto
|
||||
vigilante_target_selected = "Stai puntando la tua pistola contro @{target}."
|
||||
|
||||
# Vigilante: esecuzione
|
||||
vigilante_execution = "@{target} è stato eseguito da un Vigilante della Royal Games.\n" \
|
||||
"Era un *{icon} {role}*."
|
||||
|
||||
# Servitore del Caos: ereditato i poteri
|
||||
chaos_servant_inherited = "Il servitore ha ereditato i poteri del *\U0001F479 Signore del Caos*."
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue