修改战斗系统

This commit is contained in:
2025-09-19 00:29:55 +08:00
parent 60a8be8b48
commit a2eb88e9d3
27 changed files with 87540 additions and 3617 deletions

View File

@@ -7,6 +7,8 @@ import (
"math/rand"
"time"
"github.com/gogf/gf/v2/util/gconv"
)
const TableNamePet = "pet"
@@ -87,13 +89,19 @@ 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{
EID: 28,
})
naxml := xmlres.NatureRootMap[int(p.Nature)]
petxml := xmlres.PetMAP[int(id)]
p.EffectInfo[0].Args = []int{petxml.Type, 5} //默认等级1
if abilityTypeEnum != nil {
rrr := xmlres.EffectMAP[RandomInRange(abilityTypeEnum)+1006]
p.EffectInfo = append(p.EffectInfo, PetEffectInfo{
EID: uint16(gconv.Int16(rrr.Eid)),
Args: rrr.ArgsS,
})
//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) {