NAME

Mafia - easily moderate Mafia games

SYNOPSIS

#!/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;

DESCRIPTION

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).

WHAT YOU NEED TO KNOW

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).

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.

FUNCTIONS

player name, trait, ...

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.

Factions: mafia, town. townie is a synonim for town.

Other attributes: 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
day

Defines the start of a new Day. All actions in the previous Night are now resolved.

night

Defines the start of a new Night. All actions in the previous Day are now resolved.

lynch player

Notes that player was lynched.

factionkill killer, player, flavour, [ strong => 1 ]

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.

Example usage:

factionkill 'eve', 'alice', 'strangled to death';
factionkill 'eve', 'bob', 'brutally murdered', strong => 1; # This is a strongman kill
protect doctor, player

Notes that doctor protected player.

vig vigilante, player, flavour, [ strong => 1 ]

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.

Example usage:

vig 'chuck', 'bob', 'shot';
vig 'chuck', 'bob', 'shot seven times', strong => 1; # This is a Juggernaut (Strongman Vigilante) kill
roleblock roleblocker, player

Notes that roleblocker roleblocked player.

jailkeep jailkeeper, player

Notes that jailkeeper roleblocked and protected player.

guncheck gunsmith, player

Notes that gunsmith checked if player has a gun.

track tracker, player

Notes that tracker tracked player.

watch watcher, player

Notes that watcher watched player.

guard bodyguard, player

Notes that bodyguard guarded player

rolecopcheck rolecop, player

Notes that rolecop checked the role of player

copcheck cop, player

Notes that cop checked whether player is mafia.

skill SK, player, flavour, [ strong => 1 ]

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.

hide hider, player

Notes that hider hid behind player.

AUTHOR

Marius Gavrilescu, <marius@ieval.ro>

COPYRIGHT AND LICENSE

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.