From 7c33752262cf4229e2711209c601a90a3921491a Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 24 Mar 2023 17:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/practice/api_receive.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/practice/api_receive.go b/modules/practice/api_receive.go index baea789ba..b1eea4002 100644 --- a/modules/practice/api_receive.go +++ b/modules/practice/api_receive.go @@ -2,6 +2,7 @@ package practice import ( "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" @@ -101,7 +102,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR exp = minutes * pillarconfigure.MinExp } exp1 += exp - + this.module.Debug("基础经验加成", log.Field{Key: "minutes", Value: minutes}, log.Field{Key: "minExp", Value: pillarconfigure.MinExp}, log.Field{Key: "exp1", Value: exp1}) //满级英雄加层 for k, v := range room.Full { if v > 0 { @@ -112,7 +113,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR if heroconf := this.module.configure.GetHeroConfig(hero.HeroID); heroconf != nil { if (conf.Camp == 0 || (conf.Camp != 0 && heroconf.Race == conf.Camp)) && (conf.Occupation == 0 || (conf.Occupation != 0 && heroconf.Job == conf.Occupation)) { // exp1 += int32(math.Floor(float64(v/conf.Register) * float64(conf.ExpBonus) / float64(100) * float64(exp))) - exp1 += minutes * int32(math.Floor(float64(v/conf.Register)*float64(conf.ExpBonus))) * exp + exp1 += minutes * int32(math.Floor(float64(v/conf.Register)*float64(conf.ExpBonus))) + this.module.Debug("满级英雄加成", log.Field{Key: "num", Value: v}, log.Field{Key: "Register", Value: conf.Register}, log.Field{Key: "exp1", Value: exp1}) } } } @@ -126,6 +128,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR if tconfigure != nil { if tconfigure.Exp > 0 { //经验加成 exp1 += int32(math.Floor(float64(exp) * (float64(tconfigure.Exp) / float64(100)))) + this.module.Debug("教习经验加成", log.Field{Key: "exp", Value: exp}, log.Field{Key: "tcExp", Value: tconfigure.Exp}, log.Field{Key: "exp1", Value: exp1}) } if len(tconfigure.Ants) > 0 { //额外道具加成 ants1 = make([]*cfg.Gameatn, 0) @@ -167,6 +170,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR if pconfigure != nil { if pconfigure.Exp > 0 { //经验加成 exp1 += int32(math.Floor(float64(exp) * (float64(pconfigure.Exp) / float64(100)))) + this.module.Debug("道具经验加成", log.Field{Key: "exp", Value: exp}, log.Field{Key: "tcExp", Value: pconfigure.Exp}, log.Field{Key: "exp1", Value: exp1}) } if len(pconfigure.Ants) > 0 { //额外道具加成 ants2 = make([]*cfg.Gameatn, 0) @@ -205,7 +209,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR } } } - + this.module.Debug("最终经验加成", log.Field{Key: "exp", Value: exp}, log.Field{Key: "exp1", Value: exp1}) if _, code = this.module.ModuleHero.AddHeroExp(session, pillar.Hero, exp1); code != pb.ErrorCode_Success { return }