Use a non-discriminatory variable name #WolfSphereLivesMatter

This commit is contained in:
skizzerz 2016-08-16 10:34:16 -05:00
parent 9333588126
commit 3eccf32765

View File

@ -10,10 +10,13 @@ from src.messages import messages
from src.events import Event from src.events import Event
KILLS = {} # type: Dict[str, List[str]] KILLS = {} # type: Dict[str, List[str]]
# tetrahedron wolves consist of a pack of wolves without any wolf cube # wolves able to use the !kill command, roles should add to this in their own files via
TETRAHEDRON_WOLVES = set(var.WOLF_ROLES - {"wolf cub"}) # type: Set[str] # from src.roles import wolf
# wolf.CAN_KILL.add("wolf sphere") # or whatever the new wolf role is
# simply modifying var.WOLF_ROLES will *not* update this!
CAN_KILL = set(var.WOLF_ROLES - {"wolf cub"}) # type: Set[str]
@cmd("kill", chan=False, pm=True, playing=True, silenced=True, phases=("night",), roles=TETRAHEDRON_WOLVES) @cmd("kill", chan=False, pm=True, playing=True, silenced=True, phases=("night",), roles=CAN_KILL)
def wolf_kill(cli, nick, chan, rest): def wolf_kill(cli, nick, chan, rest):
"""Kills one or more players as a wolf.""" """Kills one or more players as a wolf."""
role = get_role(nick) role = get_role(nick)
@ -212,7 +215,7 @@ def on_chk_nightdone(evt, cli, var):
if not var.DISEASED_WOLVES: if not var.DISEASED_WOLVES:
evt.data["actedcount"] += len(KILLS) evt.data["actedcount"] += len(KILLS)
# eventually wolf cub will remove itself from nightroles in wolfcub.py # eventually wolf cub will remove itself from nightroles in wolfcub.py
evt.data["nightroles"].extend(list_players(TETRAHEDRON_WOLVES)) evt.data["nightroles"].extend(list_players(CAN_KILL))
@event_listener("chk_nightdone", priority=20) @event_listener("chk_nightdone", priority=20)
def on_chk_nightdone2(evt, cli, var): def on_chk_nightdone2(evt, cli, var):
@ -309,7 +312,7 @@ def on_transition_night_end(evt, cli, var):
pl[i] = player + " (cursed)" pl[i] = player + " (cursed)"
pm(cli, wolf, "Players: " + ", ".join(pl)) pm(cli, wolf, "Players: " + ", ".join(pl))
if role in TETRAHEDRON_WOLVES and var.DISEASED_WOLVES: if role in CAN_KILL and var.DISEASED_WOLVES:
pm(cli, wolf, messages["ill_wolves"]) pm(cli, wolf, messages["ill_wolves"])
# TODO: split the following out into their own files (mystic, cub and alpha) # TODO: split the following out into their own files (mystic, cub and alpha)
if role == "wolf mystic": if role == "wolf mystic":
@ -317,7 +320,7 @@ def on_transition_night_end(evt, cli, var):
# # of special villagers = # of players - # of villagers - # of wolves - # of neutrals # # of special villagers = # of players - # of villagers - # of wolves - # of neutrals
numvills = len(ps) - len(list_players(var.WOLFTEAM_ROLES)) - len(list_players(("villager", "vengeful ghost", "time lord", "amnesiac", "lycan"))) - len(list_players(var.TRUE_NEUTRAL_ROLES)) numvills = len(ps) - len(list_players(var.WOLFTEAM_ROLES)) - len(list_players(("villager", "vengeful ghost", "time lord", "amnesiac", "lycan"))) - len(list_players(var.TRUE_NEUTRAL_ROLES))
pm(cli, wolf, messages["wolf_mystic_info"].format("are" if numvills != 1 else "is", numvills, "s" if numvills != 1 else "")) pm(cli, wolf, messages["wolf_mystic_info"].format("are" if numvills != 1 else "is", numvills, "s" if numvills != 1 else ""))
if not var.DISEASED_WOLVES and var.ANGRY_WOLVES and role in TETRAHEDRON_WOLVES: if not var.DISEASED_WOLVES and var.ANGRY_WOLVES and role in CAN_KILL:
pm(cli, wolf, messages["angry_wolves"]) pm(cli, wolf, messages["angry_wolves"])
if var.ALPHA_ENABLED and role == "alpha wolf" and wolf not in var.ALPHA_WOLVES: if var.ALPHA_ENABLED and role == "alpha wolf" and wolf not in var.ALPHA_WOLVES:
pm(cli, wolf, messages["wolf_bite"]) pm(cli, wolf, messages["wolf_bite"])