再优化玩家的cancel方法
This commit is contained in:
@@ -795,23 +795,21 @@ function Player.popNext(P,ifhold)--Pop nextQueue to hand
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Player.cancel(P,N)--Cancel Garbage
|
function Player.cancel(P,N)--Cancel Garbage
|
||||||
local off=0 --Lines offseted
|
local off=0--Lines offseted
|
||||||
local bf=P.atkBuffer
|
local bf=P.atkBuffer
|
||||||
for _, A in ipairs(bf) do
|
for i=1,#bf do
|
||||||
if bf.sum <= 0 then break end
|
if bf.sum==0 or N==0 then break end
|
||||||
|
local A=bf[i]
|
||||||
if not A.sent then
|
if not A.sent then
|
||||||
local O = min(A.amount, N) -- Cur Offset
|
local O=min(A.amount,N)--Cur Offset
|
||||||
off, bf.sum = off + O, bf.sum - O
|
if N<A.amount then
|
||||||
if N >= A.amount then
|
A.amount=A.amount-O
|
||||||
A.sent, A.time = true, 0
|
|
||||||
else
|
else
|
||||||
A.amount = A.amount - O
|
A.sent,A.time=true,0
|
||||||
end
|
|
||||||
if N <= A.amount then
|
|
||||||
break
|
|
||||||
else
|
|
||||||
N = N - O
|
|
||||||
end
|
end
|
||||||
|
off=off+O
|
||||||
|
bf.sum=bf.sum-O
|
||||||
|
N=N-O
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return off
|
return off
|
||||||
@@ -1147,7 +1145,7 @@ do--Player.drop(P)--Place piece
|
|||||||
piece.spin,piece.mini=dospin,false
|
piece.spin,piece.mini=dospin,false
|
||||||
piece.pc,piece.hpc=false,false
|
piece.pc,piece.hpc=false,false
|
||||||
piece.special=false
|
piece.special=false
|
||||||
if cc>0 then--If lines cleared, about 200 lines below
|
if cc>0 then--If lines cleared,about 200 lines below
|
||||||
cmb=cmb+1
|
cmb=cmb+1
|
||||||
if dospin then
|
if dospin then
|
||||||
cscore=(spinSCR[C.name]or spinSCR[8])[cc]
|
cscore=(spinSCR[C.name]or spinSCR[8])[cc]
|
||||||
@@ -1226,7 +1224,7 @@ do--Player.drop(P)--Place piece
|
|||||||
VOC.play(clearVoice[cc],CHN)
|
VOC.play(clearVoice[cc],CHN)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Normal clear, reduce B2B point
|
--Normal clear,reduce B2B point
|
||||||
if not piece.special then
|
if not piece.special then
|
||||||
P.b2b=max(P.b2b-250,0)
|
P.b2b=max(P.b2b-250,0)
|
||||||
if P.b2b<50 and ENV.b2bKill then
|
if P.b2b<50 and ENV.b2bKill then
|
||||||
|
|||||||
Reference in New Issue
Block a user