Fixes for role change

This commit is contained in:
skizzerz 2017-12-13 22:04:08 -06:00
parent 95da346344
commit 7a66275bcc
3 changed files with 6 additions and 7 deletions

View File

@ -87,7 +87,7 @@ def charm(var, wrapper, message):
def on_chk_win(evt, cli, var, rolemap, mainroles, lpl, lwolves, lrealwolves): def on_chk_win(evt, cli, var, rolemap, mainroles, lpl, lwolves, lrealwolves):
# lpl doesn't included wounded/sick people or consecrating priests # lpl doesn't included wounded/sick people or consecrating priests
# whereas we want to ensure EVERYONE (even wounded people) are charmed for piper win # 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) lp = len(pipers)
if lp == 0: # no alive pipers, short-circuit this check if lp == 0: # no alive pipers, short-circuit this check
return return

View File

@ -64,15 +64,14 @@ def on_chk_win(evt, cli, var, rolemap, mainroles, lpl, lwolves, lrealwolves):
for wc in list(rolemap["wolf cub"]): for wc in list(rolemap["wolf cub"]):
rolemap["wolf"].add(wc) rolemap["wolf"].add(wc)
rolemap["wolf cub"].remove(wc) rolemap["wolf cub"].remove(wc)
wcu = users._get(wc) # FIXME if mainroles[wc] == "wolf cub":
if mainroles[wcu] == "wolf cub": mainroles[wc] = "wolf"
mainroles[wcu] = "wolf"
did_something = True did_something = True
if var.PHASE in var.GAME_PHASES: if var.PHASE in var.GAME_PHASES:
# don't set cub's FINAL_ROLE to wolf, since we want them listed in endgame # don't set cub's FINAL_ROLE to wolf, since we want them listed in endgame
# stats as cub still. # stats as cub still.
wcu.send(messages["cub_grow_up"]) wc.send(messages["cub_grow_up"])
debuglog(wc, "(wolf cub) GROW UP") debuglog("{0} (wolf cub) GROW UP".format(wc))
if did_something: if did_something:
evt.prevent_default = True evt.prevent_default = True
evt.stop_processing = True evt.stop_processing = True

View File

@ -4678,7 +4678,7 @@ def target(cli, nick, chan, rest):
var.TARGETED[nick] = victim var.TARGETED[nick] = victim
pm(cli, nick, messages["assassin_target_success"].format(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) chk_nightdone(cli)
@cmd("hex", chan=False, pm=True, playing=True, silenced=True, phases=("night",), roles=("hag",)) @cmd("hex", chan=False, pm=True, playing=True, silenced=True, phases=("night",), roles=("hag",))