``` feat(pet): 重构宠物繁殖系统,添加蛋孵化功能

This commit is contained in:
1
2026-01-20 22:08:36 +00:00
parent cf4660fbe0
commit 5ef922278a
68 changed files with 4467 additions and 584 deletions

View File

@@ -1,6 +1,9 @@
package pet
import "blazing/logic/service/common"
import (
"blazing/logic/service/common"
"blazing/modules/player/model"
)
// C2S_GET_BREED_PET 获取繁殖精灵协议
// 前端到后端
@@ -16,33 +19,6 @@ type S2C_GET_BREED_PET struct {
FemaleList []uint32 `json:"femaleList"` // 可繁殖雌性的精灵数组 参数为精灵捕获时间
}
// S2C_GET_BREED_INFO 获取繁殖信息协议
// 后端到前端
type S2C_GET_BREED_INFO struct {
// BreedState 繁殖状态
BreedState uint32 `json:"breedState"`
// BreedLeftTime 繁殖剩余时间
BreedLeftTime uint32 `json:"breedLeftTime"`
// BreedCoolTime 繁殖冷却时间
BreedCoolTime uint32 `json:"breedCoolTime"`
// MalePetCatchTime 雄性精灵捕捉时间
MalePetCatchTime uint32 `json:"malePetCatchTime"`
// MalePetID 雄性精灵ID
MalePetID uint32 `json:"malePetID"`
// FeMalePetCatchTime 雌性精灵捕捉时间
FeMalePetCatchTime uint32 `json:"feMalePetCatchTime"`
// FeMalePetID 雌性精灵ID
FeMalePetID uint32 `json:"feMalePetID"`
// HatchState 孵化状态
HatchState uint32 `json:"hatchState"`
// HatchLeftTime 孵化剩余时间
HatchLeftTime uint32 `json:"hatchLeftTime"`
// EggID 当前孵化的精灵蛋ID
EggID uint32 `json:"eggID"`
// Intimacy 亲密度 1 = 悲伤 以此类推 ["悲伤","冷淡","平淡","友好","亲密无间"]
Intimacy uint32 `json:"intimacy"`
}
// C2S_GET_BREED_INFO 获取繁殖信息协议
// 前端到后端无数据 请求协议
type C2S_GET_BREED_INFO struct {
@@ -58,17 +34,8 @@ type C2S_GET_EGG_LIST struct {
// S2C_GET_EGG_LIST 获取精灵蛋数组协议
// 后端到前端
type S2C_GET_EGG_LIST struct {
EggListLen uint32 `struc:"sizeof=EggList"`
EggList []EggInfo `json:"eggList"` // 精灵蛋数组 跟其他数组一样 需要给有数量
}
// EggInfo 精灵蛋信息
type EggInfo struct {
OwnerID uint32 `json:"ownerID"` // 所属人ID
EggCatchTime uint32 `json:"eggCatchTime"` // 精灵蛋获得时间
EggID uint32 `json:"eggID"` // 精灵蛋ID
MalePetID uint32 `json:"male"` // 雄性精灵ID
FeMalePetID uint32 `json:"female"` // 雌性精灵ID
EggListLen uint32 `struc:"sizeof=EggList"`
EggList []model.EggInfo `json:"eggList"` // 精灵蛋数组 跟其他数组一样 需要给有数量
}
// C2S_START_HATCH 开始孵化精灵蛋协议