From 1477407d7c2c4814a162a255435393f3ec5f72f1 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Wed, 27 Jul 2011 15:22:14 -0500 Subject: [PATCH] now DEBUG_MODE (configurable variable) is part of botconfig.py, not var.py --- var.py | 2 -- wolfgame.py | 13 +++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/var.py b/var.py index 78688c5..3eec390 100644 --- a/var.py +++ b/var.py @@ -21,8 +21,6 @@ GUNNER_KILLS_WOLF_AT_NIGHT_CHANCE = 1/2 GUARDIAN_ANGEL_DIES_CHANCE = 1/2 DETECTIVE_REVEALED_CHANCE = 2/5 -DEBUG_MODE = True - GAME_MODES = {} ################################################################################################################# diff --git a/wolfgame.py b/wolfgame.py index 7c93d85..b5b8b5b 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -153,7 +153,7 @@ def forced_exit(cli, nick, *rest): # Admin Only dict.clear(COMMANDS) dict.clear(PM_COMMANDS) dict.clear(HOOKS) - cli.quit("Forced quit from admin") + cli.quit("Forced quit from "+nick) raise SystemExit @@ -1670,7 +1670,8 @@ def start(cli, nick, chan, rest): # Select cursed (just a villager) possiblecursed = pl[:] for cannotbe in (var.ROLES["wolf"] + var.ROLES["werecrow"] + - var.ROLES["seer"] + var.ROLES["traitor"]): + var.ROLES["seer"]): # confusing (Traitor can be cursed apparently) + # but not in the Perl howlbot code possiblecursed.remove(cannotbe) if var.ROLES["cursed"]: var.CURSED = random.sample(possiblecursed, len(var.ROLES["cursed"])) @@ -1698,7 +1699,7 @@ def start(cli, nick, chan, rest): var.ROLES["villager"] = villagers cli.msg(chan, ("{0}: Welcome to Werewolf, the popular detective/social party "+ - "game (a theme of Mafia).").format(", ".join(var.list_players()))) + "game (a theme of Mafia).").format(", ".join(pl))) cli.mode(chan, "+m") var.ORIGINAL_ROLES = copy.deepcopy(var.ROLES) # Make a copy @@ -1938,12 +1939,12 @@ def coin(cli, nick, chan, rest): cli.msg(chan, "The coin lands on \2{0}\2.".format("heads" if random.random() < 0.5 else "tails")) -if var.DEBUG_MODE: +if botconfig.DEBUG_MODE: @cmd("revealroles", admin_only=True) def revroles(cli, nick, chan, rest): cli.msg(chan, str(var.ROLES)) - #TODO: make this and other functions debug-mode only - + cli.msg(chan, "Cursed: "+str(var.CURSED)) + cli.msg(chan, "Gunners: "+str(list(var.GUNNERS.keys()))) @cmd("force", admin_only=True)