1
Fork 0
mirror of https://github.com/RYGhub/royal-mifia.git synced 2024-11-28 16:44:18 +00:00

Round Robin può ora essere giocato con qualsiasi numero di giocatori

This commit is contained in:
Steffo 2017-12-28 19:32:24 +01:00
parent fe459cd1d6
commit 4c25f5247a
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: C27544372FBB445D

72
main.py
View file

@ -354,30 +354,62 @@ class Game:
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))
self.endconfig()
elif preset == "oneofall":
unassignedplayers = len(self.players)
self.roleconfig = {
"Mifioso": 1,
"Investigatore": 1,
"Corrotto": 1,
"Angelo": 1,
"Terrorista": 1,
"Derek": 1,
"Disastro": 1,
"Mamma": 1,
"Stagista": 1,
"Mifioso": 0,
"Investigatore": 0,
"Corrotto": 0,
"Angelo": 0,
"Terrorista": 0,
"Derek": 0,
"Disastro": 0,
"Mamma": 0,
"Stagista": 0,
"SignoreDelCaos": 0,
"Servitore": 0,
"Vigilante": 1
"Vigilante": 0
}
unassignedplayers = len(self.players) - 9
availableroles = list()
while unassignedplayers > 0:
if len(availableroles) == 0:
availableroles = rolepriority.copy()
availableroles.remove(SignoreDelCaos)
availableroles.remove(Servitore)
random.shuffle(availableroles)
self.roleconfig[availableroles.pop().__name__] += 1
unassignedplayers -= 1
while True:
if unassignedplayers > 1:
self.roleconfig["Mifioso"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Investigatore"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Corrotto"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Angelo"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Terrorista"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Derek"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Disastro"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Mamma"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Stagista"] += 1
else:
break
if unassignedplayers > 1:
self.roleconfig["Vigilante"] += 1
else:
break
self.votingmifia = False
self.message(s.preset_oneofall_selected)
self.endconfig()