# Path: pyGBot/log.py
# def addScreenHandler(logobj, format):
# def addLogFileHandler(logobj, filename, format):
# 
# Path: pyGBot/BasePlugin.py
# class BasePlugin:
#     def __init__(self, bot, options):
#         self.bot = bot
# 
#     def activate(self, channel=None):
#         """
#         Called when the plugin is activated.
#         """
#         return True
# 
#     def deactivate(self, channel=None):
#         """
#         Called when the plugin is deactivated.
#         """
#         return True
# 
#     # Event handlers for other users
#     def user_join(self, channel, username):
#         pass
# 
#     def user_part(self, channel, username):
#         pass
# 
#     def user_kicked(self, channel, username, kicker, message=""):
#         pass
# 
#     def user_quit(self, username, reason=""):
#         pass
# 
#     def user_nickchange(self, username, newname):
#         pass
# 
#     # Event handlers for this bot
#     def bot_connect(self):
#         pass
# 
#     def bot_join(self, channel):
#         pass
# 
#     def bot_part(self, channel):
#         pass
# 
#     def bot_kicked(self, channel, kicker="", reason=""):
#         pass
# 
#     def bot_disconnect(self):
#         pass
# 
# 
#     # Event handlers for incoming messages
#     def msg_channel(self, channel, user, message):
#         pass
# 
#     def msg_action(self, channel, user, message):
#         pass
# 
#     def msg_private(self, user, message):
#         pass
# 
#     def msg_notice(self, user, message):
#         pass
# 
#     # Event handlers for channel information replies
#     def channel_names(self, channel, nameslist):
#         pass
# 
#     def channel_topic(self, channel, user, topic):
#         pass
# 
#     # Other system event handlers
#     def timer_tick(self):
#         pass


import sys, string, random, time, re, itertools
from pyGBot import log
from pyGBot.BasePlugin import BasePlugin

night_Mafia_texts = \
["As the citizens sleep, you may now decide whom you want to kill. You and the other Mafia (if they is exist and are alive) should discuss (privately) and choose a victim. Please type 'kill <nickname>' (as a private message to me). Alternatively, you can elect not to kill anyone. To do this, please type 'nokill' (as a private message to me)."]

night_agent_texts = \
["As the citizens sleep, you may now decide to alter the Sheriff's files.\
  You do not need to use this power now: type 'alter <nickname>' (as\
  a private message to me) to change the file, or 'noalter' to\
  not change any files tonight."]

# Printed when day begins.

day_game_texts = \
["The citizens may decide to lynch one player. When each player is ready, send me the command:  'lynch <nickname>' or 'nolynch', and I will keep track of votes, until the majority agrees. You can undo a lynch vote with 'unlynch'."]




#---------------------------------------------------------------------
# Actual code.
#
# Modified from using the bot class to being a pyGBot plugin

IRC_BOLD = "\x02"

class Mafia(BasePlugin):
    GAMESTATE_NONE, GAMESTATE_STARTING, GAMESTATE_RUNNING = range(3)
    NOLYNCH = 0
    NOKILL = 1
    def __init__(self, bot, options):

# Path: pyGBot/log.py
# def addScreenHandler(logobj, format):
# def addLogFileHandler(logobj, filename, format):
# 
# Path: pyGBot/BasePlugin.py
# class BasePlugin:
#     def __init__(self, bot, options):
#         self.bot = bot
# 
#     def activate(self, channel=None):
#         """
#         Called when the plugin is activated.
#         """
#         return True
# 
#     def deactivate(self, channel=None):
#         """
#         Called when the plugin is deactivated.
#         """
#         return True
# 
#     # Event handlers for other users
#     def user_join(self, channel, username):
#         pass
# 
#     def user_part(self, channel, username):
#         pass
# 
#     def user_kicked(self, channel, username, kicker, message=""):
#         pass
# 
#     def user_quit(self, username, reason=""):
#         pass
# 
#     def user_nickchange(self, username, newname):
#         pass
# 
#     # Event handlers for this bot
#     def bot_connect(self):
#         pass
# 
#     def bot_join(self, channel):
#         pass
# 
#     def bot_part(self, channel):
#         pass
# 
#     def bot_kicked(self, channel, kicker="", reason=""):
#         pass
# 
#     def bot_disconnect(self):
#         pass
# 
# 
#     # Event handlers for incoming messages
#     def msg_channel(self, channel, user, message):
#         pass
# 
#     def msg_action(self, channel, user, message):
#         pass
# 
#     def msg_private(self, user, message):
#         pass
# 
#     def msg_notice(self, user, message):
#         pass
# 
#     # Event handlers for channel information replies
#     def channel_names(self, channel, nameslist):
#         pass
# 
#     def channel_topic(self, channel, user, topic):
#         pass
# 
#     # Other system event handlers
#     def timer_tick(self):
#         pass


# Path: pyGBot/Plugins/games/Mafia.py
import sys, string, random, time, re, itertools
from pyGBot import log
from pyGBot.BasePlugin import BasePlugin


night_Mafia_texts = \
["As the citizens sleep, you may now decide whom you want to kill. You and the other Mafia (if they is exist and are alive) should discuss (privately) and choose a victim. Please type 'kill <nickname>' (as a private message to me). Alternatively, you can elect not to kill anyone. To do this, please type 'nokill' (as a private message to me)."]

night_agent_texts = \
["As the citizens sleep, you may now decide to alter the Sheriff's files.\
  You do not need to use this power now: type 'alter <nickname>' (as\
  a private message to me) to change the file, or 'noalter' to\
  not change any files tonight."]

# Printed when day begins.

day_game_texts = \
["The citizens may decide to lynch one player. When each player is ready, send me the command:  'lynch <nickname>' or 'nolynch', and I will keep track of votes, until the majority agrees. You can undo a lynch vote with 'unlynch'."]




#---------------------------------------------------------------------
# Actual code.
#
# Modified from using the bot class to being a pyGBot plugin

IRC_BOLD = "\x02"

class Mafia(BasePlugin):
    GAMESTATE_NONE, GAMESTATE_STARTING, GAMESTATE_RUNNING = range(3)
    NOLYNCH = 0
    NOKILL = 1
    def __init__(self, bot, options):

        BasePlugin.__init__(self, bot, options)