refactor(fight): 重构战斗系统效果处理逻辑

- 移除 Effect0 基类效果
- 调整 Input 结构,删除未使用的属性
- 优化 Effect 接口,增加 GetMaxStack 方法
- 重构效果初始化逻辑,支持不同类型效果的初始化
- 优化效果的添加和移除操作
- 调整宠物效果信息结构,合并参数
This commit is contained in:
2025-09-16 22:51:22 +08:00
parent 8bf0ea37fd
commit 72e6b8c706
9 changed files with 66 additions and 30 deletions

View File

@@ -92,8 +92,8 @@ func GenPetInfo(id int, dv, natureId, abilityTypeEnum, shinyid, level []int) *Pe
})
naxml := xmlres.NatureRootMap[int(p.Nature)]
petxml := xmlres.PetMAP[int(id)]
p.EffectInfo[0].Args1 = byte(petxml.Type) //默认本族加成
p.EffectInfo[0].Args2 = 5 //默认等级1
p.EffectInfo[0].Args = []int{petxml.Type, 5} //默认等级1
tttt := make([]uint32, 0)
for _, v := range petxml.LearnableMoves.Moves {
if p.Level >= uint32(v.LearningLv) {
@@ -286,9 +286,9 @@ type PetEffectInfo struct {
Status byte `struc:"byte" json:"status"` //特性为1,能量珠为2
LeftCount byte `struc:"byte" json:"left_count"` //剩余次数
EID uint16 `struc:"uint16" json:"effect_id"` //特效ID
Args1 byte `struc:"byte" json:"reserve1"` //参数1
Args2 byte `struc:"byte" json:"reserve3"` //参数2
Args []int `struc:"skip" json:"Args"` //自定义参数装载
ArgsLen uint32 `struc:"sizeof=Args"`
Args []int ` json:"Args"` //自定义参数装载
}