diff --git a/main.py b/main.py index eb7b4c7..f401739 100644 --- a/main.py +++ b/main.py @@ -283,8 +283,7 @@ class Game: InlineKeyboardButton(s.preset_classic, callback_data="classic") ], [ - InlineKeyboardButton(s.preset_oneofall, callback_data="oneofall"), - InlineKeyboardButton(s.preset_advanced, callback_data="advanced") + InlineKeyboardButton(s.preset_oneofall, callback_data="oneofall") ] ]) # Manda la tastiera @@ -330,66 +329,6 @@ class Game: self.votingmifia = True self.message(bot, 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)) self.endconfig(bot) - elif preset == "advanced": - # Preset avanzato: genera i ruoli in modo da rendere la partita divertente - self.roleconfig = { - "Mifioso": 0, - "Investigatore": 0, - "Corrotto": 0, - "Angelo": 0, - "Terrorista": 0, - "Derek": 0, - "Disastro": 0, - "Mamma": 0, - "Stagista": 0, - "SignoreDelCaos": 0, - "Servitore": 0 - } - unassignedplayers = len(self.players) - balance = 0 - # Scegli casualmente il numero di mifiosi: più ce ne sono più ruoli ci saranno in partita! - maxmifia = 0 - players = len(self.players) - while True: - players = math.floor(players / (maxmifia + 1)) - if players <= maxmifia: - break - maxmifia += 1 # Sono sicuro che questo si potrebbe fare meglio - self.roleconfig["Mifioso"] = random.randint(math.ceil(maxmifia / 2), maxmifia) - unassignedplayers -= self.roleconfig["Mifioso"] - balance += Mifioso.value * self.roleconfig["Mifioso"] - # Ruoli positivi - positiveroles = [Angelo, Investigatore, Mamma, Stagista] - # Trova tutti i ruoli negativi - negativeroles = [Corrotto, Disastro, Terrorista, Derek] - # Aggiungi ruoli positivi casuali finchè la partita non viene bilanciata - while balance < 0 and unassignedplayers > 0: - selectedrole = random.sample(positiveroles, 1)[0] - self.roleconfig[selectedrole.__name__] += 1 - balance += selectedrole.value - unassignedplayers -= 1 - # Se la partita è sfavorita verso i Royal, aggiungi qualche ruolo negativo - while balance > 0 and unassignedplayers > 0: - selectedrole = random.sample(negativeroles, 1)[0] - self.roleconfig[selectedrole.__name__] += 1 - balance += selectedrole.value - unassignedplayers -= 1 - # Non ci sono SignoreDelCaos e Servitore per motivi ovvi - self.roleconfig["SignoreDelCaos"] = 0 - self.roleconfig["Servitore"] = 0 - # Altri parametri - self.votingmifia = False - if balance < -30: - self.message(bot, s.preset_advanced_selected + s.balance_mifia_big) - elif balance < -5: - self.message(bot, s.preset_advanced_selected + s.balance_mifia_small) - elif balance < 5: - self.message(bot, s.preset_advanced_selected + s.balance_perfect) - elif balance < 30: - self.message(bot, s.preset_advanced_selected + s.balance_royal_small) - else: - self.message(bot, s.preset_advanced_selected + s.balance_royal_big) - self.endconfig(bot) elif preset == "oneofall": self.roleconfig = { "Mifioso": 1, diff --git a/roles/Angelo.py b/roles/Angelo.py index 85d0300..058791c 100644 --- a/roles/Angelo.py +++ b/roles/Angelo.py @@ -8,7 +8,6 @@ class Angelo(Role): team = 'Good' name = s.angel_name powerdesc = s.angel_power_description - value = 70 def __init__(self, player): super().__init__(player) diff --git a/roles/Corrotto.py b/roles/Corrotto.py index e79c454..d0c15e1 100644 --- a/roles/Corrotto.py +++ b/roles/Corrotto.py @@ -7,7 +7,6 @@ class Corrotto(Role): team = 'Evil' name = s.corrupt_name powerdesc = s.corrupt_power_description - value = -75 refillpoweruses = 1 def __init__(self, player): diff --git a/roles/Derek.py b/roles/Derek.py index 8ea18a0..5a0ecf8 100644 --- a/roles/Derek.py +++ b/roles/Derek.py @@ -7,7 +7,6 @@ class Derek(Role): team = "Good" name = s.derek_name powerdesc = s.derek_power_description - value = 0 def __init__(self, player): super().__init__(player) diff --git a/roles/Disastro.py b/roles/Disastro.py index b0aca4a..a9732c7 100644 --- a/roles/Disastro.py +++ b/roles/Disastro.py @@ -8,7 +8,6 @@ class Disastro(Role): team = 'Good' name = s.detective_name powerdesc = s.detective_power_description - value = -5 refillpoweruses = 1 def __init__(self, player): diff --git a/roles/Investigatore.py b/roles/Investigatore.py index a6662fb..7ec34fe 100644 --- a/roles/Investigatore.py +++ b/roles/Investigatore.py @@ -7,7 +7,6 @@ class Investigatore(Role): team = 'Good' name = s.detective_name powerdesc = s.detective_power_description - value = 85 refillpoweruses = 1 def __init__(self, player): diff --git a/roles/Mamma.py b/roles/Mamma.py index 7c51668..457f96e 100644 --- a/roles/Mamma.py +++ b/roles/Mamma.py @@ -8,7 +8,6 @@ class Mamma(Role): team = 'Good' name = s.mom_name powerdesc = s.mom_power_description - value = 40 def __repr__(self) -> str: return "" diff --git a/roles/Mifioso.py b/roles/Mifioso.py index 14c7458..5cdf706 100644 --- a/roles/Mifioso.py +++ b/roles/Mifioso.py @@ -8,7 +8,6 @@ class Mifioso(Role): team = 'Evil' name = s.mifia_name powerdesc = s.mifia_power_description - value = -100 def __init__(self, player): super().__init__(player) diff --git a/roles/Role.py b/roles/Role.py index 1405764..a462f73 100644 --- a/roles/Role.py +++ b/roles/Role.py @@ -5,7 +5,6 @@ class Role: team = 'None' # Squadra: 'None', 'Good', 'Evil', 'Chaos'; conta per le condizioni di vittoria name = "UNDEFINED" # Nome del ruolo, viene visualizzato dall'investigatore e durante l'assegnazione powerdesc = None # Ha un potere? Se sì, queste sono le info su come usarlo in seconda persona. - value = 0 # Valore del ruolo durante l'assegnazione: positivo per Good e negativo per Evil def __init__(self, player): self.player = player diff --git a/roles/Royal.py b/roles/Royal.py index de8bfbc..e55fe6c 100644 --- a/roles/Royal.py +++ b/roles/Royal.py @@ -6,7 +6,6 @@ class Royal(Role): icon = s.royal_icon team = 'Good' name = s.royal_name - value = 0 def __init__(self, player): super().__init__(player) diff --git a/roles/Servitore.py b/roles/Servitore.py index b3c1550..411f149 100644 --- a/roles/Servitore.py +++ b/roles/Servitore.py @@ -9,7 +9,6 @@ class Servitore(Role): team = 'Chaos' name = s.chaos_servant_name powerdesc = s.chaos_servant_power_description - value = 0 def __repr__(self) -> str: return "" diff --git a/roles/SignoreDelCaos.py b/roles/SignoreDelCaos.py index 864ba04..92a1caf 100644 --- a/roles/SignoreDelCaos.py +++ b/roles/SignoreDelCaos.py @@ -9,7 +9,6 @@ class SignoreDelCaos(Role): team = 'Chaos' name = s.chaos_lord_name powerdesc = s.chaos_lord_power_description - value = 0 def __init__(self, player): super().__init__(player) diff --git a/roles/Stagista.py b/roles/Stagista.py index 8bef17e..b2094cc 100644 --- a/roles/Stagista.py +++ b/roles/Stagista.py @@ -10,7 +10,6 @@ class Stagista(Role): team = 'Good' name = s.intern_name powerdesc = s.intern_power_description - value = 30 def __init__(self, player): super().__init__(player) diff --git a/roles/Terrorista.py b/roles/Terrorista.py index 26521ea..1daad1a 100644 --- a/roles/Terrorista.py +++ b/roles/Terrorista.py @@ -8,7 +8,6 @@ class Terrorista(Role): team = "Evil" name = s.terrorist_name powerdesc = s.terrorist_power_description - value = -75 def __repr__(self) -> str: return ""