10000 Merge pull request #14 from sadrasabouri/new_roles · sadrasabouri/mafia@c9a43cd · GitHub
[go: up one dir, main page]

Skip to content

Commit c9a43cd

Browse files
authored
Merge pull request #14 from sadrasabouri/new_roles
New roles
2 parents b016811 + 6a25e0f commit c9a43cd

File tree

132 files changed

+227
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+227
-49
lines changed

README.md

Lines changed: 26 additions & 7 deletions

mafia.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,38 @@ def help_me():
122122
exit()
123123

124124

125+
def give_me_roles(ordered_roles):
126+
n = len(ordered_roles)
127+
if n >= 14:
128+
ordered_roles[12] = 'Groom'
129+
ordered_roles[13] = 'Bride'
130+
if n % 3 == 0:
131+
ordered_roles[14] = 'Serial Killer'
132+
if n % 3 != 0:
133+
try:
134+
i = ordered_roles.index('Mafia')
135+
ordered_roles[i] = 'Made Man'
136+
ordered_roles[7] = 'Reporter'
137+
except ValueError:
138+
pass
139+
if n % 3 == 2:
140+
try:
141+
i = ordered_roles.index('Mafia')
142+
if i > 12:
143+
ordered_roles[i] = 'Kind Wife'
144+
except ValueError:
145+
pass
146+
return ordered_roles
147+
148+
125149
if __name__ == "__main__":
126150
if len(argv) < 2 or argv[1] in ['--help', 'help', '-h']:
127151
help_me()
128152
nPlayers = int(argv[1])
129153
if nPlayers > len(ordered_roles):
130154
print("Too many players, mafia doesn't support a game with", nPlayers, "player.")
131155
help_me()
132-
roles = ordered_roles[:nPlayers]
156+
roles = give_me_roles(ordered_roles[:nPlayers])
133157
2851 shuffle(roles)
134158
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789!@#$%^&*()"
135159
for i in range(4):

mafia_params.py

Lines changed: 175 additions & 41 deletions
Large diffs are not rendered by default.

static/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ th, td {
4242
.avatar {
4343
width: 200px;
4444
height: 200px;
45+
border-radius: 100px;
4546
}
4647

4748
.id_section {

static/images/roles/135-waiter.png

-23.2 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)
0