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:
@@ -312,6 +312,7 @@ func applyXPBonuses(p XPBonusParams) XPResult {
|
||||
type DeathTransitionParams struct {
|
||||
Char *AdventureCharacter
|
||||
Equip map[EquipmentSlot]*AdvEquipment
|
||||
Pet PetState // pet state for ditch-recovery roll; zero value disables
|
||||
ChatLevel int
|
||||
Location string // set as GrudgeLocation; empty = don't set
|
||||
Source string // death source: "adventure" | "arena" — recorded on Kill()
|
||||
@@ -374,8 +375,8 @@ func transitionDeath(p DeathTransitionParams) DeathTransitionResult {
|
||||
}
|
||||
r.Died = true
|
||||
|
||||
if petRollDitchRecovery(p.Char) && p.Char.DeadUntil != nil {
|
||||
reduced := time.Now().UTC().Add(petDitchRecoveryTime(p.Char.PetLevel))
|
||||
if petRollDitchRecovery(p.Pet) && p.Char.DeadUntil != nil {
|
||||
reduced := time.Now().UTC().Add(petDitchRecoveryTime(p.Pet.Level))
|
||||
p.Char.DeadUntil = &reduced
|
||||
r.PetRecovered = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user