Skip to content

Commit 4dd5e03

Browse files
authored
Merge pull request #9 from sadrasabouri/README_update
Readme updated
2 parents a81dae1 + b15620b commit 4dd5e03

File tree

4 files changed

+82
-3
lines changed

4 files changed

+82
-3
lines changed

README.md

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,84 @@
11
# mafia
22
:dollar: Web Server Application For Mafia Game Playing On Local Network
33

4-
## Roles
4+
Playing mafia game made easy simply by having:
5+
+ a system to run <b>mafia</b> on it (We call it FekroBot)
6+
+ a hotspot that can provide a local host for us (your WIFI modem or your mobile hotspot)
7+
8+
There you go, lets play some mafia :sunglasses:.
9+
10+
<img src="https://raw.githubusercontent.com/sadrasabouri/mafia/README_update/doc/Pictures/mafia_game.png">
11+
12+
## Usage
13+
After cloning into mafia using command bellow:
14+
```
15+
$ git clone https://github.com/sadrasabouri/mafia
16+
```
17+
You should do these tiny steps:
18+
19+
0. <b>[Install pip3]</b>
20+
21+
First check if you have `pip3` installed in your system:
22+
```
23+
$ pip3 --version
24+
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
25+
```
26+
if you already have installed `pip3` you should see something like above, otherwise run the command bellow to install it:
27+
```
28+
$ sudo apt install python3-pip
29+
```
30+
1. <b>Instaling requiremets:</b>
31+
32+
Then install mafia requirements by
33+
```
34+
$ pip3 install -r requirements.txt
35+
```
36+
2. <b>Run the server application</b>
37+
38+
Now everything is ready, lets play:
39+
run the command `$python3 mafia.py number_of_players[int]`, for example imagine you want to play mafia with 5 players.
40+
```
41+
$ python3 mafia.py 5
42+
```
43+
3. <b>Getting roles</b>
44+
45+
There you go, now each player can open a browser and type `serverhost:port_name`.
46+
47+
In defualt mode your address should be `server_ip:5000`.
48+
| What player should see in the browser |
49+
|:-------------------------------------:|
50+
| <img width="324" height="576" src="https://raw.githubusercontent.com/sadrasabouri/mafia/README_update/doc/Pictures/mobile_browser.png"> |
51+
52+
4. <b>Tracing roles from commandline</b>
53+
54+
After each role assignment a message will be prompt to GOD's commandline which inform players ip, id and his/her role,
55+
players should inform the GOD with thier unique id so that GOD can find who is who.
56+
57+
| What GOD should see in the CLI |
58+
|:------------------------------:|
59+
| <img width="435" height="204" src="https://raw.githubusercontent.com/sadrasabouri/mafia/README_update/doc/Pictures/CLI.png"> |
60+
61+
## Game Rules
62+
Mafia is a social deduction game, created by Dimitry Davidoff in 1986. The game models a conflict between two groups: an informed minority (the mafia team), and an uninformed majority (the Residents).
63+
At the start of the game, each player is secretly assigned a role affiliated with one of these teams. The game has two alternating phases:
64+
65+
+ Night Phase
66+
67+
a night role during which those with night killing powers may covertly kill other players
68+
69+
All players close their eyes. The GOD then instructs all Mafias to open their eyes and acknowledge their accomplices. The mafias suggest a "victim" by silently gesturing to indicate their target and to show unanimity then Don (Mafia's head) should decide whom to be killed then close their eyes again.
70+
A similar process occurs for other roles with nightly actions. In the case of the Detector, the GOD may indicate the target's innocence or guilt by using gestures such as nodding or head shaking.
71+
72+
+ Day Phase
73+
74+
a day role, in which surviving players debate the identities of players and vote to eliminate a suspect.
75+
76+
The GOD instructs players to open their eyes. Discussion ensues among the living players. At any point, a player may accuse someone of being a mafia and prompt others to vote to eliminate them. If over half of the players do so, the accused person should go to the court.Players which goes to the court may have a speech defending theirselves from not being mafia, then GOD should take votes again and this time the player with maximum vote will dead and night begins. Otherwise, the phase continues until an elimination occurs.
77+
Dead players are not permitted to attempt to influence the remainder of the game.Because players have more freedom to deliberate, days tend to be longer than nights.
78+
79+
The game continues until a faction achieves its win condition; for the Residents, this usually means eliminating the whole mafia team, while for the minority this usually means reaching numerical parity with the Residents.
80+
81+
### Roles
582
| Role | image(s) |
683
| :-------------: |:----------------------------------------------------------------------------------------------------------------------------: |
784
| Don | <img width="100" height="100" src="https://raw.githubusercontent.com/sadrasabouri/mafia/master/static/images/roles/Don_1.png"> |
@@ -12,5 +89,7 @@
1289
| Anti-attack | <img width="100" height="100" src="https://raw.githubusercontent.com/sadrasabouri/mafia/master/static/images/roles/Anti-attack_1.png"> |
1390
| Resident | <img width="100" height="100" src="https://raw.githubusercontent.com/sadrasabouri/mafia/master/static/images/roles/Resident_1.png"><img width="100" height="100" src="https://raw.githubusercontent.com/sadrasabouri/mafia/master/static/images/roles/Resident_2.png"><img width="100" height="100" src="https://raw.githubusercontent.com/sadrasabouri/mafia/master/static/images/roles/Resident_3.png"><img width="100" height="100" src="https://raw.githubusercontent.com/sadrasabouri/mafia/master/static/images/roles/Resident_4.png"> |
1491

15-
### References
16-
Icons made by <a href="https://www.flaticon.com/authors/vectors-market" title="Vectors Market">Vectors Market</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
92+
## References
93+
Icons made by <a href="https://www.flaticon.com/authors/vectors-market" title="Vectors Market">Vectors Market</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
94+
95+
+ [https://en.wikipedia.org/wiki/Mafia_(party_game)](https://en.wikipedia.org/wiki/Mafia_(party_game))

doc/Pictures/CLI.png

209 KB
Loading

doc/Pictures/mafia_game.png

103 KB
Loading

doc/Pictures/mobile_browser.png

118 KB
Loading

0 commit comments

Comments
 (0)