From c495b5d5ed4ab53b62492f8a1cdb4e8980f26d8b Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 12 Jan 2023 18:25:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=AA=E7=89=A9=E5=B1=9E=E6=80=A7=E5=A4=84?= =?UTF-8?q?=E7=90=86=20=E4=B8=8D=E4=BA=AB=E5=8F=97=E5=A4=A9=E8=B5=8B?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=8A=A0=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/model_hero.go | 9 +++++++-- modules/hero/module.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 9c995f191..d3fb8a43d 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -488,7 +488,10 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) { comm.Cridam: int32(growCfg.Cridam), //暴击伤害 comm.Effre: int32(growCfg.Effre), //效果抵抗 } - this.resetTalentProperty(hero) + + if hero.Id != "" { // objID 为空表示是怪物对象 不享受天赋属性加成 + this.resetTalentProperty(hero) + } } //重新计算英雄属性 @@ -688,7 +691,8 @@ func (this *ModelHero) GetRandHeroIdBypool(sz []int32) int32 { return 0 } -func (this *ModelHero) InitTempHero(heroCfgId string, star, lv int32) *pb.DBHero { +// 初始化怪物属性 +func (this *ModelHero) InitMonsterHero(heroCfgId string, star, lv int32) *pb.DBHero { heroCfg := this.moduleHero.configure.GetHeroConfig(heroCfgId) if heroCfg == nil { this.moduleHero.Errorf("%v hero not found from config %v", heroCfgId) @@ -715,6 +719,7 @@ func (this *ModelHero) InitTempHero(heroCfgId string, star, lv int32) *pb.DBHero } this.PropertyCompute(newHero) this.initHeroSkill(newHero) + return newHero } diff --git a/modules/hero/module.go b/modules/hero/module.go index 3ddca05b5..92125aad2 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -399,7 +399,7 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf // 创建怪物英雄 func (this *Hero) CreateMonster(heroCid string, star, lv int32) (hero *pb.DBHero) { - hero = this.modelHero.InitTempHero(heroCid, star, lv) + hero = this.modelHero.InitMonsterHero(heroCid, star, lv) return }