重构模式环境的dropPiece和task事件为更强大的自定义和未来联网任意模式做准备
整理出所有模式的这两个事件独立到一个文件夹并整理所有模式引用它们的方式 警告:很可能有错误,需要他人帮助测试
This commit is contained in:
27
parts/eventsets/c4wBase.lua
Normal file
27
parts/eventsets/c4wBase.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
local rem=table.remove
|
||||
|
||||
return{
|
||||
task=function(P)
|
||||
local F=P.field
|
||||
for i=1,24 do
|
||||
F[i]=FREEROW.get(20)
|
||||
P.visTime[i]=FREEROW.get(20)
|
||||
for x=4,7 do F[i][x]=0 end
|
||||
end
|
||||
if P.holeRND:random()<.6 then
|
||||
local initCell={11,14,12,13,21,24}
|
||||
for _=1,3 do
|
||||
_=rem(initCell,P.holeRND:random(#initCell))
|
||||
F[math.floor(_/10)][3+_%10]=20
|
||||
end
|
||||
else
|
||||
local initCell={11,12,13,14,21,22,23,24}
|
||||
rem(initCell,P.holeRND:random(5,8))
|
||||
rem(initCell,P.holeRND:random(1,4))
|
||||
for _=1,6 do
|
||||
_=rem(initCell,P.holeRND:random(#initCell))
|
||||
F[math.floor(_/10)][3+_%10]=20
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user