Browse Source

fixed some bugs

master
jcao219 14 years ago
parent
commit
72147fbfce
  1. 2
      oyoyo/client.py
  2. 4
      vars.py
  3. 6
      wolfgame.py

2
oyoyo/client.py

@ -159,7 +159,7 @@ class IRCClient(object): @@ -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

4
vars.py

@ -16,8 +16,8 @@ GAME_MODES = {} @@ -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)} #
############################################################################################

6
wolfgame.py

@ -302,6 +302,8 @@ def chk_win(cli): @@ -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): @@ -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): @@ -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"):

Loading…
Cancel
Save