From 081e8af05093731cc77b66f360f0021b27dc243e Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 5 Feb 2024 16:49:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?check=20=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/mainline/api_setpolts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mainline/api_setpolts.go b/modules/mainline/api_setpolts.go index 255a6cc92..e2b7cff06 100644 --- a/modules/mainline/api_setpolts.go +++ b/modules/mainline/api_setpolts.go @@ -6,7 +6,7 @@ import ( ) // 参数校验 -func (this *apiComp) CheckSetPolts(session comm.IUserSession, req *pb.MainlineSetPoltsReq) (errdata *pb.ErrorData) { +func (this *apiComp) SetPoltsCheck(session comm.IUserSession, req *pb.MainlineSetPoltsReq) (errdata *pb.ErrorData) { return } @@ -16,7 +16,7 @@ func (this *apiComp) SetPolts(session comm.IUserSession, req *pb.MainlineSetPolt info *pb.DBMainline err error ) - if errdata = this.CheckSetPolts(session, req); errdata != nil { + if errdata = this.SetPoltsCheck(session, req); errdata != nil { return // 参数校验失败直接返回 } From f75160a571242799355498c11f97fb1db0cbd8fb Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 5 Feb 2024 17:25:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=89=E6=B6=88=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=8A=80=E8=83=BD=E8=A7=84=E5=88=99=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20=E5=88=B7=E6=96=B0=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=8F=AF=E6=B6=88=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/room.go | 18 ++++++++++++++---- modules/entertainment/xxlPlat.go | 25 ++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index 8e19d3eee..64a4e2cba 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -1002,6 +1002,7 @@ func (this *Room) UserCardSkill(curPlayer *pb.PlayerData, color int32, skillid s conf *cfg.GamePlayerSkillData err error szMap []*pb.MapData + bAddps bool ) if curid >= int32(len(this.chessboard.Plat)) { return @@ -1018,10 +1019,7 @@ func (this *Room) UserCardSkill(curPlayer *pb.PlayerData, color int32, skillid s if conf.Skilltouch == 101 { // 技能类型为1 szMap = this.chessboard.HitElem(color, curid) } else if conf.Skilltouch == 102 { - this.chessboard.ShuffleElem() - szMap = append(szMap, &pb.MapData{ - Data: this.chessboard.Plat, - }) + szMap, bAddps = this.chessboard.ShuffleElem() } else if conf.Skilltouch == 103 { this.chessboard.HitCrossElem(color, curid) // 消除十字 szMap = append(szMap, &pb.MapData{ @@ -1035,11 +1033,23 @@ func (this *Room) UserCardSkill(curPlayer *pb.PlayerData, color int32, skillid s v.CurSocre = this.player1.Score this.player1.Energy += v.CurEnergy v.CurEnergy = this.player1.Energy + if bAddps { + this.player1.Ps++ + if this.player1.Ps > 2 { + this.player1.Ps = 2 + } + } } else { this.player2.Score += v.CurSocre v.CurSocre = this.player2.Score this.player2.Energy += v.CurEnergy v.CurEnergy = this.player2.Energy + if bAddps { + this.player2.Ps++ + if this.player2.Ps > 2 { + this.player2.Ps = 2 + } + } } v.ChangeType = 1 } diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index 93b6562d0..48c4a1abd 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -1143,8 +1143,9 @@ func (this *MapData) HitElem(color int32, curid int32) (szMap []*pb.MapData) { return } -func (this *MapData) ShuffleElem() { - +// 刷新 +func (this *MapData) ShuffleElem() (szMap []*pb.MapData, bAddPs bool) { + var () for i := 0; i < Total; i++ { n1, _ := rand.Int(rand.Reader, big.NewInt(Total)) newId := n1.Int64() @@ -1155,7 +1156,25 @@ func (this *MapData) ShuffleElem() { this.Plat[i] = tmp } } - this.SetIndelibilityPlat() + szMap = append(szMap, &pb.MapData{ + Data: this.GetPalatData(), + }) + for { + if b := this.Check3X(); b { + if sz, b := this.CheckMap(0, false); len(sz) == 0 { + break + } else { + if b { + bAddPs = true + } + szMap = append(szMap, sz...) + } + } else { + break + } + } + return + //this.SetIndelibilityPlat() } func (this *MapData) HitCrossElem(color int32, curid int32) (szMap []*pb.MapData) {