Fix exchange totem not firing

This commit is contained in:
skizzerz 2016-08-17 17:06:27 -05:00
parent ebb3bdccfb
commit af2fef5ea9
3 changed files with 28 additions and 24 deletions

View File

@ -10,12 +10,12 @@ from src.events import Event
@event_listener("exchange_roles")
def on_exchange(evt, cli, var, actor, nick, actor_role, nick_role):
evt = Event("get_special", {"special": set()})
evt.dispatch(cli, var)
evt2 = Event("get_special", {"special": set()})
evt2.dispatch(cli, var)
pl = set(list_players())
wolves = set(list_players(var.WOLFTEAM_ROLES))
neutral = set(list_players(var.TRUE_NEUTRAL_ROLES))
special = evt.data["special"]
special = evt2.data["special"]
if nick_role == "wolf mystic" and actor_role != "wolf mystic":
# # of special villagers = # of players - # of villagers - # of wolves - # of neutrals
@ -35,12 +35,12 @@ def on_exchange(evt, cli, var, actor, nick, actor_role, nick_role):
@event_listener("transition_night_end", priority=2.01)
def on_transition_night_end(evt, cli, var):
evt = Event("get_special", {"special": set()})
evt.dispatch(cli, var)
evt2 = Event("get_special", {"special": set()})
evt2.dispatch(cli, var)
pl = set(list_players())
wolves = set(list_players(var.WOLFTEAM_ROLES))
neutral = set(list_players(var.TRUE_NEUTRAL_ROLES))
special = evt.data["special"]
special = evt2.data["special"]
for wolf in var.ROLES["wolf mystic"]:
# if adding this info to !myrole, you will need to save off this count so that they can't get updated info until the next night

View File

@ -223,6 +223,8 @@ def on_exchange(evt, cli, var, actor, nick, actor_role, nick_role):
notify = []
for i, player in enumerate(pl):
prole = get_role(player)
if player == nick:
prole = actor_role
if prole in wcroles:
cursed = ""
if player in var.ROLES["cursed villager"]:
@ -247,6 +249,8 @@ def on_exchange(evt, cli, var, actor, nick, actor_role, nick_role):
notify = []
for i, player in enumerate(pl):
prole = get_role(player)
if player == actor:
prole = nick_role
if prole in wcroles:
cursed = ""
if player in var.ROLES["cursed villager"]:

View File

@ -5921,8 +5921,8 @@ def charm(cli, nick, chan, rest):
chk_nightdone(cli)
@event_listener("targeted_cmd", priority=9)
def on_targeted_cmd(evt, cli, var, cmd, actor, orig_target, tags):
@event_listener("targeted_command", priority=9)
def on_targeted_command(evt, cli, var, cmd, actor, orig_target, tags):
# TODO: move beneficial command check into roles/succubus.py
if "beneficial" not in tags and is_safe(actor, evt.data["target"]):
pm(cli, actor, messages["no_acting_on_succubus"].format(cmd))