Skip to content

Commit

Permalink
气泡添加单局内颜色池部分随机选项(用于实现标准五色里随机四色)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed May 7, 2024
1 parent 80d6de8 commit 6ff1067
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Zenitha
Submodule Zenitha updated 1 files
+10 −0 tableExtend.lua
14 changes: 13 additions & 1 deletion assets/game/puyoPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1297,6 +1304,10 @@ local baseEnv={
voidH=16,
connH=12, -- Default to 12

-- Color
colorSet='classic', ---@type string|table
colorShuffleRange=5,

-- Clear
clearGroupSize=4,

Expand Down Expand Up @@ -1349,7 +1360,6 @@ local baseEnv={
freshLockInASP=true,

-- Other
colorSet='classic', ---@type string|table
script=false,
IRSpushUp=true,
skin='puyo_jelly',
Expand Down Expand Up @@ -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={}
Expand Down

0 comments on commit 6ff1067

Please sign in to comment.