From 7f269874d6c9a95079bb6c33ba61486f09541fd7 Mon Sep 17 00:00:00 2001 From: skizzerz Date: Thu, 31 Jul 2014 22:15:23 -0500 Subject: [PATCH] Disable amnesiac pending rewrite --- modules/wolfgame.py | 3 ++- settings/wolfgame.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index cfc7606..71728da 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -4074,7 +4074,8 @@ def start(cli, nick, chann_, rest): continue # sharpshooter gets applied specially possible = pl[:] for cannotbe in var.list_players(restrictions): - possible.remove(cannotbe) + if cannotbe in possible: + possible.remove(cannotbe) if len(possible) < len(var.ROLES[template]): cli.msg(chan, "Not enough valid targets for the {0} template.".format(template)) if var.ORIGINAL_SETTINGS: diff --git a/settings/wolfgame.py b/settings/wolfgame.py index c84e9cb..aa08f64 100644 --- a/settings/wolfgame.py +++ b/settings/wolfgame.py @@ -147,6 +147,9 @@ TEMPLATE_RESTRICTIONS = {"cursed villager" : ["wolf", "wolf cub", "werecrow", "s "bureaucrat" : [], } +# Roles listed here cannot be used in !fgame roles=blah. If they are defined in ROLE_GUIDE they may still be used. +DISABLED_ROLES = ["amnesiac"] + NO_VICTIMS_MESSAGES = ("The body of a young penguin pet is found.", "A pool of blood and wolf paw prints are found.", "Traces of wolf fur are found.") @@ -251,7 +254,9 @@ class ChangedRolesMode(object): raise InvalidModeException("Invalid syntax for mode roles. arg={0}".format(arg)) role, num = change try: - if role.lower() in self.ROLE_GUIDE: + if role.lower() in DISABLED_ROLES: + raise InvalidModeException("The role \u0002{0}\u0002 has been disabled.".format(role)) + elif role.lower() in self.ROLE_GUIDE: self.ROLE_GUIDE[role.lower()] = tuple([int(num)] * len(ROLE_INDEX)) elif role.lower() == "default" and num.lower() in self.ROLE_GUIDE: if num.lower() == "villager" or num.lower() == "cultist":