Adv 2.0 L4e reader flip (read-only sites): house state via loadHouseState

dnd_rest long-rest eligibility, dnd_sheet housing display, and
petShouldArrive / mistyHousingHint now source house state from
player_meta via loadHouseState(userID) instead of *AdventureCharacter.
petShouldArrive, mistyHousingHint, and renderDnDSheet gained a
HouseState parameter; scheduler and Misty NPC callers load it.
Reader flip inside adventure_housing.go itself stays deferred — its
mutation paths bundle with cutting AdvCharacter writes post-soak.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-09 10:42:59 -07:00
parent c719b30fd7
commit 0004a2e35c
8 changed files with 42 additions and 32 deletions

View File

@@ -244,7 +244,8 @@ func (p *AdventurePlugin) resolveMisty(ctx MessageContext, char *AdventureCharac
reply := mistyAcceptLines[rand.IntN(len(mistyAcceptLines))]
// Housing hint (fires once after 2+ encounters)
hint := mistyHousingHint(char)
mistyHouse, _ := loadHouseState(char.UserID)
hint := mistyHousingHint(char, mistyHouse)
if hint != "" {
reply += "\n\n_" + hint + "_"
}