refactor(fight): 重构效果相关逻辑
- 修改 Effect 接口,增加 NotALive 方法 - 更新 EffectNode 结构,添加 NotALive 字段和 NotALive 方法 - 调整 Input 结构,使用 NotALive 方法处理效果消失逻辑 - 重构 PetEffectInfo 结构,修改
This commit is contained in:
@@ -87,9 +87,13 @@ func GenPetInfo(id int, dv, natureId, abilityTypeEnum, shinyid, level []int) *Pe
|
||||
CatchTime: uint32(time.Now().Unix()),
|
||||
Level: uint32(RandomInRange(level))} //等级
|
||||
|
||||
p.EffectInfo = append(p.EffectInfo, PetEffectInfo{ItemID: uint32(RandomInRange(abilityTypeEnum))})
|
||||
p.EffectInfo = append(p.EffectInfo, PetEffectInfo{
|
||||
EID: 28,
|
||||
})
|
||||
naxml := xmlres.NatureRootMap[int(p.Nature)]
|
||||
petxml := xmlres.PetMAP[int(id)]
|
||||
p.EffectInfo[0].Args1 = byte(petxml.Type) //默认本族加成
|
||||
p.EffectInfo[0].Args2 = 5 //默认等级1
|
||||
tttt := make([]uint32, 0)
|
||||
for _, v := range petxml.LearnableMoves.Moves {
|
||||
if p.Level >= uint32(v.LearningLv) {
|
||||
@@ -274,10 +278,10 @@ type PetEffectInfo struct {
|
||||
ItemID uint32 `struc:"uint32" json:"item_id"`
|
||||
Status byte `struc:"byte" json:"status"`
|
||||
LeftCount byte `struc:"byte" json:"left_count"`
|
||||
EffectID uint16 `struc:"uint16" json:"effect_id"`
|
||||
Reserve1 byte `struc:"byte" json:"reserve1"`
|
||||
EID uint16 `struc:"uint16" json:"effect_id"`
|
||||
Args1 byte `struc:"byte" json:"reserve1"`
|
||||
Reserve2 byte `struc:"byte" json:"reserve2"`
|
||||
Reserve3 byte `struc:"byte" json:"reserve3"`
|
||||
Args2 byte `struc:"byte" json:"reserve3"`
|
||||
Reserve4 [13]byte `struc:"[13]byte" json:"reserve4"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user