满级回响
This commit is contained in:
parent
2a3ee38feb
commit
2901d94934
@ -127,8 +127,10 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if this.module.configure.GetHeroTalentMaxLv(_hero.HeroID) == _l {
|
if maxlv, err := this.module.configure.GetHeroTalentMaxLv(_hero.HeroID); err == nil {
|
||||||
bManAwaken = true
|
if maxlv == _l {
|
||||||
|
bManAwaken = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype121, 1, cfg.Race))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype121, 1, cfg.Race))
|
||||||
if err != nil { // 达到满级觉醒
|
if err != nil { // 达到满级觉醒
|
||||||
|
@ -215,22 +215,25 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if heroObj.Lv == maxlv {
|
if heroObj.Lv == maxlv {
|
||||||
|
if maxlv, e := this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID); e == nil {
|
||||||
if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) {
|
if maxlv == int32(len(talent.Talent)) {
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, heroObj.HeroID, cfg.Color))
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, heroObj.HeroID, cfg.Color))
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, heroObj.HeroID))
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, heroObj.HeroID))
|
||||||
iHeroId, _ := strconv.Atoi(heroObj.HeroID)
|
iHeroId, _ := strconv.Atoi(heroObj.HeroID)
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype243, heroObj.HeroID, int32(iHeroId)))
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype243, heroObj.HeroID, int32(iHeroId)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 满回响
|
// 满回响
|
||||||
if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) {
|
if maxlv, e := this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID); e == nil {
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype128, 1, cfg.Race))
|
if maxlv == int32(len(talent.Talent)) {
|
||||||
if user, err := this.module.GetUserForSession(session); err == nil {
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype128, 1, cfg.Race))
|
||||||
this.chat.SendSysChatToWorld(session, comm.ChatSystem10, heroObj, heroObj.Star, 0, user.Name, heroObj.HeroID)
|
if user, err := this.module.GetUserForSession(session); err == nil {
|
||||||
} else {
|
this.chat.SendSysChatToWorld(session, comm.ChatSystem10, heroObj, heroObj.Star, 0, user.Name, heroObj.HeroID)
|
||||||
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
} else {
|
||||||
|
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype199, 1))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype199, 1))
|
||||||
|
@ -73,8 +73,9 @@ type configureComp struct {
|
|||||||
cardPool map[string][]*cfg.GameCardPoolData
|
cardPool map[string][]*cfg.GameCardPoolData
|
||||||
|
|
||||||
// 限定英雄
|
// 限定英雄
|
||||||
wish *Replace // 许愿英雄招募
|
wish *Replace // 许愿英雄招募
|
||||||
appoint *Replace // 限定英雄招募
|
appoint *Replace // 限定英雄招募
|
||||||
|
talentlv map[string]int32 // 天赋等级
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组件初始化接口
|
// 组件初始化接口
|
||||||
@ -211,6 +212,24 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
configure.RegisterConfigure(hero_talent, cfg.NewGameHeroTalent, func() {
|
||||||
|
if v, err := this.GetConfigure(hero_talent); err == nil {
|
||||||
|
if _configure, ok := v.(*cfg.GameHeroTalent); ok {
|
||||||
|
this.hlock.Lock()
|
||||||
|
defer this.hlock.Unlock()
|
||||||
|
this.talentlv = make(map[string]int32)
|
||||||
|
for _, v := range _configure.GetDataList() {
|
||||||
|
this.talentlv[v.Hid] += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("%T no is *cfg.Game_drawCard", v)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.GetHeroTalentMaxLv("13001")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (this *configureComp) GetApportHeroReplaceConfig() *Replace {
|
func (this *configureComp) GetApportHeroReplaceConfig() *Replace {
|
||||||
@ -474,14 +493,19 @@ func (this *configureComp) GetHeroMaxLv(star int32) (maxlv int32, err error) {
|
|||||||
err = fmt.Errorf("GetHeroMaxLv err : star:%d", star)
|
err = fmt.Errorf("GetHeroMaxLv err : star:%d", star)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (this *configureComp) GetHeroTalentMaxLv(heroid string) (maxlv int32) {
|
|
||||||
if v, err := this.GetConfigure(hero_talentbox); err == nil {
|
|
||||||
if configure, ok := v.(*cfg.GameTalentBox); ok {
|
|
||||||
return int32(len(configure.GetDataList()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0
|
// 获取满共鸣的等级
|
||||||
|
func (this *configureComp) GetHeroTalentMaxLv(heroid string) (maxlv int32, err error) {
|
||||||
|
var (
|
||||||
|
ok bool
|
||||||
|
)
|
||||||
|
this.hlock.RLock()
|
||||||
|
defer this.hlock.RUnlock()
|
||||||
|
if maxlv, ok = this.talentlv[heroid]; ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = comm.NewNotFoundConfErr(moduleName, hero_talent, heroid)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// id: 1新手卡池 2 表示普通抽 3表示阵营1 4表示阵营2 ...
|
// id: 1新手卡池 2 表示普通抽 3表示阵营1 4表示阵营2 ...
|
||||||
|
@ -725,11 +725,13 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, heros []*pb.DBHero,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if this.module.configure.GetHeroTalentMaxLv(hero.HeroID) == _l {
|
if maxlv, e := this.module.configure.GetHeroTalentMaxLv(hero.HeroID); e == nil {
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, hero.HeroID, heroconf.Color))
|
if maxlv == _l {
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, hero.HeroID))
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, hero.HeroID, heroconf.Color))
|
||||||
iHeroId, _ := strconv.Atoi(hero.HeroID)
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, hero.HeroID))
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype243, hero.HeroID, int32(iHeroId)))
|
iHeroId, _ := strconv.Atoi(hero.HeroID)
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype243, hero.HeroID, int32(iHeroId)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user