diff --git a/common/data/xmlres/file.go b/common/data/xmlres/file.go index a30faefda..4318b0476 100644 --- a/common/data/xmlres/file.go +++ b/common/data/xmlres/file.go @@ -31,10 +31,11 @@ var ( //Monster MonsterRoot //野怪配置 MonsterMap map[int]TMapConfig //Skill MovesTbl //技能配置 - SkillMap map[int]Move - PetMAP map[int]PetInfo //宠物配置 - NatureRootMap map[int]NatureItem - EffectMAP map[int]NewSeIdx + SkillMap map[int]Move + PetMAP map[int]PetInfo //宠物配置 + NatureRootMap map[int]NatureItem + EffectMAP map[int]NewSeIdx + PlayerEffectMAP map[int]NewSeIdx ) func initfile() { @@ -81,10 +82,15 @@ func initfile() { EffectMAP[gconv.Int(v.Idx)] = v } - // EffectMAP = utils.ToMap[NewSeIdx, int](EffectMAP1.SeIdxList, func(m NewSeIdx) int { - // return gconv.Int(m.Idx) + PlayerEffectMAP = make(map[int]NewSeIdx) + for _, v := range EffectMAP1.SeIdxList { + if gconv.Int(v.Stat) == 1 && gconv.Int(v.StarLevel) == 0 { + v.ArgsS = ParseSideEffectArgs(v.Args) - // }) + PlayerEffectMAP[gconv.Int(v.Idx)] = v + } + + } } diff --git a/modules/blazing/model/pet.go b/modules/blazing/model/pet.go index 761b38d73..b218cdc24 100644 --- a/modules/blazing/model/pet.go +++ b/modules/blazing/model/pet.go @@ -94,11 +94,16 @@ func GenPetInfo(id int, dv, natureId, abilityTypeEnum, shinyid, level []int) *Pe if abilityTypeEnum != nil { - rrr := xmlres.EffectMAP[RandomInRange(abilityTypeEnum)+1006] - p.EffectInfo = append(p.EffectInfo, PetEffectInfo{ - EID: uint16(gconv.Int16(rrr.Eid)), - Args: rrr.ArgsS, - }) + for i, v := range xmlres.PlayerEffectMAP { + if RandomInRange(abilityTypeEnum) == i { + p.EffectInfo = append(p.EffectInfo, PetEffectInfo{ + EID: uint16(gconv.Int16(v.Eid)), + Args: v.ArgsS, + }) + } + + } + //p.EffectInfo[0].Args = []int{petxml.Type, 5} //默认等级1 }