From 866dc7ef3bd0572e45be80f37641b548de680d54 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 12 Jan 2024 11:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E6=B6=88=20=E5=B0=86=E9=9A=8F?= =?UTF-8?q?=E6=9C=BA6=E4=B8=AA=E5=AE=9D=E7=9F=B3=E6=9F=93=E6=88=90?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=9B=98=E9=9D=A2=E4=B8=8A=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E6=9C=80=E5=A4=9A=E7=9A=84=E5=AE=9D=E7=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/xxlPlat.go | 26 +++++++++++++++++++++++--- modules/pagoda/api_getrace.go | 20 +++++++++++--------- modules/pagoda/api_racechallenge.go | 2 +- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index a2ca566da..62ba61c42 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -731,6 +731,15 @@ func (this *MapData) SkillUp(pos int32, color int32, skillid int32, value int32, } case 3: // 将随机6个宝石染成当前盘面上颜色最多的宝石 this.SkillChangeColor(value) + bDrop = false + szMap = append(szMap, &pb.MapData{ + Data: this.GetPalatData(), + CurSocre: skillScore, + CurEnergy: skillEnergy, + }) + if list, _ := this.CheckMap(color, false); len(list) > 0 { + szMap = append(szMap, list...) + } case 4: x := int(pos / Width) y := int(pos % Height) @@ -1488,9 +1497,15 @@ func (this *MapData) SkillChangeColor(count int32) { elemCount[v.Color] += 1 } - for k := range elemCount { - if color < k { + for _, v := range elemCount { + if color < v { + color = v + } + } + for k, v := range elemCount { + if color == v { color = k + break } } for i := 0; i < int(count); i++ { @@ -1498,7 +1513,12 @@ func (this *MapData) SkillChangeColor(count int32) { if this.Plat[targetId].Color == color { i-- } else { - this.Plat[targetId].Color = color // 变更颜色 + if this.Plat[targetId].Special == 0 { + this.Plat[targetId].Color = color // 变更颜色 + this.Plat[targetId].Cid = color // 变更颜色 + this.oid++ + this.Plat[targetId].Oid = this.oid // 变唯一id + } } } return diff --git a/modules/pagoda/api_getrace.go b/modules/pagoda/api_getrace.go index a377c3c3f..5e1a0a678 100644 --- a/modules/pagoda/api_getrace.go +++ b/modules/pagoda/api_getrace.go @@ -21,7 +21,7 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq err error update map[string]interface{} ) - update = make(map[string]interface{}, 0) + list, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ @@ -33,20 +33,22 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq } if !utils.IsToday(list.Rtime) { + update = make(map[string]interface{}, 0) list.Rtime = configure.Now().Unix() list.Battlecount = 0 update["battlecount"] = list.Battlecount update["rtime"] = list.Rtime - } - - if err = this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), update); err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), + if err = this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), update); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } } } - session.SendMsg(string(this.module.GetType()), PagodaGetRaceResp, &pb.PagodaGetRaceResp{}) + session.SendMsg(string(this.module.GetType()), PagodaGetRaceResp, &pb.PagodaGetRaceResp{ + Data: list, + }) return } diff --git a/modules/pagoda/api_racechallenge.go b/modules/pagoda/api_racechallenge.go index 0238abe84..c38a5815b 100644 --- a/modules/pagoda/api_racechallenge.go +++ b/modules/pagoda/api_racechallenge.go @@ -73,7 +73,7 @@ func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChal } if _, ok := pagoda.Data[conf.Floors]; !ok { - if pagoda.Maxfloor != conf.Floors+1 { + if pagoda.Maxfloor+1 != conf.Floors { errdata = &pb.ErrorData{ // 挑战关卡数据不匹配 Code: pb.ErrorCode_PagodaLevlErr, Title: pb.ErrorCode_PagodaLevlErr.ToString(),