From 438dda8e45b630d64fe40811e7d8f5afed0a656a Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 19 Jul 2023 09:41:41 +0800 Subject: [PATCH] =?UTF-8?q?#28744=20=E5=AD=90=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E3=80=90=E6=A2=A6=E5=B7=A5=E5=9C=BA=E7=B3=BB=E7=BB=9F=E3=80=91?= =?UTF-8?q?=20<-=E5=90=8E=E7=AB=AF->=20=E3=80=90=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E5=9B=9E=E5=93=8D=E3=80=91=E5=9B=9E=E5=93=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/model_hero.go | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) 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{