Mafia - easily moderate Mafia games
#!/usr/bin/perl -w use Mafia; player 'Banana Bob', cop, town; player 'Dragon Phoenix', vanilla, townie; player 'Gammie', mafia, goon; player 'gslamm', vanilla, townie; player 'Untrod Tripod', mafia, goon; player 'Werebear', vanilla, townie; player 'willows_weep', town, doctor; day; lynch 'Untrod Tripod'; night; factionkill 'Gammie', 'willows_weep', 'shot'; copcheck 'Banana Bob', 'gslamm'; day; lynch 'Gammie'; night;
Mafia.pm is a Perl extension for easily moderating Mafia games. You don't even need to know Perl to use it (see "WHAT YOU NEED TO KNOW" for details).
A typical script starts with the following two lines
#!/usr/bin/perl -w use Mafia;
The rest of the script is a series of function calls that describe the players and their actions.
A function call looks like this:
function_name first_argument, second_argument, ...
Each argument is either a number, a string (which is a sequence of characters between single or double quotes, such as 'badguy', 'qwrf') or a constant (such as mafia, vanilla, bulletproof).
'badguy'
'qwrf'
mafia
vanilla
bulletproof
Example calls:
player 'Somebody', mafia, goon; # player is the function, 'Somebody' is a string, mafia and goon are constants. lynch 'Nobody'; # lynch is the function, 'Nobody' is a string. day; # day is the function. There are no arguments.
Defines a new player named name and its traits (role, faction, role modifiers).
Roles: vanilla, goon, doctor, vigilante, roleblocker, jailkeeper, gunsmith, tracker, watcher, bodyguard, rolecop, cop, sk, hider.
vanilla, goon, doctor, vigilante, roleblocker, jailkeeper, gunsmith, tracker, watcher, bodyguard, rolecop, cop, sk, hider
Factions: mafia, town. townie is a synonim for town.
mafia, town
townie
town
Other attributes: miller, godfather, weak, macho, bulletproof
miller, godfather, weak, macho, bulletproof
These traits may be specified in any order.
Example usage:
player 'alice', town, bulletproof, miller, vigilante; # Alice is a NK-Immune Miller Vig player 'bob', town, weak, doctor; # Bob is a Town Weak Doctor player 'eve', mafia, godfather, goon; # Eve is a Mafia Godfather
Defines the start of a new Day. All actions in the previous Night are now resolved.
Defines the start of a new Night. All actions in the previous Day are now resolved.
Notes that player was lynched.
Notes that killer killed player with flavour flavour. Append strong => 1 if the kill should ignore roleblocks and doctor/jailkeeper protections. Use this for mafia kills.
strong => 1
factionkill 'eve', 'alice', 'strangled to death'; factionkill 'eve', 'bob', 'brutally murdered', strong => 1; # This is a strongman kill
Notes that doctor protected player.
Notes that killer killed player with flavour flavour. Append strong => 1 if the kill should ignore roleblocks and doctor/jailkeeper protections. Use this for Vigilante/Juggernaut kills.
vig 'chuck', 'bob', 'shot'; vig 'chuck', 'bob', 'shot seven times', strong => 1; # This is a Juggernaut (Strongman Vigilante) kill
Notes that roleblocker roleblocked player.
Notes that jailkeeper roleblocked and protected player.
Notes that gunsmith checked if player has a gun.
Notes that tracker tracked player.
Notes that watcher watched player.
Notes that bodyguard guarded player
Notes that rolecop checked the role of player
Notes that cop checked whether player is mafia.
Notes that SK killed player with flavour flavour. Append strong => 1> if the kill should ignore roleblocks and doctor/jailkeeper protections. Use this for Serial Killer kills.
Notes that hider hid behind player.
Marius Gavrilescu, <marius@ieval.ro>
Copyright (C) 2013-2017 by Marius Gavrilescu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
To install Mafia, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mafia
CPAN shell
perl -MCPAN -e shell install Mafia
For more information on module installation, please visit the detailed CPAN module installation guide.