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):
# 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

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"]):
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

View File

@ -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",))