# Name: mafia.pl
# Author: Tanner
# GNU General Public License 2
#
IRC::register ("dmafia", "1.0", "", "");
IRC::add_command_handler ("dstart", "mafiastart");
IRC::add_command_handler ("dprep", "mafiaprep");
IRC::add_command_handler ("droles", "mafiaroles");
IRC::add_command_handler ("dnight", "mafianight");
IRC::add_command_handler ("dkill", "mafiakill");
#IRC::add_command_handler ("ddoc", "mafiadoc");
IRC::add_command_handler ("dday", "mafiaday");
IRC::add_command_handler ("dready", "mafiaready");
IRC::add_command_handler ("dnovote", "mafianovote");
IRC::add_command_handler ("dvote", "mafiavote");
IRC::add_command_handler ("dsecretvote", "mafiasecretvote");
IRC::add_command_handler ("dlynch", "mafialynch");
IRC::add_command_handler ("dnolynch", "mafianolynch");
IRC::add_command_handler ("drevote", "mafiarevote");
IRC::add_command_handler ("dendmafia", "mafiaendmafia");
IRC::add_command_handler ("dendcops", "mafiaendcops");
IRC::add_command_handler ("dendevil", "mafiaendevil");
IRC::add_command_handler ("don", "mafiaon");
IRC::add_command_handler ("doff", "mafiaoff");
IRC::add_command_handler ("fq", "flushqueue");
IRC::print ("Deathy Mafia script loaded.");
my $c = "\x03";
my $b = "\x02";
# IRC::command ("");
sub flushqueue {
IRC::command("/flushq");
}
sub mafiastart {
IRC::command ("/topic #dmafia Game is currently in progress. Join us and wait for the next game! http://metanet.2.forumer.com/index.php?showtopic=17332");
IRC::command ("/mode #dmafia +m");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: WELCOME TO MAFIA");
IRC::command ("/say ".$c."4:::: WE'RE READY TO PLAY!");
IRC::command ("/say ".$c."12*** Say ".$b."AYE".$b." if you are at your keyboard and ready to play.");
IRC::command ("/say ".$c."12*** Say ".$b."WAIT".$b." if you need more time, but intend to play within two minutes.");
IRC::command ("/say ".$c."12*** Leave this channel or type ".$b."WATCHING".$b." if you do not wish to play. You will be unvoiced.");
IRC::command ("/say >>> After you say ".$b."AYE".$b.", you will be expected to stay at your keyboard and actively participate in the game.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiaprep {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: PLAYER LIST HAS BEEN SET");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: GAME INFORMATION");
IRC::command ("/say >>> The town will win this game when they've lynched the mafia player.");
IRC::command ("/say >>> The mafia will win this game when there is only one cop left.");
IRC::command ("/say >>> The mafia and other special roles will perform their actions during the night.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
=x IRC::command ("/say ".$c."4:::: RULES & ETIQUETTE");
IRC::command ("/say >>> Listen carefully to all the things that the I tell you throughout the game.");
IRC::command ("/say >>> Text in ALL CAPS is only to be used by me or when you are confirming a game decision (like saying AYE).");
IRC::command ("/say >>> ".$b."Do not use bold or modified text.".$b." At all. This will get you immediately unvoiced and removed from the game.");
IRC::command ("/say >>> ".$b."Do not change your nickname.".$b." For any reason. If you wish to go away at any time or drop out of the game, say ".$b."I WISH TO DROP OUT".$b." and you will be unvoiced and removed from the game.");
IRC::command ("/say >>> If you wish to watch this game, make sure you say ".$b."WATCHING".$b.". If you are watching, you will be unvoiced and will not be voiced again until the current game ends.");
IRC::command ("/say >>> If you are playing the game and you are nonresponsive for five minutes, you will be kicked. If you suddenly drop out, we will give you about two minutes to sign back on. Please return in a timely fashion if you get knocked off of the Internet.");
IRC::command ("/say >>> You may not PM any members during the game, unless stated by your role. If you quote any messages from any private chat (from myself or others), you will be kicked and suspended from future games for a duration.");
IRC::command ("/say >>> Do not use any help from other channels or outside sources. If you are in discussion in another channel, be sure not to hold any relevant game discussions, which should be held before the entire town. If you are dead or watching the game, do not get involved with the game's progress.");
IRC::command ("/say >>> Any game questions you have should be PM'ed to me, by double-clicking on my name, so that they do not disrupt gameplay.");
IRC::command ("/say ".$c."4:::: MAKE SURE YOU'VE READ THE RULES!");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: THE GAME MODERATOR IS SETTING UP THE GAME");
IRC::command ("/say >>> I am currently logging all the participating players, selecting the proper roles for the game, and randomly assigning players with roles.");
IRC::command ("/say >>> I will be privately sending you your roles momentarily. This should take no longer than a few minutes.");
=cut
IRC::command ("/say ".$c."4:::: ROLES ARE BEING ASSIGNED");
IRC::command ("/say ".$c."4:::: WAIT PATIENTLY AND KEEP DISCUSSION TO A MINIMUM");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiaroles {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: ROLES HAVE BEEN ASSIGNED.");
#IRC::command ("/say >>> Remember. If I didn't send you a private message, you are a regular townie.");
#IRC::command ("/say ".$c."12*** If you were invited to the secret Mafia channel, please accept the invite now! The game will not continue until all mafia are in the special room.");
IRC::command ("/say ".$c."12*** Say ".$b."AYE".$b." if you are ready to continue.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafianight {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: IT IS NIGHT");
IRC::command ("/say ".$c."4:::: NO ONE MAY TALK DURING THIS PHASE.");
IRC::command ("/say >>> The mafia must decide whom to kill.");
IRC::command ("/say >>> If you are a cop, send me the name of the person you would like to investigate in a PM.");
IRC::command ("/say ".$c."12*** Send me your responses using PMs.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiakill {
IRC::command ("/mode #dmafia -v @_[0]");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: A MURDER HAS OCCURED");
IRC::command ("/say ".$c."4:::: @_");
IRC::command ("/say >>> You may leave this channel or stay here to observe the game.");
IRC::command ("/say >>> You will be voiced at the end of this game. You may not PM any other players.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
#sub mafiadoc {
# IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
# IRC::command ("/say ".$c."4:::: A MURDER WAS ATTEMPTED, BUT THE DOCTOR RUSHED TO THE SCENE JUST IN TIME!");
# IRC::command ("/say >>> No identities are revealed.");
# IRC::command ("/say >>> Way to go, doc!");
# IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
#}
sub mafiaday {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: IT IS DAY");
IRC::command ("/say >>> All living players must discuss whom to lynch during this phase.");
IRC::command ("/say >>> You may reveal the results of your investigations.");
IRC::command ("/say >>> No one may PM each other during this phase.");
IRC::command ("/say ".$c."4:::: BEGIN DISCUSSIONS!");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiaready {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4::: ARE YOU READY TO VOTE?");
IRC::command ("/say >>> Put discussions on hold for just a moment to allow this test.");
IRC::command ("/say ".$c."12*** Each player must state, once, ".$b."YEA".$b." or ".$b."NAY".$b.". YEA, if you're ready to place a lynch or ready to affirm no lynch. NAY, if you need more time to consider.");
IRC::command ("/say >>> Only if at least two thirds of the people are ready to vote will a lynch be tested.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafianovote {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4::: WE'RE NOT READY TO VOTE, YET.");
IRC::command ("/say >>> Resume discussions.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiavote {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: LET'S VOTE");
IRC::command ("/say >>> Put discussions on hold for just a moment to allow this test.");
IRC::command ("/say ".$c."12*** Each player must state, once, the name of the player who they'd like to lynch. You may not abstain from this vote, but you may vote NO LYNCH.");
IRC::command ("/say >>> If at least half of the votes are for the same player, that player is lynched. Otherwise, no lynch.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafialynch {
IRC::command ("/mode #dmafia -v @_[0]");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: SOMEONE HAS BEEN LYNCHED!");
IRC::command ("/say ".$c."4:::: @_");
IRC::command ("/say >>> You may leave this channel or stay here to observe the game.");
IRC::command ("/say >>> You will be voiced at the end of this game. You may not PM any other players.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiarevote {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: WHOOPS! VOTING ERROR!");
IRC::command ("/say >>> The voting was too hard to read due to outside conversation.");
IRC::command ("/say >>> We're going to need a recount!");
IRC::command ("/say >>> Put discussions on hold for just a moment to allow this test.");
IRC::command ("/say ".$c."12*** Each player must state, once, the name of the player who they'd like to lynch. You may not abstain from this vote, but you may vote NO LYNCH.");
IRC::command ("/say >>> If at least half of the votes are for the same player, that player is lynched. Otherwise, no lynch.");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafianolynch {
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: NO ONE WAS LYNCHED TODAY!");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiaendmafia {
IRC::command ("/mode #dmafia -m");
IRC::command ("/topic #dmafia Game is currently open. Join us and await the next game! http://metanet.2.forumer.com/index.php?showtopic=17332");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: THE GAME IS OVER!");
IRC::command ("/say ".$c."4:::: THE MAFIA HAVE GAINED CONTROL OF THE TOWN");
IRC::command ("/say ".$c."4:::: THE SURVIVING MAFIA HAVE WON");
IRC::command ("/say ".$c."4:::: CONGRATULATIONS, PAISANOS!");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiaendcops {
IRC::command ("/mode #dmafia -m");
IRC::command ("/topic #dmafia Game is currently open. Join us and await the next game! http://metanet.2.forumer.com/index.php?showtopic=17332");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: THE GAME IS OVER!");
IRC::command ("/say ".$c."4:::: THE MAFIA HAVE ALL BEEN LYNCHED");
IRC::command ("/say ".$c."4:::: THE SURVIVORS HAVE WON");
IRC::command ("/say ".$c."4:::: HUZZAH!");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiaendevil {
IRC::command ("/mode #dmafia -m");
IRC::command ("/topic #dmafia Game is currently open. Join us and await the next game! http://metanet.2.forumer.com/index.php?showtopic=17332");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
IRC::command ("/say ".$c."4:::: THE GAME IS OVER!");
IRC::command ("/say ".$c."4:::: THERE WAS NO MAFIA");
IRC::command ("/say ".$c."4:::: THE SURVIVORS HAVE WON");
IRC::command ("/say ".$c."4:::: CONGRATULATIONS!");
IRC::command ("/say ".$c."4::::::::::::::::::::::::::::::::");
}
sub mafiaon {
IRC::command ("/topic #dmafia Game is currently open. Join us and await the next game! http://metanet.2.forumer.com/index.php?showtopic=17332");
}
sub mafiaoff {
IRC::command ("/topic #dmafia No game is currently enqueue. http://metanet.2.forumer.com/index.php?showtopic=17332");
}