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

Add locations #518

Closed
wants to merge 9 commits into from
Closed

Add locations #518

wants to merge 9 commits into from

Conversation

Vgr255
Copy link
Member

@Vgr255 Vgr255 commented Jul 13, 2023

This adds locations to lykos, allowing more flexibility for current and future roles.

Current task list to be completed before merging:

  • Has Village Square, Graveyard, and individual player's houses
  • Absent has been removed entirely; voting is now only possible if in the village square (and roles can set a "prison" reason for other roles, preventing them from leaving their current location until night)
  • Insomniac has not been updated (need to figure out how it needs to behave)
  • Mad Scientist has not been updated (should target adjacent houses if die at night, otherwise current behaviour)
  • Players will always be in exactly one location
  • There is a read-only property GameState.locations, though I don't think it's currently being used
  • Visiting roles (harlot, succubus) change their location to the house they visit
  • Wolves (and possibly hunter/vigilante too) need to target a location, rather than a person
  • Currently undefined behaviour for if someone does not have a house (might be out of scope)
  • No testing has been done

@Vgr255 Vgr255 marked this pull request as ready for review July 25, 2023 21:18
Vgr255 and others added 4 commits August 22, 2023 14:32
This allows transition_day to correctly determine the vigilante's
location and for us to still be able to suppress protections. Formerly,
the add_dying() would circumvent much of transition_day's logic because
they were already treated as dead, which led to the situation where a
wolf attacking a vigilante who guesses wrong will play a "target not
home" message due to said vigilante already being dead (and therefore
not having a location).
@skizzerz
Copy link
Member

skizzerz commented Oct 5, 2023

This has some good ideas but also quite a few weird ones that I would not be willing to keep as-is, and given two things I'm going to close this out and do it separately:

  1. Non-location-related changes as part of the PR
  2. You're mostly busy on non-location things now
  3. I need this integrated into my work for new Halloween mode which heavily uses locations

@skizzerz skizzerz closed this Oct 5, 2023
skizzerz added a commit that referenced this pull request Oct 7, 2023
This is a significantly lighter refactor than #518. To wit,

- The absent status remains. We move people to the square or their house
  depending on their absent status at beginning of day, but otherwise
  location during daytime does not impact ability to vote by itself.
- Locations are singleton objects based on their name and do not carry
  any game state in the object itself. All game state is stored in
  GameState itself.
- There are no location subclasses; everything is just directly a
  Location.
- All access to location data is done via the locations APIs rather than
  directly modifying the GameState variables. This allows for easier
  future refactors of how we are storing data.
@skizzerz skizzerz deleted the locations branch November 8, 2023 05:37
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.

2 participants