From 78154eca10e7fc33fc68c1e3cb658412aba7a5c5 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 27 Oct 2020 23:50:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=8C=E7=9A=84=E7=A7=8D=E7=B1=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E6=A0=87=E7=AD=BE=EF=BC=8C=E4=B8=BA=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=82=B8=E5=BC=B9=E5=9E=83=E5=9C=BE=E8=A1=8C=E5=81=9A=E5=87=86?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modes/custom_clear.lua | 2 +- parts/freeRow.lua | 3 ++- parts/player.lua | 17 +++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/modes/custom_clear.lua b/modes/custom_clear.lua index 4d3f76ee..231cc1da 100644 --- a/modes/custom_clear.lua +++ b/modes/custom_clear.lua @@ -41,7 +41,7 @@ return{ for _,P in next,PLAYERS.alive do local t=P.showTime*3 for y=1,FIELD.h do - P.field[y]=freeRow.get(0) + P.field[y]=freeRow.get(0,0) P.visTime[y]=freeRow.get(t) for x=1,10 do P.field[y][x]=FIELD[y][x]end end diff --git a/parts/freeRow.lua b/parts/freeRow.lua index a67a25e8..e09aea88 100644 --- a/parts/freeRow.lua +++ b/parts/freeRow.lua @@ -13,7 +13,7 @@ function freeRow.reset(num) end _=num end -function freeRow.get(val) +function freeRow.get(val,type)--type: nil=norm, 0=garbage, 1=bomb if _==0 then for i=1,10 do L[i]={0,0,0,0,0,0,0,0,0,0} @@ -22,6 +22,7 @@ function freeRow.get(val) end local t=L[_] for i=1,10 do t[i]=val end + t[11]=type L[_]=nil _=_-1 return t diff --git a/parts/player.lua b/parts/player.lua index 640d9667..dc980681 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -1595,7 +1595,7 @@ function player.garbageRise(P,color,amount,pos) local _ local t=P.showTime*2 for _=1,amount do - ins(P.field,1,freeRow.get(color)) + ins(P.field,1,freeRow.get(color,0)) ins(P.visTime,1,freeRow.get(t)) P.field[1][pos]=0 end @@ -1622,8 +1622,9 @@ end local invList={2,1,4,3,5,6,7} function player.pushLine(P,L,mir) + local l=#L local S=P.gameEnv.skin - for i=1,#L do + for i=1,l do local r=freeRow.get(0) if not mir then for j=1,10 do @@ -1637,9 +1638,9 @@ function player.pushLine(P,L,mir) ins(P.field,1,r) ins(P.visTime,1,freeRow.get(20)) end - P.fieldBeneath=P.fieldBeneath+120 - P.curY=P.curY+#L - P.imgY=P.imgY+#L + P.fieldBeneath=P.fieldBeneath+30*l + P.curY=P.curY+l + P.imgY=P.imgY+l P:freshBlock(false,false) end function player.pushNext(P,L,mir) @@ -2181,12 +2182,12 @@ do--player.drop(P)--Place piece if cc>0 then for i=cc,1,-1 do _=P.clearedRow[i] - freeRow.discard(rem(P.field,_)) - freeRow.discard(rem(P.visTime,_)) - if _<=P.garbageBeneath then + if P.field[_][11]then P.garbageBeneath=P.garbageBeneath-1 gbcc=gbcc+1 end + freeRow.discard(rem(P.field,_)) + freeRow.discard(rem(P.visTime,_)) end end