diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index f6d37d72c..9260f53a8 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -672,42 +672,9 @@ func (this *ModelHero) setTalentProperty(hero *pb.DBHero, conf *cfg.GameHeroTale if hero.TalentProperty == nil { hero.TalentProperty = make(map[string]int32) } - if conf.Hp != -1 { - if _, ok := hero.TalentProperty[comm.Hp]; ok { - hero.TalentProperty[comm.Hp] += int32(math.Floor((float64(conf.Hp) / 1000) * float64(hero.Property[comm.Hp]))) - } else { - hero.TalentProperty[comm.Hp] = int32(math.Floor((float64(conf.Hp) / 1000) * float64(hero.Property[comm.Hp]))) - } - } - if conf.Atk != -1 { - if _, ok := hero.TalentProperty[comm.Atk]; ok { - hero.TalentProperty[comm.Atk] += int32(math.Floor((float64(conf.Atk) / 1000) * float64(hero.Property[comm.Atk]))) - } else { - hero.TalentProperty[comm.Atk] = int32(math.Floor((float64(conf.Atk) / 1000) * float64(hero.Property[comm.Atk]))) - } - } - if conf.Def != -1 { - if _, ok := hero.TalentProperty[comm.Def]; ok { - hero.TalentProperty[comm.Def] += int32(math.Floor((float64(conf.Def) / 1000) * float64(hero.Property[comm.Def]))) - } else { - hero.TalentProperty[comm.Def] = int32(math.Floor((float64(conf.Def) / 1000) * float64(hero.Property[comm.Def]))) - } - } - if conf.Cri != -1 { - if _, ok := hero.TalentProperty[comm.Cri]; ok { - hero.TalentProperty[comm.Cri] += int32(math.Floor((float64(conf.Cri) / 1000) * float64(hero.Property[comm.Cri]))) - } else { - hero.TalentProperty[comm.Cri] = int32(math.Floor((float64(conf.Cri) / 1000) * float64(hero.Property[comm.Cri]))) - } - } - if conf.Speed != -1 { - if _, ok := hero.TalentProperty[comm.Speed]; ok { - hero.TalentProperty[comm.Speed] += int32(math.Floor((float64(conf.Speed) / 1000) * float64(hero.Property[comm.Speed]))) - } else { - hero.TalentProperty[comm.Speed] = int32(math.Floor((float64(conf.Speed) / 1000) * float64(hero.Property[comm.Speed]))) - } - } + hero.TalentProperty[conf.Attrkey] += int32(math.Floor((float64(conf.Attrvar) / 1000) * float64(hero.Property[conf.Attrkey]))) + _heroMap := make(map[string]interface{}, 0) if conf.Skill != 0 { hero.NormalSkill = append(hero.NormalSkill, &pb.SkillData{