From cd118dbabe2c33aeb1a6465a7fd913031337693f Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 7 Nov 2016 20:52:58 -0500 Subject: [PATCH 1/2] allow werecrow to both observe and kill at the same time --- messages/en.json | 1 - src/roles/wolf.py | 9 --------- src/wolfgame.py | 10 +++------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/messages/en.json b/messages/en.json index cca0286..0d4a64b 100644 --- a/messages/en.json +++ b/messages/en.json @@ -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.", diff --git a/src/roles/wolf.py b/src/roles/wolf.py index 0443af1..c422b27 100644 --- a/src/roles/wolf.py +++ b/src/roles/wolf.py @@ -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): diff --git a/src/wolfgame.py b/src/wolfgame.py index 5e019eb..5f8b8ad 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -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) From 44433c59794266eec397780da1edd6060b9d4814 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 7 Nov 2016 21:07:33 -0500 Subject: [PATCH 2/2] also update werecrow message in en.json --- messages/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/en.json b/messages/en.json index 0d4a64b..5111e19 100644 --- a/messages/en.json +++ b/messages/en.json @@ -434,7 +434,7 @@ "wolf_notify": "You are a \u0002{0}wolf\u0002. It is your job to kill all the villagers. Use \"kill \" 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 \" to kill a villager. Alternatively, you can use \"observe \" 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 \" to check if someone is in bed or not. You may also use \"kill \" 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 \" 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 \" 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.",