Skip to content

Conversation

develra
Copy link
Contributor

@develra develra commented Oct 1, 2025

No description provided.

@SohierDane SohierDane self-assigned this Oct 1, 2025
@SohierDane SohierDane requested a review from hannw October 1, 2025 23:40
@SohierDane SohierDane changed the title [Werewolf V0.2] - Port Game Logic [Werewolf V0.2] - Game Logic Oct 1, 2025
wolves = [p for p in self.state.alive_players() if p.role.team == Team.WEREWOLVES]
villagers = [p for p in self.state.alive_players() if p.role.team == Team.VILLAGERS]

if not wolves:
Copy link
Contributor

@SohierDane SohierDane Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hannw It looks like we're missing a state for the case where a single player causes the game to end early, such as by timing out or delivering invalid responses. It looks like penalizing just the player causing the error wouldn't be too tricky to add here. Would it be a reasonable lift to integrate with the other error handling?

perceived_threat_level: Optional[PerceivedThreatLevel] = Field(
default=PerceivedThreatLevel.SAFE, access=DataAccessLevel.PERSONAL
)
action: Optional[BaseAction] = Field(default=None, access=DataAccessLevel.PERSONAL)
Copy link
Contributor

@SohierDane SohierDane Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hannw Looks like this line is the cause of a Pydantic deprecation alert:
PydanticDeprecatedSince20: Using extra keyword arguments on Fieldis deprecated and will be removed. Usejson_schema_extra instead. (Extra keys: 'access'). Deprecated in Pydantic V2.0 to be removed in V3.0.

Gemini suggests instead:
action: Optional[BaseAction] = Field(default=None, json_schema_extra={"access": DataAccessLevel.PERSONAL})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also affects lines 37 and 40.

Copy link
Contributor

@SohierDane SohierDane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM given the history of manual testing. I would like to follow up to remove the deprecation alerts.

@SohierDane SohierDane merged commit 44c69d6 into master Oct 3, 2025
4 checks passed
@SohierDane SohierDane deleted the wwolf_game branch October 3, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants