mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 00:52:40 +00:00
Adv 2.0 L4d reader flip: pet helpers off AdvCharacter to PetState
All ten helpers in adventure_pets.go now take PetState (or *PetState for petGrantXP) instead of *AdventureCharacter. mistyHousingHint takes raw NPC counters since Misty fields stay on AdvCharacter for a later phase. mistyReactivatePet returns bool; caller flips both stores. DeathTransitionParams gained Pet PetState so combat_bridge no longer touches the DB; arena caller loads PetState. PetState.HasPet() mirrors AdvCharacter's. petMidnightCheck loads PetState per char. L4 grep-empty exit criterion now holds for adventure_pets.go. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -234,7 +234,10 @@ func (p *AdventurePlugin) resolveMisty(ctx MessageContext, char *AdventureCharac
|
||||
char.MistyDonatedCount++
|
||||
|
||||
// Pet reactivation: donating to Misty after chasing pet away
|
||||
mistyReactivatePet(char)
|
||||
mistyPet, _ := loadPetState(char.UserID)
|
||||
if mistyReactivatePet(mistyPet) {
|
||||
char.PetReactivated = true
|
||||
}
|
||||
|
||||
if err := saveAdvCharacter(char); err != nil {
|
||||
slog.Error("npc: failed to save misty buff", "user", ctx.Sender, "err", err)
|
||||
@@ -245,7 +248,7 @@ func (p *AdventurePlugin) resolveMisty(ctx MessageContext, char *AdventureCharac
|
||||
|
||||
// Housing hint (fires once after 2+ encounters)
|
||||
mistyHouse, _ := loadHouseState(char.UserID)
|
||||
hint := mistyHousingHint(char, mistyHouse)
|
||||
hint := mistyHousingHint(char.MistyEncounterCount, char.MistyDonatedCount, mistyHouse)
|
||||
if hint != "" {
|
||||
reply += "\n\n_" + hint + "_"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user