From 7a66275bccc98bdef3b789243a1eff1729b03875 Mon Sep 17 00:00:00 2001 From: skizzerz Date: Wed, 13 Dec 2017 22:04:08 -0600 Subject: [PATCH] Fixes for role change --- src/roles/piper.py | 2 +- src/roles/wolfcub.py | 9 ++++----- src/wolfgame.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/roles/piper.py b/src/roles/piper.py index 3897378..bf040dc 100644 --- a/src/roles/piper.py +++ b/src/roles/piper.py @@ -87,7 +87,7 @@ def charm(var, wrapper, message): def on_chk_win(evt, cli, var, rolemap, mainroles, lpl, lwolves, lrealwolves): # lpl doesn't included wounded/sick people or consecrating priests # whereas we want to ensure EVERYONE (even wounded people) are charmed for piper win - pipers = set(users._get(p) for p in rolemap.get("piper", ())) # FIXME + pipers = rolemap.get("piper", set()) lp = len(pipers) if lp == 0: # no alive pipers, short-circuit this check return diff --git a/src/roles/wolfcub.py b/src/roles/wolfcub.py index 78dc4c5..4df2e78 100644 --- a/src/roles/wolfcub.py +++ b/src/roles/wolfcub.py @@ -64,15 +64,14 @@ def on_chk_win(evt, cli, var, rolemap, mainroles, lpl, lwolves, lrealwolves): for wc in list(rolemap["wolf cub"]): rolemap["wolf"].add(wc) rolemap["wolf cub"].remove(wc) - wcu = users._get(wc) # FIXME - if mainroles[wcu] == "wolf cub": - mainroles[wcu] = "wolf" + if mainroles[wc] == "wolf cub": + mainroles[wc] = "wolf" did_something = True if var.PHASE in var.GAME_PHASES: # don't set cub's FINAL_ROLE to wolf, since we want them listed in endgame # stats as cub still. - wcu.send(messages["cub_grow_up"]) - debuglog(wc, "(wolf cub) GROW UP") + wc.send(messages["cub_grow_up"]) + debuglog("{0} (wolf cub) GROW UP".format(wc)) if did_something: evt.prevent_default = True evt.stop_processing = True diff --git a/src/wolfgame.py b/src/wolfgame.py index ac38acd..1fc3cfa 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -4678,7 +4678,7 @@ def target(cli, nick, chan, rest): var.TARGETED[nick] = victim pm(cli, nick, messages["assassin_target_success"].format(victim)) - debuglog("{0} ({1}-{2}) TARGET: {3} ({4})".format(nick, "-".join(get_templates(nick)), get_role(nick), victim, get_role(victim))) + debuglog("{0} (assassin) TARGET: {1} ({2})".format(nick, victim, get_role(victim))) chk_nightdone(cli) @cmd("hex", chan=False, pm=True, playing=True, silenced=True, phases=("night",), roles=("hag",))