From c2887bc761a9873d5e7ef94436a3ed1ebc9bee0f Mon Sep 17 00:00:00 2001 From: Robert Wall Date: Fri, 5 Jul 2013 22:00:13 -0700 Subject: [PATCH] Add empty declarations and checks to partly fix START_WITH_DAY. This commit adds some variable declarations and other minor things so that setting var.START_WITH_DAY to 1 doesn't cause errors. This commit doesn't actually fix that gamemode completely, since I'm still pondering how best to make the game notify people of their roles when the game starts in this mode, but it's a good start. --- modules/wolfgame.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 3a3f37f..cdd8f7a 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -1324,7 +1324,7 @@ def transition_day(cli, gameid=0): var.DAY_START_TIME = datetime.now() if (not len(var.SEEN)+len(var.KILLS)+len(var.OBSERVED) # neither seer nor wolf acted - and var.FIRST_NIGHT and var.ROLES["seer"] and not botconfig.DEBUG_MODE): + and not var.START_WITH_DAY and var.FIRST_NIGHT and var.ROLES["seer"] and not botconfig.DEBUG_MODE): cli.msg(botconfig.CHANNEL, "\02The wolves all die of a mysterious plague.\02") for x in var.ROLES["wolf"]+var.ROLES["werecrow"]+var.ROLES["traitor"]: if not del_player(cli, x, True): @@ -2345,6 +2345,11 @@ def start(cli, nick, chann_, rest): var.CURSED = [] var.GUNNERS = {} var.WOLF_GUNNERS = {} + var.SEEN = [] + var.OBSERVED = {} + var.KILLS = {} + var.GUARDED = {} + var.HVISITED = {} villager_roles = ("gunner", "cursed villager") for i, count in enumerate(addroles): @@ -2403,8 +2408,8 @@ def start(cli, nick, chann_, rest): var.DAY_TIMEDELTA = timedelta(0) var.NIGHT_TIMEDELTA = timedelta(0) - var.DAY_START_TIME = None - var.NIGHT_START_TIME = None + var.DAY_START_TIME = datetime.now() + var.NIGHT_START_TIME = datetime.now() var.LAST_PING = None