From 0406fa38a1dc286b8d47f68348fe3dc1e5efdec7 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 23 Jan 2024 10:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=85=AC=E4=BC=9A=E8=BF=9C?= =?UTF-8?q?=E5=BE=81=E5=8D=8F=E8=AE=AE=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/expedition/api_uphero.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/expedition/api_uphero.go b/modules/expedition/api_uphero.go index a29387f2f..55b44209f 100644 --- a/modules/expedition/api_uphero.go +++ b/modules/expedition/api_uphero.go @@ -6,6 +6,7 @@ import ( "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "math" ) // 参数校验 @@ -24,6 +25,7 @@ func (this *apiComp) UpHero(session comm.IUserSession, req *pb.ExpeditionUpHeroR boos *pb.DBExpeditionBoos heros []*pb.DBHero condition []int32 + addpwaer int32 err error ) if errdata = this.UpHeroCheck(session, req); errdata != nil { @@ -112,6 +114,19 @@ func (this *apiComp) UpHero(session comm.IUserSession, req *pb.ExpeditionUpHeroR member.Totalpower += v.Fightvalue } + if condition[0] >= conf.Race[1] { + addpwaer += conf.Fight + } + if condition[1] >= conf.Job[1] { + addpwaer += conf.Fight + } + if condition[2] >= int32(len(conf.Hid)) { + addpwaer += conf.Fight + } + if condition[3] >= conf.Color[1] { + addpwaer += conf.Fight + } + member.Totalpower = member.Totalpower + int32(math.Floor(float64(member.Totalpower)*float64(addpwaer)/float64(1000))) boos.Members[session.GetUserId()] = member if err = this.module.model.updateExpedition(info); err != nil { errdata = &pb.ErrorData{