整理代码,freshTime改为倒计时,修复hold后锁延刷新次数错误问题
This commit is contained in:
@@ -443,7 +443,7 @@ function draw.norm(P)
|
|||||||
gc.rectangle("fill",0,602,300*P.lockDelay/ENV.lock,6)--Lock delay indicator
|
gc.rectangle("fill",0,602,300*P.lockDelay/ENV.lock,6)--Lock delay indicator
|
||||||
end
|
end
|
||||||
local x=3
|
local x=3
|
||||||
for _=1,min(ENV.freshLimit-P.freshTime,15)do
|
for _=1,min(P.freshTime,15)do
|
||||||
gc.rectangle("fill",x,615,14,5)
|
gc.rectangle("fill",x,615,14,5)
|
||||||
x=x+20
|
x=x+20
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
|
|||||||
P._20G=ENV.drop==0
|
P._20G=ENV.drop==0
|
||||||
P.dropDelay=ENV.drop
|
P.dropDelay=ENV.drop
|
||||||
P.lockDelay=ENV.lock
|
P.lockDelay=ENV.lock
|
||||||
|
P.freshTime=ENV.freshLimit
|
||||||
|
|
||||||
P.color={}
|
P.color={}
|
||||||
for _=1,7 do
|
for _=1,7 do
|
||||||
|
|||||||
@@ -381,9 +381,9 @@ function Player.freshBlock(P,keepGhost,control,system)
|
|||||||
if control then
|
if control then
|
||||||
if ENV.easyFresh then
|
if ENV.easyFresh then
|
||||||
local d0=ENV.lock
|
local d0=ENV.lock
|
||||||
if P.lockDelay<d0 and P.freshTime<ENV.freshLimit then
|
if P.lockDelay<d0 and P.freshTime>0 then
|
||||||
if not system then
|
if not system then
|
||||||
P.freshTime=P.freshTime+1
|
P.freshTime=P.freshTime-1
|
||||||
end
|
end
|
||||||
P.lockDelay=d0
|
P.lockDelay=d0
|
||||||
P.dropDelay=ENV.drop
|
P.dropDelay=ENV.drop
|
||||||
@@ -396,8 +396,8 @@ function Player.freshBlock(P,keepGhost,control,system)
|
|||||||
else
|
else
|
||||||
if P.curY<P.minY then
|
if P.curY<P.minY then
|
||||||
P.minY=P.curY
|
P.minY=P.curY
|
||||||
if P.lockDelay<ENV.lock and P.freshTime<ENV.freshLimit then
|
if P.lockDelay<ENV.lock and P.freshTime>0 then
|
||||||
P.freshTime=P.freshTime+1
|
P.freshTime=P.freshTime-1
|
||||||
P.dropDelay=ENV.drop
|
P.dropDelay=ENV.drop
|
||||||
P.lockDelay=ENV.lock
|
P.lockDelay=ENV.lock
|
||||||
end
|
end
|
||||||
@@ -500,7 +500,7 @@ function Player.spin(P,d,ifpre)
|
|||||||
end
|
end
|
||||||
for test=1,#iki do
|
for test=1,#iki do
|
||||||
local x,y=ix+iki[test][1],iy+iki[test][2]
|
local x,y=ix+iki[test][1],iy+iki[test][2]
|
||||||
if not P:ifoverlap(icb,x,y)and(P.freshTime<=P.gameEnv.freshLimit or iki[test][2]<0)then
|
if not P:ifoverlap(icb,x,y)and(P.freshTime>=0 or iki[test][2]<0)then
|
||||||
ix,iy=x,y
|
ix,iy=x,y
|
||||||
if P.gameEnv.moveFX and P.gameEnv.block then
|
if P.gameEnv.moveFX and P.gameEnv.block then
|
||||||
P:createMoveFX()
|
P:createMoveFX()
|
||||||
@@ -513,7 +513,7 @@ function Player.spin(P,d,ifpre)
|
|||||||
P:freshBlock(false,true)
|
P:freshBlock(false,true)
|
||||||
end
|
end
|
||||||
if iki[test][2]>0 and not P.gameEnv.easyFresh then
|
if iki[test][2]>0 and not P.gameEnv.easyFresh then
|
||||||
P.freshTime=P.freshTime+1
|
P.freshTime=P.freshTime-1
|
||||||
end
|
end
|
||||||
|
|
||||||
if P.sound then
|
if P.sound then
|
||||||
@@ -546,10 +546,8 @@ function Player.hold(P,ifpre)
|
|||||||
P.cur,P.holdQueue[N]=H,C--Swap hold
|
P.cur,P.holdQueue[N]=H,C--Swap hold
|
||||||
H,C=P.holdQueue[N],P.cur
|
H,C=P.holdQueue[N],P.cur
|
||||||
|
|
||||||
if P.nextQueue[1]or C then--Make hold available in fixed sequence
|
if P.gameEnv.oncehold and(P.nextQueue[1]or C)then--Make hold available in fixed sequence
|
||||||
if P.gameEnv.oncehold then
|
P.holdTime=P.holdTime-1
|
||||||
P.holdTime=P.holdTime-1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if H then
|
if H then
|
||||||
@@ -577,7 +575,7 @@ function Player.hold(P,ifpre)
|
|||||||
P:freshBlock(false,true)
|
P:freshBlock(false,true)
|
||||||
P.dropDelay=P.gameEnv.drop
|
P.dropDelay=P.gameEnv.drop
|
||||||
P.lockDelay=P.gameEnv.lock
|
P.lockDelay=P.gameEnv.lock
|
||||||
P.freshTime=max(P.freshTime-5,int(P.gameEnv.freshLimit*(P.gameEnv.holdCount-P.holdTime)/P.gameEnv.holdCount))
|
P.freshTime=int(min(P.freshTime+P.gameEnv.freshLimit*.25,P.gameEnv.freshLimit*((P.holdTime+1)/P.gameEnv.holdCount)))
|
||||||
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end
|
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then P:lock()P:lose()end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -624,7 +622,7 @@ function Player.popNext(P)--Pop next queue to hand
|
|||||||
|
|
||||||
P.dropDelay=P.gameEnv.drop
|
P.dropDelay=P.gameEnv.drop
|
||||||
P.lockDelay=P.gameEnv.lock
|
P.lockDelay=P.gameEnv.lock
|
||||||
P.freshTime=0
|
P.freshTime=P.gameEnv.freshLimit
|
||||||
|
|
||||||
if P.cur then
|
if P.cur then
|
||||||
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then
|
if P:ifoverlap(P.cur.bk,P.curX,P.curY)then
|
||||||
|
|||||||
Reference in New Issue
Block a user