From 6ff10679b982642fa593b61849239f9f2cf436b8 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Tue, 7 May 2024 19:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=94=E6=B3=A1=E6=B7=BB=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E5=B1=80=E5=86=85=E9=A2=9C=E8=89=B2=E6=B1=A0=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E9=80=89=E9=A1=B9=EF=BC=88=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=A0=87=E5=87=86=E4=BA=94=E8=89=B2=E9=87=8C?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E5=9B=9B=E8=89=B2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zenitha | 2 +- assets/game/puyoPlayer.lua | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Zenitha b/Zenitha index e8ac3fe1..0d111010 160000 --- a/Zenitha +++ b/Zenitha @@ -1 +1 @@ -Subproject commit e8ac3fe14de66cf19a1e67258ed438320c5d4993 +Subproject commit 0d1110102c3101fe42a8c2cd9a7dbcf3c9b125ac diff --git a/assets/game/puyoPlayer.lua b/assets/game/puyoPlayer.lua index 7f0afa5f..0de1131a 100644 --- a/assets/game/puyoPlayer.lua +++ b/assets/game/puyoPlayer.lua @@ -460,6 +460,13 @@ function PP:decreaseNextColor(maxLength,maxColor) -- print('Merged color '..orig..' to '..dest) end end +function PP:shuffleColor(n) + local list=self.settings.colorSet + for i=n,2,-1 do + local r=self:random(i) + list[i],list[r]=list[r],list[i] + end +end function PP:popNext() if self.nextQueue[1] then -- Most cases there is pieces in next queue self.hand=rem(self.nextQueue,1) @@ -1297,6 +1304,10 @@ local baseEnv={ voidH=16, connH=12, -- Default to 12 + -- Color + colorSet='classic', ---@type string|table + colorShuffleRange=5, + -- Clear clearGroupSize=4, @@ -1349,7 +1360,6 @@ local baseEnv={ freshLockInASP=true, -- Other - colorSet='classic', ---@type string|table script=false, IRSpushUp=true, skin='puyo_jelly', @@ -1411,6 +1421,8 @@ function PP:initialize() self.settings.colorSet=mechLib.puyo.colorSet[self.settings.colorSet] end assert(type(self.settings.colorSet)=='table',"Invalid P.settings.colorSet") + self.settings.colorSet=TABLE.shift(self.settings.colorSet) + self:shuffleColor(self.settings.colorShuffleRange) self.field=require'rectField'.new(self.settings.fieldW) self.clearingGroups={}