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] =?UTF-8?q?=E4=B8=89=E6=B6=88=E5=9C=B0=E5=9B=BE=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=8A=80=E8=83=BD=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4?= =?UTF-8?q?=20=E5=88=B7=E6=96=B0=E7=94=9F=E6=88=90=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=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) {