机器人回响判断

This commit is contained in:
meixiongfeng 2023-08-28 14:08:27 +08:00
parent cdc0afecc3
commit 1b15516ac3

View File

@ -84,24 +84,30 @@ func (this *ModuleRobot_Hero) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskDa
bMax := false
// 获取英雄数据
var bFound bool
for k, v := range this.heros {
if c, err := this.GMGetTalentByHeroId(k); err != nil {
for _, v1 := range this.talent {
if len(v1.Talent) == len(c) {
bMax = true
break
}
if v1.HeroId == v.HeroID {
bFound = true
resp.ObjId = v1.Id
resp.Heroid = v.HeroID
// 依次往后学
if len(v1.Talent) < len(c) {
resp.TalentID = c[len(v1.Talent)].Skillid
for _, v := range this.heros {
if c, err := this.GMGetTalentByHeroId(v.HeroID); err == nil {
if this.talent == nil {
resp.TalentID = c[0].Skillid
resp.Heroid = v.HeroID
} else {
for _, v1 := range this.talent {
if len(v1.Talent) == len(c) {
bMax = true
break
}
if v1.HeroId == v.HeroID {
bFound = true
resp.ObjId = v1.Id
resp.Heroid = v.HeroID
// 依次往后学
if len(v1.Talent) < len(c) {
resp.TalentID = c[len(v1.Talent)].Skillid
}
break
}
break
}
}
}
if bMax { // 当前英雄全满共鸣后 继续找下一个英雄
continue