增加c4w模式初始场地情况

This commit is contained in:
MrZ626
2020-12-31 14:53:10 +08:00
parent 00c511b4e9
commit f6b613ee17
2 changed files with 32 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
local min=math.min local rnd,min=math.random,math.min
local rem=table.remove
local function check_c4w(P) local function check_c4w(P)
if P.lastPiece.row==0 then if P.lastPiece.row==0 then
P:lose() P:lose()
@@ -35,13 +36,20 @@ return{
P.visTime[i]=FREEROW.get(20) P.visTime[i]=FREEROW.get(20)
for x=4,7 do F[i][x]=0 end for x=4,7 do F[i][x]=0 end
end end
local r=P:RND(6) if rnd()<.6 then
if r==1 then F[1][5],F[1][4],F[2][4]=20,20,20 local initCell={11,14,12,13,21,24}
elseif r==2 then F[1][6],F[1][7],F[2][7]=20,20,20 for _=1,3 do
elseif r==3 then F[1][4],F[2][4],F[2][5]=20,20,20 _=rem(initCell,rnd(#initCell))
elseif r==4 then F[1][7],F[2][7],F[2][6]=20,20,20 F[math.floor(_/10)][3+_%10]=20
elseif r==5 then F[1][4],F[1][5],F[1][6]=20,20,20 end
elseif r==6 then F[1][7],F[1][6],F[1][5]=20,20,20 else
local initCell={11,12,13,14,21,22,23,24}
rem(initCell,rnd(5,8))
rem(initCell,rnd(1,4))
for _=1,6 do
_=rem(initCell,rnd(#initCell))
F[math.floor(_/10)][3+_%10]=20
end
end end
end, end,
mesDisp=function(P) mesDisp=function(P)

View File

@@ -1,4 +1,5 @@
local min=math.min local rnd,min=math.random,math.min
local rem=table.remove
local function check_c4w(P) local function check_c4w(P)
if P.lastPiece.row>0 then if P.lastPiece.row>0 then
for _=1,#P.clearedRow do for _=1,#P.clearedRow do
@@ -33,13 +34,20 @@ return{
P.visTime[i]=FREEROW.get(20) P.visTime[i]=FREEROW.get(20)
for x=4,7 do F[i][x]=0 end for x=4,7 do F[i][x]=0 end
end end
local r=P:RND(6) if rnd()<.6 then
if r==1 then F[1][5],F[1][4],F[2][4]=20,20,20 local initCell={11,14,12,13,21,24}
elseif r==2 then F[1][6],F[1][7],F[2][7]=20,20,20 for _=1,3 do
elseif r==3 then F[1][4],F[2][4],F[2][5]=20,20,20 _=rem(initCell,rnd(#initCell))
elseif r==4 then F[1][7],F[2][7],F[2][6]=20,20,20 F[math.floor(_/10)][3+_%10]=20
elseif r==5 then F[1][4],F[1][5],F[1][6]=20,20,20 end
elseif r==6 then F[1][7],F[1][6],F[1][5]=20,20,20 else
local initCell={11,12,13,14,21,22,23,24}
rem(initCell,rnd(5,8))
rem(initCell,rnd(1,4))
for _=1,6 do
_=rem(initCell,rnd(#initCell))
F[math.floor(_/10)][3+_%10]=20
end
end end
end, end,
mesDisp=function(P) mesDisp=function(P)