Skip to content

Commit

Permalink
PB tweaks
Browse files Browse the repository at this point in the history
- Wolves draw an additional card at forest, increasing their chance of
  gaining clue tokens to approximately 50%
- Fix issue where vampire could get the "your kill failed" message if
  they bite someone the same night that someone else kills the same
  target
  • Loading branch information
skizzerz committed Dec 23, 2024
1 parent 5625d0d commit 954d8f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gamemodes/pactbreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def on_night_kills(self, evt: Event, var: GameState):
all_vamps = set(get_players(var, ("vampire",)))
all_cursed = get_all_players(var, ("cursed villager",))
wl = list(all_wolves | all_cursed)
extra = (("vampire", Graveyard), ("wolf", Forest))

for player in self.active_players & all_wolves - self.protected:
# wolves need to be drained 3 times to die
Expand Down Expand Up @@ -333,7 +334,8 @@ def on_night_kills(self, evt: Event, var: GameState):
for visitor in vl:
visitor_role = get_main_role(var, visitor)
# vamps draw 2 cards at graveyard instead of 1
extra_draws = 1 if visitor_role == "vampire" and location is Graveyard else 0
# wolves draw 3 cards at forest instead of 2
extra_draws = 1 if (visitor_role, location) in extra else 0
cards = deck[i:i + num_draws + extra_draws]
i += num_draws + extra_draws
empty = True
Expand Down Expand Up @@ -474,6 +476,9 @@ def on_player_protected(self,
self.turned.add(target)
self.drained.discard(target)

# don't tell the attacker that their kill failed in case someone else also attacks the target the same night
self.night_kill_messages.discard((attacker, target))

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

0 comments on commit 954d8f6

Please sign in to comment.