fixed some bugs

This commit is contained in:
Jimmy Cao 2011-07-07 15:13:17 -05:00
parent 576e82aa6b
commit 10bbfc54b5
3 changed files with 8 additions and 4 deletions

View File

@ -159,7 +159,7 @@ class IRCClient(object):
self.command_handler[command](self, *largs)
elif "" in self.command_handler:
self.command_handler[""](self, command, *largs)
except CommandError:
finally:
# error will of already been logged by the handler
pass

View File

@ -16,8 +16,8 @@ GAME_MODES = {}
############################################################################################
# ROLE INDEX: PLAYERS SEER WOLF CURSED DRUNK HARLOT TRAITOR GUNNER CROW #
ROLES_GUIDE = { 4 : ( 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0), #
6 : ( 0 , 1 , 0 , 5 , 0 , 0 , 5 , 0), #
ROLES_GUIDE = { 4 : ( 0 , 1 , 0 , 0 , 0 , 0 , 2 , 0), #
6 : ( 0 , 1 , 0 , 0 , 0 , 0 , 4 , 0), #
8 : ( 1 , 2 , 1 , 1 , 1 , 0 , 0 , 0), #
10 : ( 1 , 2 , 1 , 1 , 1 , 1 , 1 , 0)} #
############################################################################################

View File

@ -302,6 +302,8 @@ def chk_win(cli):
cli.msg(chan, "No more players remaining. Game ended.")
reset(cli)
return True
if vars.PHASE == "join":
return True
elif (len(vars.ROLES["wolf"])+
len(vars.ROLES["traitor"])+
len(vars.ROLES["werecrow"])) >= lpl / 2:
@ -417,7 +419,7 @@ def del_player_lynch(cli, nick):
@hook("ping")
def on_ping(cli, prefix, server):
def on_ping(cli, server):
cli.send('PONG', server)
@ -800,6 +802,8 @@ def see(cli, nick, rest):
@pmcmd("")
def relay(cli, nick, rest):
if vars.PHASE != "night":
return
badguys = vars.ROLES["wolf"] + vars.ROLES["traitor"] + vars.ROLES["werecrow"]
if len(badguys) > 1:
if vars.get_role(nick) in ("wolf","traitor","werecrow"):