This commit is contained in:
@@ -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 → uint32,0=否,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 {
|
||||
|
||||
Reference in New Issue
Block a user