Skip to content

Commit

Permalink
Pactbreaker fixes
Browse files Browse the repository at this point in the history
- Ensure that the default pool size has enough tokens for at least one
  person to !observe even if all tokens are spread out evenly.
  Previously a stalemate situation could arise where everyone has 3
  tokens and are unable to spend them.
- Fix message key for !observe
- Reduce chance of getting evidence on wolf/cursed in forest to
  approximately 40%, and don't scale it up as much as more non-wolves
  visit.
  • Loading branch information
skizzerz committed Dec 11, 2024
1 parent d513818 commit dc5d801
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/defaultsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1123,11 +1123,11 @@ gameplay: &gameplay
pool:
_desc: >
This number is multiplied with the number of players to determine how many total clue tokens
are available in the game.
are available in the game. Fractions are always rounded up.
_type:
- float
- int
_default: 3
_default: 3.2
bite:
_desc: The maximum number of clue tokens drawn when someone is the target of a vampire bite.
_type: int
Expand Down
8 changes: 4 additions & 4 deletions src/gamemodes/pactbreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def on_start_game(self, evt: Event, var: GameState, mode_name: str, mode: GameMo
pl = get_players(var)
self.active_players.update(pl)
# initialize clue pool
self.clue_pool = math.floor(config.Main.get("gameplay.modes.pactbreaker.clue.pool") * len(pl))
self.clue_pool = math.ceil(config.Main.get("gameplay.modes.pactbreaker.clue.pool") * len(pl))

def on_send_role(self, evt: Event, var: GameState):
pl = get_players(var)
Expand Down Expand Up @@ -239,8 +239,8 @@ def build_deck(self, var: GameState, location: Location, visitors: set[User]) ->

if location is Forest:
deck = (["empty-handed", "evidence", "evidence"]
+ (["hunted", "hunted"] * num_wolves)
+ (["evidence", "evidence"] * num_other))
+ (["hunted", "hunted", "evidence"] * num_wolves)
+ (["evidence", "evidence", "empty-handed"] * num_other))
num_draws = 2
elif location is VillageSquare:
deck = (["empty_handed"] * (2 * max(0, num_visitors - 4))
Expand Down Expand Up @@ -698,7 +698,7 @@ def observe(self, wrapper: MessageDispatcher, message: str):
target_role = "vigilante" if target in self.turned else "villager"

self.collected_evidence[wrapper.source][target_role].add(target)
wrapper.send(messages["observe_success"].format(target, target_role))
wrapper.send(messages["pactbreaker_observe_success"].format(target, target_role))

def identify(self, wrapper: MessageDispatcher, message: str):
"""Spend clue tokens to accurately learn about a player's role."""
Expand Down

0 comments on commit dc5d801

Please sign in to comment.