From 8ceff434d69af9ef8a0fa7940e2abb59b74d3657 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 26 Oct 2022 18:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=81=B5=E5=8D=87=E6=98=9F=20bug=20?= =?UTF-8?q?=E5=A4=A9=E8=B5=8B=E7=82=B9=E6=95=B0=E6=B6=88=E8=80=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_herostarup.json | 36 +++++++++++++++++++++++++++- modules/hero/api_strengthenUpStar.go | 5 ++-- modules/hero/api_talentlearn.go | 4 ++-- modules/hero/configure_comp.go | 2 +- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/bin/json/game_herostarup.json b/bin/json/game_herostarup.json index eb7f325ae..6daf0b5bb 100644 --- a/bin/json/game_herostarup.json +++ b/bin/json/game_herostarup.json @@ -593,6 +593,23 @@ { "key": 39, "id": "43901", + "star": 3, + "needhero": "", + "needherostar": 0, + "needheronum": 0, + "needrace": [ + 1, + 2, + 3, + 4 + ], + "needracestar": 3, + "needracenum": 3, + "gold": 10000 + }, + { + "key": 40, + "id": "43902", "star": 4, "needhero": "", "needherostar": 0, @@ -608,7 +625,24 @@ "gold": 10000 }, { - "key": 40, + "key": 41, + "id": "43901", + "star": 4, + "needhero": "", + "needherostar": 0, + "needheronum": 0, + "needrace": [ + 1, + 2, + 3, + 4 + ], + "needracestar": 4, + "needracenum": 4, + "gold": 10000 + }, + { + "key": 42, "id": "43902", "star": 5, "needhero": "", diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index 1aa785bf9..9583fdbcc 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -56,8 +56,9 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr code = pb.ErrorCode_ReqParameterError return } + heroConf := this.module.configure.GetHeroConfig(_hero.HeroID) nextHeroConfig := this.module.configure.GetHeroStarupConfig(_hero.HeroID, _hero.Star+1) - if nextHeroConfig == nil { + if nextHeroConfig == nil && heroConf.Type != comm.CardTypeStar { code = pb.ErrorCode_HeroMaxStarLv return } @@ -142,7 +143,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr "sameCount": 1, "isOverlying": false, } - heroConf := this.module.configure.GetHeroConfig(_hero.HeroID) + if heroConf != nil && heroConf.Type == comm.CardTypeStar { // 升星卡升星 修改heroid hid := this.module.configure.GetHeroSpriteStar(_hero.HeroID) if hid != "" { diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 8cbb46f6a..d526a9ace 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -96,12 +96,12 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe if code = this.module.CheckRes(session, []*cfg.Gameatn{res}); code != pb.ErrorCode_Success { return } else { - if code = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success { + if code = this.module.ConsumeRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success { return } } } - if code = this.module.DispenseRes(session, talentConf.Thing, true); code != pb.ErrorCode_Success { + if code = this.module.ConsumeRes(session, talentConf.Thing, true); code != pb.ErrorCode_Success { return } diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 0cb47011c..bb186256e 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -400,7 +400,7 @@ func (this *configureComp) GetHeroFucionConfig(cid string) (data *cfg.GameHerofu func (this *configureComp) GetHeroSpriteStar(cid string) (hid string) { if v, err := this.GetConfigure(hero_starupsp); err == nil { - if configure, ok := v.(*cfg.GameHeroStarupSp); !ok { + if configure, ok := v.(*cfg.GameHeroStarupSp); ok { hid = configure.Get(cid).Starid return }