Merge pull request #266 from lykoss/werecrow_kill

Allow werecrow to both observe and kill at the same time
This commit is contained in:
Ryan Schmidt 2016-11-07 23:13:10 -07:00 committed by GitHub
commit 8039b5e2a1
3 changed files with 4 additions and 18 deletions

View File

@ -329,7 +329,6 @@
"gunner_suicide_no_reveal": "Oh no! \u0002{0}\u0002's gun was poorly maintained and has exploded!",
"hunter_already_killed": "You have already killed someone this game.",
"silenced": "You have been silenced, and are unable to use any special powers.",
"werecrow_transformed_nokill": "You have already transformed into a crow; therefore, you are physically unable to kill a villager.",
"player_dead": "You are already dead.",
"no_suicide": "Suicide is bad. Don't do it.",
"vengeful_ghost_wolf": "You must target a wolf.",
@ -435,7 +434,7 @@
"wolf_notify": "You are a \u0002{0}wolf\u0002. It is your job to kill all the villagers. Use \"kill <nick>\" to kill a villager.",
"cursed_traitor_notify": "You are a \u0002{0}cursed traitor\u0002. Normally, you would be seen as a villager by the seer and oracle, but since you're cursed, you are seen as a wolf.",
"traitor_notify": "You are a \u0002{0}traitor\u0002. You are exactly like a villager and not even a seer or oracle can see your true identity, only detectives and augurs can.",
"werecrow_notify": "You are a \u0002{0}werecrow\u0002. You are able to fly at night. Use \"kill <nick>\" to kill a villager. Alternatively, you can use \"observe <nick>\" to check if someone is in bed or not. Observing will prevent you from participating in a killing.",
"werecrow_notify": "You are a \u0002{0}werecrow\u0002. You are able to fly at night. Use \"observe <nick>\" to check if someone is in bed or not. You may also use \"kill <nick>\" to kill a villager.",
"hag_notify": "You are a \u0002{0}hag\u0002. You can hex someone to prevent them from using any special powers they may have during the next day and night. Use \"hex <nick>\" to hex them. Only detectives can reveal your true identity, seers will see you as a regular villager.",
"sorcerer_notify": "You are a \u0002{0}sorcerer\u0002. You can use \"observe <nick>\" to observe someone and determine if they are the seer, oracle, or augur. Only detectives can reveal your true identity, seers will see you as a regular villager.",
"wolf_cub_notify": "You are a \u0002{0}wolf cub\u0002. While you cannot kill anyone, the other wolves will become enraged if you die and will get two kills the following night.",

View File

@ -24,11 +24,6 @@ def wolf_kill(cli, nick, chan, rest):
if var.DISEASED_WOLVES:
pm(cli, nick, messages["ill_wolves"])
return
# eventually crow will listen on targeted_command and block kills that way
# (or more likely, that restriction will be lifted and crow can do both)
if role == "werecrow" and var.OBSERVED.get(nick):
pm(cli, nick, messages["werecrow_transformed_nokill"])
return
pieces = re.split(" +", rest)
victims = []
@ -208,9 +203,6 @@ def on_retribution_kill(evt, cli, var, victim, orig_target):
t = evt.data["target"]
if t == "@wolves":
wolves = list_players(var.WOLF_ROLES)
for crow in var.ROLES["werecrow"]:
if crow in var.OBSERVED:
wolves.remove(crow)
evt.data["target"] = random.choice(wolves)
@event_listener("exchange_roles", priority=2)
@ -299,7 +291,6 @@ def on_chk_nightdone2(evt, cli, var):
for ls in KILLS.values():
kills.update(ls)
# check if wolves are actually agreeing
# allow len(kills) == 0 through as that means that crow was dumb and observed instead
if not var.ANGRY_WOLVES and len(kills) > 1:
evt.data["actedcount"] -= 1
elif var.ANGRY_WOLVES and (len(kills) == 1 or len(kills) > 2):

View File

@ -4079,8 +4079,8 @@ def transition_day(cli, gameid=0):
for victim in list(dead):
if victim in var.GUNNERS.keys() and var.GUNNERS[victim] > 0 and victim in bywolves:
if random.random() < var.GUNNER_KILLS_WOLF_AT_NIGHT_CHANCE:
# pick a random wolf to be shot, but don't kill off werecrows that observed
killlist = [wolf for wolf in list_players(var.WOLF_ROLES) if wolf not in var.OBSERVED.keys() and wolf not in dead]
# pick a random wolf to be shot
killlist = [wolf for wolf in list_players(var.WOLF_ROLES) if wolf not in dead]
if killlist:
deadwolf = random.choice(killlist)
if var.ROLE_REVEAL in ("on", "team"):
@ -4189,7 +4189,7 @@ def chk_nightdone(cli):
actedcount = sum(map(len, (var.HVISITED, var.PASSED, var.OBSERVED,
var.HEXED, var.CURSED, var.CHARMERS)))
nightroles = get_roles("harlot", "succubus", "sorcerer", "hag", "warlock", "piper", "prophet")
nightroles = get_roles("harlot", "succubus", "sorcerer", "hag", "warlock", "werecrow", "piper", "prophet")
for nick, info in var.PRAYED.items():
if info[0] > 0:
@ -4791,10 +4791,6 @@ def observe(cli, nick, chan, rest):
if check_exchange(cli, nick, victim):
return
var.OBSERVED[nick] = victim
# temp hack, will do something better once crow is split off
from src.roles import wolf
if nick in wolf.KILLS:
del wolf.KILLS[nick]
if role == "werecrow":
pm(cli, nick, messages["werecrow_observe_success"].format(victim))
relay_wolfchat_command(cli, nick, messages["wolfchat_observe"].format(nick, victim), ("werecrow",), is_wolf_command=True)