Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent a turned vigilante from killing existing vampires #531

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,7 @@
"pactbreaker_drained": "While out last night, you are suddenly overtaken by {=vampire!role:article} {=vampire!role:bold}! They drain your blood and your vision blurs, however you manage to make the vague shape of your assailant before they retreat, giving you a potential clue to their identity.",
"pactbreaker_drained_dead": "While out last night, you are suddenly overtaken by {=vampire!role:article} {=vampire!role:bold}! They drain the rest of your blood as your consciousness fades away...",
"pactbreaker_drained_vigilante": "While out last night, you are suddenly overtaken by {=vampire!role:article} {=vampire!role:bold}! They drain the rest of your blood as your consciousness fades away. Shortly after, you reawaken in your own home with an unnatural hunger. It seems you have become {0!role:article} {0!role:bold} yourself!",
"pactbreaker_vampire_no_harm": "You no longer wish to harm {0:@}, as they are now family."
"pactbreaker_vote": [
"The village has decided to lock {0:@} into the stocks until tomorrow."
],
Expand Down
5 changes: 5 additions & 0 deletions src/gamemodes/pactbreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ def on_player_protected(self,
change_role(var, target, get_main_role(var, target), "vampire", message="pactbreaker_drained_vigilante")
self.turned.add(target)
self.drained.discard(target)
# prevent new vamp doing a cannibalism
for killer, victim in self.killing.items():
if killer == protector and get_main_role(var, victim) == "vampire":
self.killing.discard(killer)
protector.send(messages["pactbreaker_vampire_no_harm"].format(victim))

def on_night_death_message(self, evt: Event, var: GameState, victim: User, killer: User | str):
if not isinstance(killer, User):
Expand Down
Loading