From 735441fe7dd5eef9ad1a89c709403182a7a837b5 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Fri, 29 Jul 2011 18:54:35 -0500 Subject: [PATCH] cursed is revealed when the game ends (bugfix) --- wolfgame.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wolfgame.py b/wolfgame.py index 7898de3..41de10a 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -592,7 +592,7 @@ def stop_game(cli): nitemin, nitesec)) roles_msg = [] - var.ORIGINAL_ROLES["cursed villager"] = var.CURSED + lroles = list(var.ORIGINAL_ROLES.keys()) lroles.remove("wolf") lroles.insert(0, "wolf") # picky, howl consistency @@ -1708,12 +1708,13 @@ def start(cli, nick, chan, rest): # Now for the villager roles # Select cursed (just a villager) - possiblecursed = pl[:] - for cannotbe in (var.ROLES["wolf"] + var.ROLES["werecrow"] + - var.ROLES["seer"]): # confusing (Traitor can be cursed apparently) - # but not in the Perl howlbot code - possiblecursed.remove(cannotbe) if var.ROLES["cursed"]: + possiblecursed = pl[:] + for cannotbe in (var.ROLES["wolf"] + var.ROLES["werecrow"] + + var.ROLES["seer"]): # confusing (Traitor can be cursed apparently) + # but not in the Perl howlbot code + possiblecursed.remove(cannotbe) + var.CURSED = random.sample(possiblecursed, len(var.ROLES["cursed"])) del var.ROLES["cursed"] @@ -1743,6 +1744,9 @@ def start(cli, nick, chan, rest): cli.mode(chan, "+m") var.ORIGINAL_ROLES = copy.deepcopy(var.ROLES) # Make a copy + + var.ORIGINAL_ROLES["cursed villager"] = var.CURSED # Make sure it shows up in the final stats. + var.DAY_TIMEDELTA = timedelta(0) var.NIGHT_TIMEDELTA = timedelta(0) var.DAY_START_TIME = None