From acc26cbc3e035f9774a2227b809cb6abe01c6a27 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Thu, 28 Jul 2011 15:53:49 -0500 Subject: [PATCH] !rforce gunner now works --- var.py | 3 ++- wolfgame.py | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/var.py b/var.py index c23f263..9c59035 100644 --- a/var.py +++ b/var.py @@ -16,7 +16,8 @@ AWAY = [] # cloaks of people who are away. # HIT MISS SUICIDE GUN_CHANCES = ( 5/7 , 1/7 , 1/7 ) DRUNK_GUN_CHANCES = ( 4/7 , 2/7 , 1/7 ) -MANSLAUGHTER_CHANCE = 1/5 +MANSLAUGHTER_CHANCE = 1/5 # ACCIDENTAL HEADSHOT (FATAL) + GUNNER_KILLS_WOLF_AT_NIGHT_CHANCE = 1/2 GUARDIAN_ANGEL_DIES_CHANCE = 1/2 DETECTIVE_REVEALED_CHANCE = 2/5 diff --git a/wolfgame.py b/wolfgame.py index 7bcbe94..0fcf1d7 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -2031,24 +2031,29 @@ if botconfig.DEBUG_MODE: if len(rst) < 2: cli.msg(chan, "The syntax is incorrect.") return - who = rst.pop(0).strip() + who = rst.pop(0).strip().lower() who.replace("_", " ") - if who not in var.ROLES or not var.ROLES[who]: + if (who not in var.ROLES or not var.ROLES[who]) and (who != "gunner" + or var.PHASE in ("none", "join")): cli.msg(chan, nick+": invalid role") return + elif who == "gunner": + tgt = list(var.GUNNERS.keys()) + else: + tgt = var.ROLES[who] cmd = rst.pop(0).lower().replace(botconfig.CMD_CHAR, "", 1) if cmd in PM_COMMANDS.keys() and not PM_COMMANDS[cmd][0].owner_only: for fn in PM_COMMANDS[cmd]: - for guy in var.ROLES[who]: + for guy in tgt: fn(cli, guy, " ".join(rst)) cli.msg(chan, "Operation successful.") #if var.PHASE == "night": <- Causes problems with night starting twice. # chk_nightdone(cli) elif cmd.lower() in COMMANDS.keys() and not COMMANDS[cmd][0].owner_only: for fn in COMMANDS[cmd]: - for guy in var.ROLES[who]: + for guy in tgt: fn(cli, guy, chan, " ".join(rst)) cli.msg(chan, "Operation successful.") else: