修复对战和stack_e中hold致死但没有完全死的时候下一块悬空导致的幽灵行

This commit is contained in:
MrZ_26
2023-04-24 00:48:17 +08:00
parent fe29cc532d
commit 43046a3cf3
2 changed files with 15 additions and 13 deletions

View File

@@ -26,6 +26,7 @@ return {
P.garbageBeneath=P.garbageBeneath-bonus P.garbageBeneath=P.garbageBeneath-bonus
end end
end end
P:freshBlock('push')
end end
end, end,
} }

View File

@@ -11,7 +11,7 @@ local resume,yield,status=coroutine.resume,coroutine.yield,coroutine.status
local approach=MATH.expApproach local approach=MATH.expApproach
local SFX,BGM,VOC,VIB,SYSFX=SFX,BGM,VOC,VIB,SYSFX local SFX,BGM,VOC,VIB,SYSFX=SFX,BGM,VOC,VIB,SYSFX
local FREEROW,TABLE,TEXT,TASK=LINE,TABLE,TEXT,TASK local LINE,TABLE,TEXT,TASK=LINE,TABLE,TEXT,TASK
local PLAYERS,PLY_ALIVE,GAME=PLAYERS,PLY_ALIVE,GAME local PLAYERS,PLY_ALIVE,GAME=PLAYERS,PLY_ALIVE,GAME
local SETTING=SETTING local SETTING=SETTING
@@ -721,8 +721,8 @@ function Player:garbageRise(color,amount,line)-- Release n-lines garbage to fiel
local _ local _
local t=self.showTime*2 local t=self.showTime*2
for _=1,amount do for _=1,amount do
ins(self.field,1,FREEROW.new(0,true)) ins(self.field,1,LINE.new(0,true))
ins(self.visTime,1,FREEROW.new(t)) ins(self.visTime,1,LINE.new(t))
for i=1,10 do for i=1,10 do
self.field[1][i]=bit.rshift(line,i-1)%2==1 and color or 0 self.field[1][i]=bit.rshift(line,i-1)%2==1 and color or 0
end end
@@ -760,7 +760,7 @@ function Player:pushLineList(L,mir)-- Push some lines to field
local l=#L local l=#L
local S=self.gameEnv.skin local S=self.gameEnv.skin
for i=1,l do for i=1,l do
local r=FREEROW.new(0) local r=LINE.new(0)
if not mir then if not mir then
for j=1,10 do for j=1,10 do
r[j]=S[L[i][j]] or 0 r[j]=S[L[i][j]] or 0
@@ -771,7 +771,7 @@ function Player:pushLineList(L,mir)-- Push some lines to field
end end
end end
ins(self.field,1,r) ins(self.field,1,r)
ins(self.visTime,1,FREEROW.new(20)) ins(self.visTime,1,LINE.new(20))
end end
self.fieldBeneath=self.fieldBeneath+30*l self.fieldBeneath=self.fieldBeneath+30*l
if self.cur then if self.cur then
@@ -1010,8 +1010,8 @@ function Player:lock()
for i=1,#CB do for i=1,#CB do
local y=self.curY+i-1 local y=self.curY+i-1
if not self.field[y] then if not self.field[y] then
self.field[y]=FREEROW.new(0) self.field[y]=LINE.new(0)
self.visTime[y]=FREEROW.new(0) self.visTime[y]=LINE.new(0)
end end
for j=1,#CB[1] do for j=1,#CB[1] do
if CB[i][j] then if CB[i][j] then
@@ -1079,8 +1079,8 @@ function Player:_removeClearedLines()
if self.field[h].garbage then if self.field[h].garbage then
self.garbageBeneath=self.garbageBeneath-1 self.garbageBeneath=self.garbageBeneath-1
end end
FREEROW.discard(rem(self.field,h)) LINE.discard(rem(self.field,h))
FREEROW.discard(rem(self.visTime,h)) LINE.discard(rem(self.visTime,h))
end end
end end
function Player:_updateFalling(val) function Player:_updateFalling(val)
@@ -2196,8 +2196,8 @@ local function task_lose(self)
end end
if self.endCounter==120 then if self.endCounter==120 then
for _=#self.field,1,-1 do for _=#self.field,1,-1 do
FREEROW.discard(self.field[_]) LINE.discard(self.field[_])
FREEROW.discard(self.visTime[_]) LINE.discard(self.visTime[_])
self.field[_],self.visTime[_]=nil self.field[_],self.visTime[_]=nil
end end
return return
@@ -2763,8 +2763,8 @@ end
function Player:revive() function Player:revive()
local h=#self.field local h=#self.field
for _=h,1,-1 do for _=h,1,-1 do
FREEROW.discard(self.field[_]) LINE.discard(self.field[_])
FREEROW.discard(self.visTime[_]) LINE.discard(self.visTime[_])
self.field[_],self.visTime[_]=nil self.field[_],self.visTime[_]=nil
end end
self.garbageBeneath=0 self.garbageBeneath=0
@@ -2777,6 +2777,7 @@ function Player:revive()
self.life=self.life-1 self.life=self.life-1
self.fieldBeneath=0 self.fieldBeneath=0
self.b2b=0 self.b2b=0
self:freshBlock('push')
for i=1,h do for i=1,h do
self:createClearingFX(i) self:createClearingFX(i)