This commit is contained in:
liwei1dao 2023-01-13 10:20:59 +08:00
commit 9a59cbb680
2 changed files with 8 additions and 3 deletions

View File

@ -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
}

View File

@ -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
}