Mafia
SSW Presentation
The Rules
Two Teams
Mafia and Innocents
Narrator
Explains the game
Assigns roles randomly (via cards)
Describes a scenario
Tells everyone to "go to sleep"
Night Time
Mafia
Mafia open their eyes
Mafia choose someone to kill
Mafia close their eyes
Medic
Medic opens their eyes
Medic choose someone to save
Medic closes their eyes
Cop
Cop open your eyes
Cop choose someone to investigate
Thumbs up if Innocent
Thumbs down if Mafia
Cop close their eyes
Everyone
Wake Up!
Move to Day Time phase
Day Time
Narrator
- Describes who was killed
- ... and whether or not they were saved
- Killed players are out of the game
- Casts a vote for a lynching
- Lynched player is also killed
- Moves to night phase
Victory!
When one team is completely eliminated
And then some
- 30+ Roles
- Multiple teams
- Special victory conditions
- Eg. "Village Idiot" wins by being lynched
Some Problems...
A big notebook!
Lots of waiting
The narrator has to reconcile all the night actions
Inconsistency
Easy to slip up
...Modernize!
Anything humans can do, computers can do better
MVP
- Single tablet, used by narrator
- 4 roles: Mafia, Cop, Medic, Pleb
- Tablet passed around circle for name/role allocation
- No saving, replay, undo, stats or anything
The Future!
- 50+ roles
-
- Maybe even a marketplace for roles
- Stats, replays, high scores
- Narrator optional
- Each player uses phone and the Internet
And for me...
- Mobile app development
- Cordova
- Angular 2
- PouchDB
- DDD / CQRS / Event Sourcing in JS
- Frequent prod releases
DDD in TypeScript
Interfaces are great!
When they exist

Workaround:
abstract class

@Injectable()
- Need it everywhere that needs injection, or reflection will be unavailable
Event replay
- Cannot JSON.parse into a class
- TypeScript interfaces are ideal for this!
- No type information in interfaces...
- Each event needs to have a type name field
- Polymorphism isn't supported in TypeScript...
- Use type name and convention methods
- Eg. onPlayerKilled(event : PlayerKilled)
Cordova Woes
CrossWalk
Because you can't trust people
Shims/Polyfills
Because you can't trust standards
Demo Time!
C:\code\git\subterfuge\package
Thoughts
Questions
deck
By xwipeoutx
deck
- 733