From 4dc86adc7508d16b9ccf469a87b874c81368fa0f Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 20 Aug 2017 18:45:55 -0400 Subject: [PATCH] add mad scientist targets to myrole and revealroles --- messages/en.json | 2 ++ src/roles/madscientist.py | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/messages/en.json b/messages/en.json index 5d348bd..8950a93 100644 --- a/messages/en.json +++ b/messages/en.json @@ -501,6 +501,8 @@ "hunter_simple": "You are a \u0002hunter\u0002.", "mad_scientist_notify": "You are the \u0002mad scientist\u0002. You win with the villagers, and should you die, you will let loose a potent chemical concoction that will kill \u0002{0}\u0002 and \u0002{1}\u0002 if they are still alive.", "mad_scientist_simple": "You are the \u0002mad scientist\u0002. Targets: \u0002{0}\u0002 and \u0002{1}\u0002", + "mad_scientist_myrole_targets": "Targets: \u0002{0}\u0002 and \u0002{1}\u0002", + "mad_scientist_revealroles_targets": "targeting \u0002{0}\u0002 and \u0002{1}\u0002", "doctor_notify": "You are a \u0002doctor\u0002. You can give out immunizations to villagers by using \"give \" in PM during the daytime. An immunized villager will die instead of turning into a wolf due to the alpha wolf's or lycan's power.", "doctor_simple": "You are a \u0002doctor\u0002.", "doctor_immunizations": "You have \u0002{0}\u0002 immunization{1}.", diff --git a/src/roles/madscientist.py b/src/roles/madscientist.py index 0f3533c..1d0ab20 100644 --- a/src/roles/madscientist.py +++ b/src/roles/madscientist.py @@ -158,5 +158,17 @@ def on_transition_night_end(evt, cli, var): else: pm(cli, ms, messages["mad_scientist_simple"].format(target1, target2)) +@event_listener("myrole") +def on_myrole(evt, cli, var, nick): + pl = list_players() + target1, target2 = _get_targets(var, pl, nick) + evt.data["messages"].append(messages["mad_scientist_myrole_targets"].format(target1, target2)) + +@event_listener("revealroles_role") +def on_revealroles(evt, var, wrapper, nickname, role): + pl = list_players() + target1, target2 = _get_targets(var, pl, nickname) + evt.data["special_case"].append(messages["mad_scientist_revealroles_targets"].format(target1, target2)) + # vim: set sw=4 expandtab: