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:
prosolis
2026-05-09 11:07:40 -07:00
parent 0004a2e35c
commit 81cce0169f
9 changed files with 147 additions and 148 deletions

View File

@@ -170,10 +170,9 @@ func TestTransitionDeath_SovereignReprieve(t *testing.T) {
func TestTransitionDeath_KillAndPetRecovery(t *testing.T) {
deaths, petRecoveries := 0, 0
for i := 0; i < 500; i++ {
char := &AdventureCharacter{
Alive: true, PetType: "cat", PetArrived: true, PetLevel: 5,
}
r := transitionDeath(DeathTransitionParams{Char: char, Location: "Mine"})
char := &AdventureCharacter{Alive: true}
pet := PetState{Type: "cat", Arrived: true, Level: 5}
r := transitionDeath(DeathTransitionParams{Char: char, Pet: pet, Location: "Mine"})
if !r.Died {
t.Fatal("should die with no saves available")
}