1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-08 17:57:42 +08:00
parent 2edd1ba852
commit ffe3ff18bf
25 changed files with 180 additions and 117 deletions

View File

@@ -49,9 +49,11 @@ type PetInfo struct {
ID uint32 `fieldDesc:"精灵编号" `
// 名字默认为全0补齐到16字节固定长度 → [16]byte
Name string `struc:"[16]byte" json:"Name,omitempty"`
Name string `struc:"[16]byte" json:"Name,omitempty"`
Gender int `struc:"uint16" fieldDesc:"性别" `
//generation
Generation uint32 `fieldDesc:"世代" `
Generation uint16 `fieldDesc:"世代" `
// 个体值(@UInt long → uint32
Dv uint32 `struc:"uint32" `
@@ -101,13 +103,13 @@ type PetInfo struct {
CatchLevel uint32 `fieldDesc:"捕获等级 默认为0" `
EffectInfoLen uint16 `struc:"sizeof=EffectInfo" json:"-"`
// 特性列表长度用UShort存储变长List → []PetEffectInfo + 长度前缀规则) 第一个一定是特性
EffectInfo []PetEffectInfo `fieldDesc:"特性列表, 长度在头部以UShort存储" serialize:"lengthFirst,lengthType=uint16,type=structArray"`
EffectInfo []PetEffectInfo
// 皮肤ID默认0@UInt long → uint32
SkinID uint32 `fieldDesc:"皮肤id默认为0" `
// 是否闪光(@UInt long → uint320=否1=是)
ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"`
ShinyLen uint32 `struc:"sizeof=ShinyInfo"`
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
//时间轮转然后effect根据type同时只共存一个特性是1 特质是1柱子是两种魂印是一个然后异色字段然后特训技能字段
@@ -214,7 +216,7 @@ func (pet *PetInfo) RandShiny() {
co := service.NewShinyService().RandShiny(pet.ID)
if co != nil {
pet.ShinyInfo = append(pet.ShinyInfo, *co)
pet.ShinyInfo = append(pet.ShinyInfo, *&co.Color)
}
//o.ShinyInfo[0].ColorMatrixFilter = GenerateRandomOffspringMatrix().Get()
//g.Dump(ttt.ShinyInfo)
@@ -224,7 +226,7 @@ func (pet *PetInfo) FixShiny() {
co := service.NewShinyService().FixShiny(pet.ID)
if co != nil {
pet.ShinyInfo = append(pet.ShinyInfo, *co)
pet.ShinyInfo = append(pet.ShinyInfo, *&co.Color)
}
//o.ShinyInfo[0].ColorMatrixFilter = GenerateRandomOffspringMatrix().Get()
//g.Dump(ttt.ShinyInfo)
@@ -418,6 +420,7 @@ func init() {
func GenPetInfo(
id int,
dv, natureId, abilityTypeEnum, level int, shinyid []data.GlowFilter,
gen int,
) *PetInfo {
// 创建随机源
//rng := rand.New(rand.NewSource(time.Now().UnixNano()))
@@ -434,8 +437,21 @@ func GenPetInfo(
if shinyid != nil {
//todo 待实现异色字段
p.ShinyInfo = shinyid
// r := service.NewShinyService().GetShiny(shinyid)
// if r != nil {
// p.ShinyInfo = append(p.ShinyInfo, *r)
// }
// p.Shiny = uint32(shinyid)
}
if gen == -1 {
p.Gender = grand.N(1, 4)
if p.Gender == 3 || p.Gender == 4 {
p.Gender = 0
}
}
// ---- 性格 ----
if natureId == -1 {