整理代码习惯,常量字符串改用单引号,可能有遗漏
This commit is contained in:
@@ -20,7 +20,7 @@ local frameColorList={
|
||||
COLOR.lO,
|
||||
}
|
||||
--local function drawCell(y,x,id)gc_draw(SKIN.curText[id],30*x-30,-30*y)end
|
||||
local function stencilBoard()gc_rectangle("fill",0,-10,300,610)end
|
||||
local function stencilBoard()gc_rectangle('fill',0,-10,300,610)end
|
||||
local function drawGrid(P)
|
||||
local d=P.fieldBeneath+P.fieldUp
|
||||
gc_setLineWidth(1)
|
||||
@@ -28,7 +28,7 @@ local function drawGrid(P)
|
||||
for x=1,9 do
|
||||
gc_line(30*x,-10,30*x,600)
|
||||
end
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(0,d-30*int(d/30))
|
||||
for y=0,19 do
|
||||
gc_line(0,30*y,300,30*y)
|
||||
@@ -60,7 +60,7 @@ local function drawRow(h,V,L,showInvis)
|
||||
gc_draw(texture[L[i]],30*i-30,-30*h)-- drawCell(j,i,L[i])
|
||||
elseif showInvis then
|
||||
gc_setColor(1,1,1,.3+.08*sin(.5*(h-i)+t))
|
||||
gc_rectangle("fill",30*i-30,-30*h,30,30)
|
||||
gc_rectangle('fill',30*i-30,-30*h,30,30)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -89,7 +89,7 @@ local function drawField(P)
|
||||
local alpha=P.falling/ENV.fall
|
||||
local h=1
|
||||
if ENV.upEdge then
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_setShader(SHADER.lighter)
|
||||
gc_translate(0,-4)
|
||||
--<drawRow>
|
||||
@@ -98,7 +98,7 @@ local function drawField(P)
|
||||
h=h+1
|
||||
gc_translate(0,-stepY)
|
||||
gc_setColor(1,1,1,alpha)
|
||||
gc_rectangle("fill",0,30-30*j,300,stepY)
|
||||
gc_rectangle('fill',0,30-30*j,300,stepY)
|
||||
end
|
||||
drawRow(j,V[j],F[j])
|
||||
end
|
||||
@@ -108,14 +108,14 @@ local function drawField(P)
|
||||
h=1
|
||||
end
|
||||
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
--<drawRow>
|
||||
for j=start,min(start+21,#F)do
|
||||
while j==P.clearingRow[h]do
|
||||
h=h+1
|
||||
gc_translate(0,-stepY)
|
||||
gc_setColor(1,1,1,alpha)
|
||||
gc_rectangle("fill",0,30-30*j,300,stepY)
|
||||
gc_rectangle('fill',0,30-30*j,300,stepY)
|
||||
end
|
||||
drawRow(j,V[j],F[j],GAME.replaying)
|
||||
end
|
||||
@@ -129,10 +129,10 @@ local function drawFXs(P)
|
||||
local S=P.lockFX[i]
|
||||
if S[3]<.5 then
|
||||
gc_setColor(1,1,1,2*S[3])
|
||||
gc_rectangle("fill",S[1],S[2],60*S[3],30)
|
||||
gc_rectangle('fill',S[1],S[2],60*S[3],30)
|
||||
else
|
||||
gc_setColor(1,1,1,2-2*S[3])
|
||||
gc_rectangle("fill",S[1]+30,S[2],60*S[3]-60,30)
|
||||
gc_rectangle('fill',S[1]+30,S[2],60*S[3]-60,30)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -141,7 +141,7 @@ local function drawFXs(P)
|
||||
local S=P.dropFX[i]
|
||||
gc_setColor(1,1,1,.6-S[5]*.6)
|
||||
local w=30*S[3]*(1-S[5]*.5)
|
||||
gc_rectangle("fill",30*S[1]-30+15*S[3]-w*.5,-30*S[2],w,30*S[4])
|
||||
gc_rectangle('fill',30*S[1]-30+15*S[3]-w*.5,-30*S[2],w,30*S[4])
|
||||
end
|
||||
|
||||
--MoveFX
|
||||
@@ -159,7 +159,7 @@ local function drawFXs(P)
|
||||
local x=t<.3 and 1-(3.3333*t-1)^2 or 1
|
||||
local y=t<.2 and 5*t or 1-1.25*(t-.2)
|
||||
gc_setColor(1,1,1,y)
|
||||
gc_rectangle("fill",150-x*150,15-S[1]*30-y*15,300*x,y*30)
|
||||
gc_rectangle('fill',150-x*150,15-S[1]*30-y*15,300*x,y*30)
|
||||
end
|
||||
end
|
||||
local function drawGhost(P,clr)
|
||||
@@ -213,9 +213,9 @@ end
|
||||
local function drawBoarders(P)
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(frameColorList[P.frameColor])
|
||||
gc_rectangle("line",-1,-11,302,612)--Bis Boarder
|
||||
gc_rectangle("line",301,-3,15,604)--AtkBuffer boarder
|
||||
gc_rectangle("line",-16,-3,15,604)--B2b bar boarder
|
||||
gc_rectangle('line',-1,-11,302,612)--Bis Boarder
|
||||
gc_rectangle('line',301,-3,15,604)--AtkBuffer boarder
|
||||
gc_rectangle('line',-16,-3,15,604)--B2b bar boarder
|
||||
end
|
||||
local attackColor={
|
||||
{COLOR.dH,COLOR.Z},
|
||||
@@ -238,20 +238,20 @@ local function drawBuffer(P)
|
||||
if A.countdown>0 then
|
||||
--Timing
|
||||
gc_setColor(attackColor[A.lv][1])
|
||||
gc_rectangle("fill",303,599-h,11,-bar)
|
||||
gc_rectangle('fill',303,599-h,11,-bar)
|
||||
gc_setColor(attackColor[A.lv][2])
|
||||
gc_rectangle("fill",303,599-h-bar,11,bar*(1-A.countdown/A.cd0))
|
||||
gc_rectangle('fill',303,599-h-bar,11,bar*(1-A.countdown/A.cd0))
|
||||
else
|
||||
--Warning
|
||||
local a=math.sin((TIME()-i)*30)*.5+.5
|
||||
local c1,c2=attackColor[A.lv][1],attackColor[A.lv][2]
|
||||
gc_setColor(c1[1]*a+c2[1]*(1-a),c1[2]*a+c2[2]*(1-a),c1[3]*a+c2[3]*(1-a))
|
||||
gc_rectangle("fill",303,599-h,11,-bar)
|
||||
gc_rectangle('fill',303,599-h,11,-bar)
|
||||
end
|
||||
else
|
||||
gc_setColor(attackColor[A.lv][1])
|
||||
bar=bar*(20-A.time)*.05
|
||||
gc_rectangle("fill",303,599-h,11,-bar)
|
||||
gc_rectangle('fill',303,599-h,11,-bar)
|
||||
--Disappear
|
||||
end
|
||||
h=h+bar
|
||||
@@ -260,12 +260,12 @@ end
|
||||
local function drawB2Bbar(P)
|
||||
local a,b=P.b2b,P.b2b1 if a>b then a,b=b,a end
|
||||
gc_setColor(.8,1,.2)
|
||||
gc_rectangle("fill",-14,599,11,-b*.6)
|
||||
gc_rectangle('fill',-14,599,11,-b*.6)
|
||||
gc_setColor(P.b2b<40 and COLOR.Z or P.b2b<=800 and COLOR.lR or COLOR.lB)
|
||||
gc_rectangle("fill",-14,599,11,-a*.6)
|
||||
gc_rectangle('fill',-14,599,11,-a*.6)
|
||||
if TIME()%.5<.3 then
|
||||
gc_setColor(1,1,1)
|
||||
gc_rectangle("fill",-15,b<40 and 568.5 or 118.5,13,3)
|
||||
gc_rectangle('fill',-15,b<40 and 568.5 or 118.5,13,3)
|
||||
end
|
||||
|
||||
--LockDelay indicator
|
||||
@@ -275,11 +275,11 @@ local function drawB2Bbar(P)
|
||||
gc_setColor(1,.26,.26)
|
||||
end
|
||||
if P.lockDelay>=0 then
|
||||
gc_rectangle("fill",0,602,300*P.lockDelay/P.gameEnv.lock,6)--Lock delay indicator
|
||||
gc_rectangle('fill',0,602,300*P.lockDelay/P.gameEnv.lock,6)--Lock delay indicator
|
||||
end
|
||||
local x=3
|
||||
for _=1,min(P.freshTime,15)do
|
||||
gc_rectangle("fill",x,615,14,5)
|
||||
gc_rectangle('fill',x,615,14,5)
|
||||
x=x+20
|
||||
end
|
||||
end
|
||||
@@ -289,10 +289,10 @@ local function drawHold(P)
|
||||
|
||||
local N=ENV.holdCount*72
|
||||
local texture=SKIN.curText
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(-140,36)
|
||||
gc_setColor(0,0,0,.4)gc_rectangle("fill",0,0,124,N+8)
|
||||
gc_setColor(1,1,1)gc_rectangle("line",0,0,124,N+8)
|
||||
gc_setColor(0,0,0,.4)gc_rectangle('fill',0,0,124,N+8)
|
||||
gc_setColor(1,1,1)gc_rectangle('line',0,0,124,N+8)
|
||||
if P.holdTime==0 then gc_setColor(.6,.4,.4)end
|
||||
mText(drawableText.hold,62,-51)
|
||||
|
||||
@@ -302,7 +302,7 @@ local function drawHold(P)
|
||||
else
|
||||
N=P.holdTime+1
|
||||
end
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(62,40)
|
||||
for n=1,#P.holdQueue do
|
||||
if n==N then gc_setColor(.6,.4,.4)end
|
||||
@@ -322,9 +322,9 @@ local function drawHold(P)
|
||||
end
|
||||
local RCPB={5,33,195,33,100,5,100,60}
|
||||
local hideBoardStencil={
|
||||
up=function()gc_rectangle("fill",0,0,300,300)end,
|
||||
down=function()gc_rectangle("fill",0,300,300,300)end,
|
||||
all=function()gc_rectangle("fill",0,0,300,600)end,
|
||||
up=function()gc_rectangle('fill',0,0,300,300)end,
|
||||
down=function()gc_rectangle('fill',0,300,300,300)end,
|
||||
all=function()gc_rectangle('fill',0,0,300,600)end,
|
||||
}
|
||||
local function drawDial(x,y,speed)
|
||||
gc_setColor(1,1,1)
|
||||
@@ -332,13 +332,13 @@ local function drawDial(x,y,speed)
|
||||
mStr(int(speed),x,y-18)
|
||||
|
||||
gc_setLineWidth(2)
|
||||
gc_circle("line",x,y,30,6)
|
||||
gc_circle('line',x,y,30,6)
|
||||
|
||||
gc_draw(IMG.dialNeedle,x,y,2.094+(speed<=175 and .02094*speed or 4.712-52.36/(speed-125)),nil,nil,5,4)
|
||||
|
||||
gc_setLineWidth(4)
|
||||
gc_setColor(1,1,1,.4)
|
||||
gc_circle("line",x,y,30,6)
|
||||
gc_circle('line',x,y,30,6)
|
||||
end
|
||||
local function drawFinesseCombo_norm(P)
|
||||
if P.finesseCombo>2 then
|
||||
@@ -359,7 +359,7 @@ local function drawFinesseCombo_norm(P)
|
||||
gc_setColor(1,1,1,1.2-_*.1)
|
||||
end
|
||||
if _>0 then
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(20,600)
|
||||
gc_scale(1+_*.08)
|
||||
gc_print(str,0,-30)
|
||||
@@ -428,7 +428,7 @@ local function drawStartCounter(P)
|
||||
gc_setColor(1,1,1)
|
||||
if P.frameRun<180 then
|
||||
local count=179-P.frameRun
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(305,220)
|
||||
setFont(95)
|
||||
if count%60>45 then gc_scale(1+(count%60-45)^2*.01,1)end
|
||||
@@ -441,14 +441,14 @@ local draw={}
|
||||
function draw.drawNext_norm(P)
|
||||
local ENV=P.gameEnv
|
||||
local texture=SKIN.curText
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(316,36)
|
||||
local N=ENV.nextCount*72
|
||||
gc_setColor(0,0,0,.4)gc_rectangle("fill",0,0,124,N+8)
|
||||
gc_setColor(1,1,1)gc_rectangle("line",0,0,124,N+8)
|
||||
gc_setColor(0,0,0,.4)gc_rectangle('fill',0,0,124,N+8)
|
||||
gc_setColor(1,1,1)gc_rectangle('line',0,0,124,N+8)
|
||||
mText(drawableText.next,62,-51)
|
||||
N=1
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(62,40)
|
||||
while N<=ENV.nextCount and P.nextQueue[N]do
|
||||
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
||||
@@ -479,14 +479,14 @@ end
|
||||
function draw.drawNext_hidden(P)
|
||||
local ENV=P.gameEnv
|
||||
local texture=SKIN.curText
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(316,36)
|
||||
local N=ENV.nextCount*72
|
||||
gc_setColor(.5,0,0,.4)gc_rectangle("fill",0,0,124,N+8)
|
||||
gc_setColor(1,1,1)gc_rectangle("line",0,0,124,N+8)
|
||||
gc_setColor(.5,0,0,.4)gc_rectangle('fill',0,0,124,N+8)
|
||||
gc_setColor(1,1,1)gc_rectangle('line',0,0,124,N+8)
|
||||
mText(drawableText.next,62,-51)
|
||||
N=min(ENV.nextStartPos,P.pieceCount+1)
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(62,40)
|
||||
while N<=ENV.nextCount and P.nextQueue[N]do
|
||||
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
|
||||
@@ -527,7 +527,7 @@ function draw.drawTargetLine(P,r)
|
||||
if r<21+(P.fieldBeneath+P.fieldUp)/30 and r>0 then
|
||||
gc_setLineWidth(4)
|
||||
gc_setColor(1,r>10 and 0 or rnd(),.5)
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
draw.applyFieldOffset(P)
|
||||
gc_line(0,600-30*r,300,600-30*r)
|
||||
gc_pop()
|
||||
@@ -538,21 +538,21 @@ function draw.norm(P)
|
||||
local ENV=P.gameEnv
|
||||
local FBN,FUP=P.fieldBeneath,P.fieldUp
|
||||
local t=TIME()
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(P.x,P.y)gc_scale(P.size)
|
||||
|
||||
--Field-related things
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
draw.applyFieldOffset(P)
|
||||
|
||||
--Fill field
|
||||
gc_setColor(0,0,0,.6)
|
||||
gc_rectangle("fill",0,-10,300,610)
|
||||
gc_rectangle('fill',0,-10,300,610)
|
||||
|
||||
--Stenciled in-field things
|
||||
gc_stencil(stencilBoard,"replace",1)
|
||||
gc_setStencilTest("equal",1)
|
||||
gc_push("transform")
|
||||
gc_stencil(stencilBoard,'replace',1)
|
||||
gc_setStencilTest('equal',1)
|
||||
gc_push('transform')
|
||||
boardTransform(ENV.flipBoard)
|
||||
|
||||
--Draw grid
|
||||
@@ -564,7 +564,7 @@ function draw.norm(P)
|
||||
local fieldTop=-ENV.fieldH*30
|
||||
--Draw dangerous area
|
||||
gc_setColor(1,0,0,.3)
|
||||
gc_rectangle("fill",0,fieldTop,300,-FUP-FBN-fieldTop-620)
|
||||
gc_rectangle('fill',0,fieldTop,300,-FUP-FBN-fieldTop-620)
|
||||
|
||||
--Draw field
|
||||
drawField(P)
|
||||
@@ -631,18 +631,18 @@ function draw.norm(P)
|
||||
if GAME.modeEnv.royaleMode then
|
||||
if P.atkMode then
|
||||
gc_setColor(1,.8,0,P.swappingAtkMode*.02)
|
||||
gc_rectangle("fill",RCPB[2*P.atkMode-1],RCPB[2*P.atkMode],90,35,8,4)
|
||||
gc_rectangle('fill',RCPB[2*P.atkMode-1],RCPB[2*P.atkMode],90,35,8,4)
|
||||
end
|
||||
gc_setColor(1,1,1,P.swappingAtkMode*.025)
|
||||
setFont(35)
|
||||
for i=1,4 do
|
||||
gc_rectangle("line",RCPB[2*i-1],RCPB[2*i],90,35,8,4)
|
||||
gc_rectangle('line',RCPB[2*i-1],RCPB[2*i],90,35,8,4)
|
||||
gc_printf(text.atkModeName[i],RCPB[2*i-1]-4,RCPB[2*i]+4,200,"center",nil,.5)
|
||||
end
|
||||
end
|
||||
if ENV.hideBoard then
|
||||
gc_stencil(hideBoardStencil[ENV.hideBoard],"replace",1)
|
||||
gc_setStencilTest("equal",1)
|
||||
gc_stencil(hideBoardStencil[ENV.hideBoard],'replace',1)
|
||||
gc_setStencilTest('equal',1)
|
||||
gc_setLineWidth(20)
|
||||
for i=0,24 do
|
||||
gc_setColor(COLOR.rainbow_gray(t*.626+i*.1))
|
||||
@@ -692,11 +692,11 @@ function draw.norm_remote(P)
|
||||
local ENV=P.gameEnv
|
||||
local FBN,FUP=P.fieldBeneath,P.fieldUp
|
||||
local t=TIME()
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(P.x,P.y)gc_scale(P.size)
|
||||
|
||||
--Field-related things
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
draw.applyFieldOffset(P)
|
||||
|
||||
--Draw username
|
||||
@@ -706,12 +706,12 @@ function draw.norm_remote(P)
|
||||
|
||||
--Fill field
|
||||
gc_setColor(0,0,0,.6)
|
||||
gc_rectangle("fill",0,-10,300,610)
|
||||
gc_rectangle('fill',0,-10,300,610)
|
||||
|
||||
--Stenciled in-field things
|
||||
gc_stencil(stencilBoard,"replace",1)
|
||||
gc_setStencilTest("equal",1)
|
||||
gc_push("transform")
|
||||
gc_stencil(stencilBoard,'replace',1)
|
||||
gc_setStencilTest('equal',1)
|
||||
gc_push('transform')
|
||||
boardTransform(ENV.flipBoard)
|
||||
|
||||
--Draw grid
|
||||
@@ -723,7 +723,7 @@ function draw.norm_remote(P)
|
||||
local fieldTop=-ENV.fieldH*30
|
||||
--Draw dangerous area
|
||||
gc_setColor(1,0,0,.3)
|
||||
gc_rectangle("fill",0,fieldTop,300,-FUP-FBN-fieldTop-620)
|
||||
gc_rectangle('fill',0,fieldTop,300,-FUP-FBN-fieldTop-620)
|
||||
|
||||
--Draw field
|
||||
drawField(P)
|
||||
@@ -781,18 +781,18 @@ function draw.norm_remote(P)
|
||||
if GAME.modeEnv.royaleMode then
|
||||
if P.atkMode then
|
||||
gc_setColor(1,.8,0,P.swappingAtkMode*.02)
|
||||
gc_rectangle("fill",RCPB[2*P.atkMode-1],RCPB[2*P.atkMode],90,35,8,4)
|
||||
gc_rectangle('fill',RCPB[2*P.atkMode-1],RCPB[2*P.atkMode],90,35,8,4)
|
||||
end
|
||||
gc_setColor(1,1,1,P.swappingAtkMode*.025)
|
||||
setFont(35)
|
||||
for i=1,4 do
|
||||
gc_rectangle("line",RCPB[2*i-1],RCPB[2*i],90,35,8,4)
|
||||
gc_rectangle('line',RCPB[2*i-1],RCPB[2*i],90,35,8,4)
|
||||
gc_printf(text.atkModeName[i],RCPB[2*i-1]-4,RCPB[2*i]+4,200,"center",nil,.5)
|
||||
end
|
||||
end
|
||||
if ENV.hideBoard then
|
||||
gc_stencil(hideBoardStencil[ENV.hideBoard],"replace",1)
|
||||
gc_setStencilTest("equal",1)
|
||||
gc_stencil(hideBoardStencil[ENV.hideBoard],'replace',1)
|
||||
gc_setStencilTest('equal',1)
|
||||
gc_setLineWidth(20)
|
||||
for i=0,24 do
|
||||
gc_setColor(COLOR.rainbow_gray(t*.626+i*.1))
|
||||
@@ -836,7 +836,7 @@ function draw.small(P)
|
||||
P.frameWait=10
|
||||
gc_setCanvas(P.canvas)
|
||||
gc_clear(0,0,0,.4)
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_origin()
|
||||
gc_setColor(1,1,1,P.result and max(20-P.endCounter,0)*.05 or 1)
|
||||
|
||||
@@ -853,7 +853,7 @@ function draw.small(P)
|
||||
if P.alive then
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(frameColorList[P.frameColor])
|
||||
gc_rectangle("line",0,0,60,120)
|
||||
gc_rectangle('line',0,0,60,120)
|
||||
end
|
||||
|
||||
--Draw badge
|
||||
@@ -867,7 +867,7 @@ function draw.small(P)
|
||||
--Draw result
|
||||
if P.result then
|
||||
gc_setColor(1,1,1,min(P.endCounter,60)*.01)
|
||||
setFont(20)mStr(P.result,32,47)
|
||||
setFont(20)mStr(drawableText[P.result],32,47)
|
||||
setFont(15)mStr(P.modeData.place,30,82)
|
||||
end
|
||||
gc_pop()
|
||||
@@ -880,7 +880,7 @@ function draw.small(P)
|
||||
if P.killMark then
|
||||
gc_setLineWidth(3)
|
||||
gc_setColor(1,0,0,min(P.endCounter,25)*.04)
|
||||
gc_circle("line",P.centerX,P.centerY,(840-20*min(P.endCounter,30))*P.size)
|
||||
gc_circle('line',P.centerX,P.centerY,(840-20*min(P.endCounter,30))*P.size)
|
||||
end
|
||||
setFont(30)
|
||||
end
|
||||
@@ -890,20 +890,20 @@ function draw.demo(P)
|
||||
local curColor=P.cur.color
|
||||
|
||||
--Camera
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(P.x,P.y)
|
||||
gc_scale(P.size)
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
draw.applyFieldOffset(P,true)
|
||||
|
||||
--Frame
|
||||
gc_setColor(0,0,0,.6)
|
||||
gc_rectangle("fill",0,0,300,600)
|
||||
gc_rectangle('fill',0,0,300,600)
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(1,1,1)
|
||||
gc_rectangle("line",-1,-1,302,602)
|
||||
gc_rectangle('line',-1,-1,302,602)
|
||||
|
||||
gc_push("transform")
|
||||
gc_push('transform')
|
||||
gc_translate(0,600)
|
||||
drawField(P)
|
||||
drawFXs(P)
|
||||
|
||||
@@ -36,7 +36,7 @@ return{
|
||||
holdCount=1,infHold=false,phyHold=false,
|
||||
ospin=true,deepDrop=false,
|
||||
RS="TRS",
|
||||
sequence="bag",
|
||||
sequence='bag',
|
||||
seqData={1,2,3,4,5,6,7},
|
||||
face=NULL,skin=NULL,
|
||||
mission=NULL,
|
||||
@@ -46,7 +46,7 @@ return{
|
||||
pushSpeed=3,
|
||||
block=true,
|
||||
noTele=false,
|
||||
visible="show",
|
||||
visible='show',
|
||||
freshLimit=1e99,easyFresh=true,
|
||||
|
||||
fkey1=false,
|
||||
@@ -57,6 +57,6 @@ return{
|
||||
dropPiece=NULL,
|
||||
mindas=0,minarr=0,minsdarr=0,
|
||||
|
||||
bg="none",bgm="race",
|
||||
bg='none',bgm='race',
|
||||
allowMod=true,
|
||||
}
|
||||
@@ -141,17 +141,17 @@ local seqGens={
|
||||
}
|
||||
return function(P)--Return a piece-generating funtion for player P
|
||||
local s=P.gameEnv.sequence
|
||||
if type(s)=="function"then
|
||||
if type(s)=='function'then
|
||||
return s
|
||||
elseif type(s)=="string"and seqGens[s]then
|
||||
elseif type(s)=='string'and seqGens[s]then
|
||||
return seqGens[s]
|
||||
else
|
||||
LOG.print(
|
||||
type(s)=="string"and
|
||||
type(s)=='string'and
|
||||
"No sequence mode called "..s or
|
||||
"Wrong sequence generator",
|
||||
"warn")
|
||||
P.gameEnv.sequence="bag"
|
||||
'warn')
|
||||
P.gameEnv.sequence='bag'
|
||||
return seqGens.bag
|
||||
end
|
||||
end
|
||||
@@ -136,7 +136,7 @@ local function newEmptyPlayer(id,mini)
|
||||
P.atker,P.atking,P.lastRecv={}
|
||||
|
||||
--Network-related
|
||||
P.username="_"
|
||||
P.username='_'
|
||||
P.uid=-1
|
||||
P.sid=-1
|
||||
|
||||
@@ -179,7 +179,7 @@ local function newEmptyPlayer(id,mini)
|
||||
P.ctrlCount=0--Key press time, for finesse check
|
||||
P.pieceCount=0--Count pieces from next, for drawing bagline
|
||||
|
||||
P.type="none"
|
||||
P.type='none'
|
||||
P.sound=false
|
||||
|
||||
-- P.newNext=false--Warped coroutine to get new next, loaded in applyGameEnv()
|
||||
@@ -201,7 +201,7 @@ local function newEmptyPlayer(id,mini)
|
||||
P.bonus={}--Text objects
|
||||
|
||||
P.endCounter=0--Used after gameover
|
||||
P.result=false--String:"WIN"/"K.O."
|
||||
P.result=false--String: 'finish'|'win'|'lose'
|
||||
|
||||
return P
|
||||
end
|
||||
@@ -223,7 +223,7 @@ local function loadGameEnv(P)--Load gameEnv
|
||||
-- else
|
||||
-- print("default-"..k..":"..tostring(v))
|
||||
end
|
||||
if type(v)~="table"then--Default setting
|
||||
if type(v)~='table'then--Default setting
|
||||
ENV[k]=v
|
||||
else
|
||||
ENV[k]=TABLE.copy(v)
|
||||
@@ -254,7 +254,7 @@ local function loadRemoteEnv(P,confStr)--Load gameEnv
|
||||
elseif SETTING[k]~=nil then
|
||||
v=SETTING[k] --Global setting
|
||||
end
|
||||
if type(v)~="table"then--Default setting
|
||||
if type(v)~='table'then--Default setting
|
||||
ENV[k]=v
|
||||
else
|
||||
ENV[k]=TABLE.copy(v)
|
||||
@@ -286,19 +286,19 @@ local function applyGameEnv(P)--Finish gameEnv processing
|
||||
end
|
||||
|
||||
P:setInvisible(
|
||||
ENV.visible=="show"and -1 or
|
||||
ENV.visible=="easy"and 300 or
|
||||
ENV.visible=="slow"and 100 or
|
||||
ENV.visible=="medium"and 60 or
|
||||
ENV.visible=="fast"and 20 or
|
||||
ENV.visible=="none"and 0
|
||||
ENV.visible=='show'and -1 or
|
||||
ENV.visible=='easy'and 300 or
|
||||
ENV.visible=='slow'and 100 or
|
||||
ENV.visible=='medium'and 60 or
|
||||
ENV.visible=='fast'and 20 or
|
||||
ENV.visible=='none'and 0
|
||||
)
|
||||
P:set20G(P._20G)
|
||||
P:setHold(ENV.holdCount)
|
||||
P:setNext(ENV.nextCount,ENV.nextStartPos>1)
|
||||
P:setRS(ENV.RS)
|
||||
|
||||
if type(ENV.mission)=="table"then
|
||||
if type(ENV.mission)=='table'then
|
||||
P.curMission=1
|
||||
end
|
||||
|
||||
@@ -306,7 +306,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
|
||||
ENV.arr=max(ENV.arr,ENV.minarr)
|
||||
ENV.sdarr=max(ENV.sdarr,ENV.minsdarr)
|
||||
|
||||
if ENV.sequence~="bag"and ENV.sequence~="loop"then
|
||||
if ENV.sequence~='bag'and ENV.sequence~='loop'then
|
||||
ENV.bagLine=false
|
||||
else
|
||||
ENV.bagLen=#ENV.seqData
|
||||
@@ -351,7 +351,7 @@ local DemoEnv={
|
||||
}
|
||||
function PLY.newDemoPlayer(id)
|
||||
local P=newEmptyPlayer(id)
|
||||
P.type="computer"
|
||||
P.type='computer'
|
||||
P.sound=true
|
||||
P.demo=true
|
||||
|
||||
@@ -362,19 +362,19 @@ function PLY.newDemoPlayer(id)
|
||||
loadGameEnv(P)
|
||||
applyGameEnv(P)
|
||||
P:loadAI{
|
||||
type="CC",
|
||||
type='CC',
|
||||
next=5,
|
||||
hold=true,
|
||||
delay=30,
|
||||
delta=6,
|
||||
bag="bag",
|
||||
bag='bag',
|
||||
node=100000,
|
||||
}
|
||||
P:popNext()
|
||||
end
|
||||
function PLY.newRemotePlayer(id,mini,data)
|
||||
local P=newEmptyPlayer(id,mini)
|
||||
P.type="remote"
|
||||
P.type='remote'
|
||||
P.update=PLY.update.remote_alive
|
||||
|
||||
P.draw=PLY.draw.norm_remote
|
||||
@@ -393,7 +393,7 @@ end
|
||||
|
||||
function PLY.newAIPlayer(id,AIdata,mini)
|
||||
local P=newEmptyPlayer(id,mini)
|
||||
P.type="computer"
|
||||
P.type='computer'
|
||||
|
||||
loadGameEnv(P)
|
||||
local ENV=P.gameEnv
|
||||
@@ -404,7 +404,7 @@ function PLY.newAIPlayer(id,AIdata,mini)
|
||||
end
|
||||
function PLY.newPlayer(id,mini)
|
||||
local P=newEmptyPlayer(id,mini)
|
||||
P.type="human"
|
||||
P.type='human'
|
||||
P.sound=true
|
||||
|
||||
P.uid=USER.uid
|
||||
|
||||
@@ -47,21 +47,21 @@ function Player:createMoveFX(dir)
|
||||
local CB=self.cur.bk
|
||||
local x=self.curX-1
|
||||
local y=self.gameEnv.smooth and self.curY+self.dropDelay/self.gameEnv.drop-2 or self.curY-1
|
||||
if dir=="left"then
|
||||
if dir=='left'then
|
||||
for i=1,#CB do for j=#CB[1],1,-1 do
|
||||
if self.cur.bk[i][j]then
|
||||
ins(self.moveFX,{C,x+j,y+i,0,T})
|
||||
break
|
||||
end
|
||||
end end
|
||||
elseif dir=="right"then
|
||||
elseif dir=='right'then
|
||||
for i=1,#CB do for j=1,#CB[1]do
|
||||
if self.cur.bk[i][j]then
|
||||
ins(self.moveFX,{C,x+j,y+i,0,T})
|
||||
break
|
||||
end
|
||||
end end
|
||||
elseif dir=="down"then
|
||||
elseif dir=='down'then
|
||||
for j=1,#CB[1]do for i=#CB,1,-1 do
|
||||
if self.cur.bk[i][j]then
|
||||
ins(self.moveFX,{C,x+j,y+i,0,T})
|
||||
@@ -109,7 +109,7 @@ function Player:createBeam(R,send,power,color)
|
||||
local c=minoColor[color]
|
||||
local r,g,b=c[1]*2,c[2]*2,c[3]*2
|
||||
|
||||
local a=GAME.modeEnv.royaleMode and not(self.type=="human"or R.type=="human")and .2 or 1
|
||||
local a=GAME.modeEnv.royaleMode and not(self.type=='human'or R.type=='human')and .2 or 1
|
||||
SYSFX.newAttack(1-power*.1,x1,y1,x2,y2,int(send^.7*(4+power)),r,g,b,a*(power+2)*.0626)
|
||||
end
|
||||
--------------------------</FX>--------------------------
|
||||
@@ -122,7 +122,7 @@ end
|
||||
function Player:newTask(code,...)
|
||||
local thread=coroutine.create(code)
|
||||
resume(thread,self,...)
|
||||
if status(thread)~="dead"then
|
||||
if status(thread)~='dead'then
|
||||
self.tasks[#self.tasks+1]={
|
||||
thread=thread,
|
||||
code=code,
|
||||
@@ -171,14 +171,14 @@ function Player:switchKey(id,on)
|
||||
if not on then
|
||||
self:releaseKey(id)
|
||||
end
|
||||
if self.type=="human"then
|
||||
if self.type=='human'then
|
||||
VK.switchKey(id,on)
|
||||
end
|
||||
end
|
||||
function Player:set20G(if20g)
|
||||
self._20G=if20g
|
||||
self:switchKey(7,not if20g)
|
||||
if if20g and self.AI_mode=="CC"then CC.switch20G(self)end
|
||||
if if20g and self.AI_mode=='CC'then CC.switch20G(self)end
|
||||
end
|
||||
function Player:setHold(count)--Set hold count (false/true as 0/1)
|
||||
if not count then
|
||||
@@ -239,7 +239,7 @@ function Player:garbageRelease()--Check garbage buffer and try to release them
|
||||
break
|
||||
end
|
||||
end
|
||||
if flag and self.AI_mode=="CC"and self.AI_bot then CC.updateField(self)end
|
||||
if flag and self.AI_mode=='CC'and self.AI_bot then CC.updateField(self)end
|
||||
end
|
||||
function Player:garbageRise(color,amount,line)--Release n-lines garbage to field
|
||||
local _
|
||||
@@ -260,7 +260,7 @@ function Player:garbageRise(color,amount,line)--Release n-lines garbage to field
|
||||
for i=1,#self.clearingRow do
|
||||
self.clearingRow[i]=self.clearingRow[i]+amount
|
||||
end
|
||||
self:freshBlock("push")
|
||||
self:freshBlock('push')
|
||||
for i=1,#self.lockFX do
|
||||
_=self.lockFX[i]
|
||||
_[2]=_[2]-30*amount--Shift 30px per line cleared
|
||||
@@ -293,7 +293,7 @@ function Player:pushLineList(L,mir)--Push some lines to field
|
||||
self.fieldBeneath=self.fieldBeneath+30*l
|
||||
self.curY=self.curY+l
|
||||
self.ghoY=self.ghoY+l
|
||||
self:freshBlock("push")
|
||||
self:freshBlock('push')
|
||||
end
|
||||
function Player:pushNextList(L,mir)--Push some nexts to nextQueue
|
||||
for i=1,#L do
|
||||
@@ -325,7 +325,7 @@ end
|
||||
function Player:attack(R,send,time,line,fromStream)
|
||||
local atkFX=self.gameEnv.atkFX
|
||||
if GAME.net then
|
||||
if self.type=="human"then--Local player attack others
|
||||
if self.type=='human'then--Local player attack others
|
||||
ins(GAME.rep,self.frameRun)
|
||||
ins(GAME.rep,
|
||||
R.sid+
|
||||
@@ -338,7 +338,7 @@ function Player:attack(R,send,time,line,fromStream)
|
||||
self:createBeam(R,send,atkFX,self.cur.color)
|
||||
end
|
||||
end
|
||||
if fromStream and R.type=="human"then--Local player receiving lines
|
||||
if fromStream and R.type=='human'then--Local player receiving lines
|
||||
ins(GAME.rep,R.frameRun)
|
||||
ins(GAME.rep,
|
||||
self.sid+
|
||||
@@ -378,7 +378,7 @@ function Player:receive(A,send,time,line)
|
||||
B.sum=B.sum+send
|
||||
self.stat.recv=self.stat.recv+send
|
||||
if self.sound then
|
||||
SFX.play(send<4 and"blip_1"or"blip_2",min(send+1,5)*.1)
|
||||
SFX.play(send<4 and'blip_1'or'blip_2',min(send+1,5)*.1)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -412,7 +412,7 @@ function Player:changeAtkMode(m)
|
||||
end
|
||||
end
|
||||
function Player:changeAtk(R)
|
||||
-- if self.type~="human"then R=PLAYERS[1]end--1vALL mode?
|
||||
-- if self.type~='human'then R=PLAYERS[1]end--1vALL mode?
|
||||
if self.atking then
|
||||
local K=self.atking.atker
|
||||
for i=1,#K do
|
||||
@@ -432,7 +432,7 @@ end
|
||||
function Player:freshBlock(mode)--string mode: push/move/fresh/newBlock
|
||||
local ENV=self.gameEnv
|
||||
--Fresh ghost
|
||||
if(mode=="move"or mode=="newBlock"or mode=="push")and self.cur then
|
||||
if(mode=='move'or mode=='newBlock'or mode=='push')and self.cur then
|
||||
local CB=self.cur.bk
|
||||
self.ghoY=min(#self.field+1,self.curY)
|
||||
if self._20G or ENV.sdarr==0 and self.keyPressing[7]and self.downing>ENV.sddas then
|
||||
@@ -466,11 +466,11 @@ function Player:freshBlock(mode)--string mode: push/move/fresh/newBlock
|
||||
end
|
||||
|
||||
--Fresh delays
|
||||
if mode=="move"or mode=="newBlock"or mode=="fresh"then
|
||||
if mode=='move'or mode=='newBlock'or mode=='fresh'then
|
||||
local d0,l0=ENV.drop,ENV.lock
|
||||
if ENV.easyFresh then
|
||||
if self.lockDelay<l0 and self.freshTime>0 then
|
||||
if mode~="newBlock"then
|
||||
if mode~='newBlock'then
|
||||
self.freshTime=self.freshTime-1
|
||||
end
|
||||
self.lockDelay=l0
|
||||
@@ -518,12 +518,12 @@ function Player:lock()
|
||||
end
|
||||
end
|
||||
end
|
||||
if has_dest and not dest and self.AI_mode=="CC"and self.AI_bot then
|
||||
if has_dest and not dest and self.AI_mode=='CC'and self.AI_bot then
|
||||
CC.updateField(self)
|
||||
end
|
||||
end
|
||||
|
||||
local spawnSFX_name={}for i=1,7 do spawnSFX_name[i]="spawn_"..i end
|
||||
local spawnSFX_name={}for i=1,7 do spawnSFX_name[i]='spawn_'..i end
|
||||
function Player:resetBlock()--Reset Block's position and execute I*S
|
||||
local B=self.cur.bk
|
||||
self.curX=int(6-#B[1]*.5)
|
||||
@@ -570,12 +570,12 @@ end
|
||||
|
||||
function Player:spin(d,ifpre)
|
||||
local kickData=self.RS[self.cur.id]
|
||||
if type(kickData)=="table"then
|
||||
if type(kickData)=='table'then
|
||||
local idir=(self.cur.dir+d)%4
|
||||
kickData=kickData[self.cur.dir*10+idir]
|
||||
if not kickData then
|
||||
self:freshBlock("move")
|
||||
SFX.play(ifpre and"prerotate"or"rotate",nil,self:getCenterX()*.15)
|
||||
self:freshBlock('move')
|
||||
SFX.play(ifpre and'prerotate'or'rotate',nil,self:getCenterX()*.15)
|
||||
return
|
||||
end
|
||||
local icb=BLOCKS[self.cur.id][idir]
|
||||
@@ -594,7 +594,7 @@ function Player:spin(d,ifpre)
|
||||
|
||||
local t=self.freshTime
|
||||
if not ifpre then
|
||||
self:freshBlock("move")
|
||||
self:freshBlock('move')
|
||||
end
|
||||
if kickData[test][2]>0 and self.freshTime==t and self.curY~=self.imgY then
|
||||
self.freshTime=self.freshTime-1
|
||||
@@ -603,9 +603,9 @@ function Player:spin(d,ifpre)
|
||||
if self.sound then
|
||||
local sfx
|
||||
if ifpre then
|
||||
sfx="prerotate"
|
||||
sfx='prerotate'
|
||||
elseif self:ifoverlap(icb,ix,iy+1)and self:ifoverlap(icb,ix-1,iy)and self:ifoverlap(icb,ix+1,iy)then
|
||||
sfx="rotatekick"
|
||||
sfx='rotatekick'
|
||||
if self.gameEnv.shakeFX then
|
||||
if d==1 or d==3 then
|
||||
self.fieldOff.va=self.fieldOff.va+(2-d)*self.gameEnv.shakeFX*6e-3
|
||||
@@ -614,7 +614,7 @@ function Player:spin(d,ifpre)
|
||||
end
|
||||
end
|
||||
else
|
||||
sfx="rotate"
|
||||
sfx='rotate'
|
||||
end
|
||||
SFX.play(sfx,nil,self:getCenterX()*.15)
|
||||
end
|
||||
@@ -625,8 +625,8 @@ function Player:spin(d,ifpre)
|
||||
elseif kickData then
|
||||
kickData(self,d)
|
||||
else
|
||||
self:freshBlock("move")
|
||||
SFX.play(ifpre and"prerotate"or"rotate",nil,self:getCenterX()*.15)
|
||||
self:freshBlock('move')
|
||||
SFX.play(ifpre and'prerotate'or'rotate',nil,self:getCenterX()*.15)
|
||||
end
|
||||
end
|
||||
local phyHoldKickX={
|
||||
@@ -669,7 +669,7 @@ function Player:hold(ifpre)
|
||||
end
|
||||
end
|
||||
--<for-else> All test failed, interrupt with sound
|
||||
SFX.play("finesseError")
|
||||
SFX.play('finesseError')
|
||||
do return end
|
||||
--<for-end>
|
||||
::BREAK_success::
|
||||
@@ -696,7 +696,7 @@ function Player:hold(ifpre)
|
||||
|
||||
self:resetBlock()
|
||||
end
|
||||
self:freshBlock("move")
|
||||
self:freshBlock('move')
|
||||
self.dropDelay=ENV.drop
|
||||
self.lockDelay=ENV.lock
|
||||
if self:ifoverlap(self.cur.bk,self.curX,self.curY)then
|
||||
@@ -711,10 +711,10 @@ function Player:hold(ifpre)
|
||||
end
|
||||
|
||||
if self.sound then
|
||||
SFX.play(ifpre and"prehold"or"hold")
|
||||
SFX.play(ifpre and'prehold'or'hold')
|
||||
end
|
||||
|
||||
if self.AI_mode=="CC"then
|
||||
if self.AI_mode=='CC'then
|
||||
local next=self.nextQueue[self.AIdata.nextCount]
|
||||
if next then
|
||||
CC.addNext(self.AI_bot,next.id)
|
||||
@@ -761,7 +761,7 @@ function Player:popNext(ifhold)--Pop nextQueue to hand
|
||||
self.newNext()
|
||||
if self.cur then
|
||||
self.pieceCount=self.pieceCount+1
|
||||
if self.AI_mode=="CC"then
|
||||
if self.AI_mode=='CC'then
|
||||
local next=self.nextQueue[self.AIdata.next]
|
||||
if next then
|
||||
CC.addNext(self.AI_bot,next.id)
|
||||
@@ -787,7 +787,7 @@ function Player:popNext(ifhold)--Pop nextQueue to hand
|
||||
self:lock()
|
||||
self:lose()
|
||||
end
|
||||
self:freshBlock("newBlock")
|
||||
self:freshBlock('newBlock')
|
||||
end
|
||||
|
||||
--IHdS
|
||||
@@ -838,11 +838,11 @@ do--Player.drop(self)--Place piece
|
||||
local reAtk={0,0,1,1,1,2,2,3,3}
|
||||
local reDef={0,1,1,2,3,3,4,4,5}
|
||||
|
||||
local spinVoice={"zspin","sspin","jspin","lspin","tspin","ospin","ispin","zspin","sspin","pspin","qspin","fspin","espin","tspin","uspin","vspin","wspin","xspin","jspin","lspin","rspin","yspin","hspin","nspin","ispin"}
|
||||
local clearVoice={"single","double","triple","techrash","pentcrash","hexcrash"}
|
||||
local spinSFX={[0]="spin_0","spin_1","spin_2"}
|
||||
local clearSFX={"clear_1","clear_2","clear_3"}
|
||||
local renSFX={}for i=1,11 do renSFX[i]="ren_"..i end
|
||||
local spinVoice={'zspin','sspin','jspin','lspin','tspin','ospin','ispin','zspin','sspin','pspin','qspin','fspin','espin','tspin','uspin','vspin','wspin','xspin','jspin','lspin','rspin','yspin','hspin','nspin','ispin'}
|
||||
local clearVoice={'single','double','triple','techrash','pentcrash','hexcrash'}
|
||||
local spinSFX={[0]='spin_0','spin_1','spin_2'}
|
||||
local clearSFX={'clear_1','clear_2','clear_3'}
|
||||
local renSFX={}for i=1,11 do renSFX[i]='ren_'..i end
|
||||
local finesseList={
|
||||
{
|
||||
{1,2,1,0,1,2,2,1},
|
||||
@@ -933,9 +933,9 @@ do--Player.drop(self)--Place piece
|
||||
},--O1
|
||||
}
|
||||
for k,v in next,finesseList do
|
||||
if type(v)=="table"then
|
||||
if type(v)=='table'then
|
||||
for d,l in next,v do
|
||||
if type(l)=="number"then
|
||||
if type(l)=='number'then
|
||||
v[d]=v[l]
|
||||
end
|
||||
end
|
||||
@@ -1128,15 +1128,15 @@ do--Player.drop(self)--Place piece
|
||||
end
|
||||
if self.sound then
|
||||
if ENV.fineKill then
|
||||
SFX.play("finesseError_long",.6)
|
||||
SFX.play('finesseError_long',.6)
|
||||
elseif ENV.fine then
|
||||
SFX.play("finesseError",.8)
|
||||
SFX.play('finesseError',.8)
|
||||
else
|
||||
SFX.play("lock",nil,self:getCenterX()*.15)
|
||||
SFX.play('lock',nil,self:getCenterX()*.15)
|
||||
end
|
||||
end
|
||||
elseif self.sound then
|
||||
SFX.play("lock",nil,self:getCenterX()*.15)
|
||||
SFX.play('lock',nil,self:getCenterX()*.15)
|
||||
end
|
||||
|
||||
if finePts<=1 then
|
||||
@@ -1156,35 +1156,35 @@ do--Player.drop(self)--Place piece
|
||||
if dospin then
|
||||
cscore=(spinSCR[C.name]or spinSCR[8])[cc]
|
||||
if self.b2b>800 then
|
||||
self:showText(text.b3b..text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,35,"stretch")
|
||||
self:showText(text.b3b..text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,35,'stretch')
|
||||
atk=b2bATK[cc]+cc*.5
|
||||
exblock=exblock+1
|
||||
cscore=cscore*2
|
||||
Stat.b3b=Stat.b3b+1
|
||||
if self.sound then
|
||||
VOC.play("b3b",CHN)
|
||||
VOC.play('b3b',CHN)
|
||||
end
|
||||
elseif self.b2b>=50 then
|
||||
self:showText(text.b2b..text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,35,"spin")
|
||||
self:showText(text.b2b..text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,35,'spin')
|
||||
atk=b2bATK[cc]
|
||||
cscore=cscore*1.2
|
||||
Stat.b2b=Stat.b2b+1
|
||||
if self.sound then
|
||||
VOC.play("b2b",CHN)
|
||||
VOC.play('b2b',CHN)
|
||||
end
|
||||
else
|
||||
self:showText(text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,45,"spin")
|
||||
self:showText(text.block[C.name]..text.spin.." "..text.clear[cc],0,-30,45,'spin')
|
||||
atk=2*cc
|
||||
end
|
||||
sendTime=20+atk*20
|
||||
if mini then
|
||||
self:showText(text.mini,0,-80,35,"appear")
|
||||
self:showText(text.mini,0,-80,35,'appear')
|
||||
atk=atk*.25
|
||||
sendTime=sendTime+60
|
||||
cscore=cscore*.5
|
||||
self.b2b=self.b2b+b2bPoint[cc]*.5
|
||||
if self.sound then
|
||||
VOC.play("mini",CHN)
|
||||
VOC.play('mini',CHN)
|
||||
end
|
||||
else
|
||||
self.b2b=self.b2b+b2bPoint[cc]
|
||||
@@ -1192,32 +1192,32 @@ do--Player.drop(self)--Place piece
|
||||
piece.mini=mini
|
||||
piece.special=true
|
||||
if self.sound then
|
||||
SFX.play(spinSFX[cc]or"spin_3")
|
||||
SFX.play(spinSFX[cc]or'spin_3')
|
||||
VOC.play(spinVoice[C.name],CHN)
|
||||
end
|
||||
elseif cc>=4 then
|
||||
cscore=cc==4 and 1000 or cc==5 and 1500 or 2000
|
||||
if self.b2b>800 then
|
||||
self:showText(text.b3b..text.clear[cc],0,-30,50,"fly")
|
||||
self:showText(text.b3b..text.clear[cc],0,-30,50,'fly')
|
||||
atk=4*cc-10
|
||||
sendTime=100
|
||||
exblock=exblock+1
|
||||
cscore=cscore*1.8
|
||||
Stat.b3b=Stat.b3b+1
|
||||
if self.sound then
|
||||
VOC.play("b3b",CHN)
|
||||
VOC.play('b3b',CHN)
|
||||
end
|
||||
elseif self.b2b>=50 then
|
||||
self:showText(text.b2b..text.clear[cc],0,-30,50,"drive")
|
||||
self:showText(text.b2b..text.clear[cc],0,-30,50,'drive')
|
||||
sendTime=80
|
||||
atk=3*cc-7
|
||||
cscore=cscore*1.3
|
||||
Stat.b2b=Stat.b2b+1
|
||||
if self.sound then
|
||||
VOC.play("b2b",CHN)
|
||||
VOC.play('b2b',CHN)
|
||||
end
|
||||
else
|
||||
self:showText(text.clear[cc],0,-30,70,"stretch")
|
||||
self:showText(text.clear[cc],0,-30,70,'stretch')
|
||||
sendTime=60
|
||||
atk=2*cc-4
|
||||
end
|
||||
@@ -1236,7 +1236,7 @@ do--Player.drop(self)--Place piece
|
||||
if self.b2b<50 and ENV.b2bKill then
|
||||
finish=true
|
||||
end
|
||||
self:showText(text.clear[cc],0,-30,35,"appear",(8-cc)*.3)
|
||||
self:showText(text.clear[cc],0,-30,35,'appear',(8-cc)*.3)
|
||||
atk=cc-.5
|
||||
sendTime=20+int(atk*20)
|
||||
cscore=cscore+clearSCR[cc]
|
||||
@@ -1249,14 +1249,14 @@ do--Player.drop(self)--Place piece
|
||||
if cmb>=3 then
|
||||
atk=atk+1
|
||||
end
|
||||
self:showText(text.cmb[min(cmb,21)],0,25,15+min(cmb,15)*5,cmb<10 and"appear"or"flicker")
|
||||
self:showText(text.cmb[min(cmb,21)],0,25,15+min(cmb,15)*5,cmb<10 and'appear'or'flicker')
|
||||
cscore=cscore+min(50*cmb,500)*(2*cc-1)
|
||||
end
|
||||
|
||||
--PC/HPC
|
||||
if clear then
|
||||
if #self.field==0 then
|
||||
self:showText(text.PC,0,-80,50,"flicker")
|
||||
self:showText(text.PC,0,-80,50,'flicker')
|
||||
atk=max(atk,min(8+Stat.pc*2,16))
|
||||
exblock=exblock+2
|
||||
sendTime=sendTime+120
|
||||
@@ -1268,13 +1268,13 @@ do--Player.drop(self)--Place piece
|
||||
end
|
||||
Stat.pc=Stat.pc+1
|
||||
if self.sound then
|
||||
SFX.play("clear")
|
||||
VOC.play("perfect_clear",CHN)
|
||||
SFX.play('clear')
|
||||
VOC.play('perfect_clear',CHN)
|
||||
end
|
||||
piece.pc=true
|
||||
piece.special=true
|
||||
elseif cc>=#C.bk and(cc>1 or #self.field==self.garbageBeneath)then
|
||||
self:showText(text.HPC,0,-80,50,"fly")
|
||||
self:showText(text.HPC,0,-80,50,'fly')
|
||||
atk=atk+4
|
||||
exblock=exblock+2
|
||||
sendTime=sendTime+60
|
||||
@@ -1282,8 +1282,8 @@ do--Player.drop(self)--Place piece
|
||||
cscore=cscore+626
|
||||
Stat.hpc=Stat.hpc+1
|
||||
if self.sound then
|
||||
SFX.play("clear")
|
||||
VOC.play("half_clear",CHN)
|
||||
SFX.play('clear')
|
||||
VOC.play('half_clear',CHN)
|
||||
end
|
||||
piece.hpc=true
|
||||
piece.special=true
|
||||
@@ -1306,11 +1306,11 @@ do--Player.drop(self)--Place piece
|
||||
send=atk
|
||||
if exblock>0 then
|
||||
exblock=int(exblock*(1+self.strength*.25))--Badge Buff
|
||||
self:showText("+"..exblock,0,53,20,"fly")
|
||||
self:showText("+"..exblock,0,53,20,'fly')
|
||||
off=off+self:cancel(exblock)
|
||||
end
|
||||
if send>=1 then
|
||||
self:showText(send,0,80,35,"zoomout")
|
||||
self:showText(send,0,80,35,'zoomout')
|
||||
_=self:cancel(send)
|
||||
send=send-_
|
||||
off=off+_
|
||||
@@ -1337,14 +1337,14 @@ do--Player.drop(self)--Place piece
|
||||
self:attack(T,send,sendTime,generateLine(self:RND(10)))
|
||||
end
|
||||
end
|
||||
if self.sound and send>3 then SFX.play("emit",min(send,7)*.1)end
|
||||
if self.sound and send>3 then SFX.play('emit',min(send,7)*.1)end
|
||||
end
|
||||
|
||||
--SFX & Vibrate
|
||||
if self.sound then
|
||||
SFX.play(clearSFX[cc]or"clear_4")
|
||||
SFX.play(clearSFX[cc]or'clear_4')
|
||||
SFX.play(renSFX[min(cmb,11)])
|
||||
if cmb>14 then SFX.play("ren_mega",(cmb-10)*.1)end
|
||||
if cmb>14 then SFX.play('ren_mega',(cmb-10)*.1)end
|
||||
VIB(cc+1)
|
||||
end
|
||||
else--No lines clear
|
||||
@@ -1352,10 +1352,10 @@ do--Player.drop(self)--Place piece
|
||||
|
||||
--Spin bonus
|
||||
if dospin then
|
||||
self:showText(text.block[C.name]..text.spin,0,-30,45,"appear")
|
||||
self:showText(text.block[C.name]..text.spin,0,-30,45,'appear')
|
||||
self.b2b=self.b2b+20
|
||||
if self.sound then
|
||||
SFX.play("spin_0")
|
||||
SFX.play('spin_0')
|
||||
VOC.play(spinVoice[C.name],CHN)
|
||||
end
|
||||
cscore=30
|
||||
@@ -1388,7 +1388,7 @@ do--Player.drop(self)--Place piece
|
||||
(self.curX+C.sc[2]-5.5)*30,
|
||||
(10-self.curY-C.sc[1])*30+self.fieldBeneath+self.fieldUp,
|
||||
40-600/(cscore+20),
|
||||
"score",
|
||||
'score',
|
||||
2
|
||||
)
|
||||
end
|
||||
@@ -1421,14 +1421,14 @@ do--Player.drop(self)--Place piece
|
||||
end
|
||||
if success then
|
||||
self.curMission=self.curMission+1
|
||||
SFX.play("reach")
|
||||
SFX.play('reach')
|
||||
if self.curMission>#ENV.mission then
|
||||
self.curMission=false
|
||||
if not finish then finish="finish"end
|
||||
if not finish then finish='finish'end
|
||||
end
|
||||
elseif ENV.missionKill then
|
||||
self:showText(text.missionFailed,0,140,40,"flicker",.5)
|
||||
SFX.play("finesseError_long",.6)
|
||||
self:showText(text.missionFailed,0,140,40,'flicker',.5)
|
||||
SFX.play('finesseError_long',.6)
|
||||
finish=true
|
||||
end
|
||||
end
|
||||
@@ -1474,7 +1474,7 @@ do--Player.drop(self)--Place piece
|
||||
end
|
||||
function Player:loadAI(data)--Load AI params
|
||||
if not CC then
|
||||
data.type="9S"
|
||||
data.type='9S'
|
||||
data.delta=int(data.delta*.3)
|
||||
end
|
||||
self.AI_mode=data.type
|
||||
@@ -1492,13 +1492,13 @@ function Player:loadAI(data)--Load AI params
|
||||
bag=data.bag,
|
||||
node=data.node,
|
||||
}
|
||||
if self.AI_mode=="CC"then
|
||||
self:setRS("SRS")
|
||||
if self.AI_mode=='CC'then
|
||||
self:setRS('SRS')
|
||||
local opt,wei=CC.getConf()
|
||||
CC.fastWeights(wei)
|
||||
CC.setHold(opt,self.AIdata.hold)
|
||||
CC.set20G(opt,self.AIdata._20G)
|
||||
CC.setBag(opt,self.AIdata.bag=="bag")
|
||||
CC.setBag(opt,self.AIdata.bag=='bag')
|
||||
CC.setNode(opt,self.AIdata.node)
|
||||
self.AI_bot=CC.new(opt,wei)
|
||||
CC.free(opt)CC.free(wei)
|
||||
@@ -1509,7 +1509,7 @@ function Player:loadAI(data)--Load AI params
|
||||
self:setHold(1)
|
||||
end
|
||||
else
|
||||
self:setRS("TRS")
|
||||
self:setRS('TRS')
|
||||
end
|
||||
self.AI_thread=coroutine.wrap(AIFUNC[data.type])
|
||||
self.AI_thread(self,self.AI_keys)
|
||||
@@ -1539,7 +1539,7 @@ local function tick_throwBadge(ifAI,sender,time)
|
||||
SYSFX.newBadge(x1,y1,x2,y2)
|
||||
|
||||
if not ifAI and time%8==0 then
|
||||
SFX.play("collect")
|
||||
SFX.play('collect')
|
||||
end
|
||||
end
|
||||
if time<=0 then return end
|
||||
@@ -1596,7 +1596,7 @@ local function tick_autoPause()
|
||||
while true do
|
||||
yield()
|
||||
time=time+1
|
||||
if SCN.cur~="game"or PLAYERS[1].frameRun<180 then
|
||||
if SCN.cur~='game'or PLAYERS[1].frameRun<180 then
|
||||
return
|
||||
elseif time==120 then
|
||||
pauseGame()
|
||||
@@ -1639,7 +1639,7 @@ local function gameOver()--Save record
|
||||
end
|
||||
end
|
||||
if needSave then
|
||||
FILE.save(RANKS,"conf/unlock","q")
|
||||
FILE.save(RANKS,"conf/unlock",'q')
|
||||
end
|
||||
end
|
||||
local D=M.score(P)
|
||||
@@ -1653,12 +1653,12 @@ local function gameOver()--Save record
|
||||
end
|
||||
if p<10 then
|
||||
if p==0 then
|
||||
P:showTextF(text.newRecord,0,-100,100,"beat",.5)
|
||||
P:showTextF(text.newRecord,0,-100,100,'beat',.5)
|
||||
end
|
||||
D.date=os.date("%Y/%m/%d %H:%M")
|
||||
ins(L,p+1,D)
|
||||
if L[11]then L[11]=nil end
|
||||
FILE.save(L,"record/"..M.name..".rec","lq")
|
||||
FILE.save(L,"record/"..M.name..".rec",'lq')
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1688,7 +1688,7 @@ function Player:die()--Called both when win/lose!
|
||||
ins(GAME.rep,0)
|
||||
else
|
||||
if self.lastRecv and self.lastRecv.id==1 then
|
||||
SFX.play("collect")
|
||||
SFX.play('collect')
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1696,25 +1696,25 @@ end
|
||||
function Player:win(result)
|
||||
if self.result then return end
|
||||
self:die()
|
||||
self.result="WIN"
|
||||
self.result='win'
|
||||
if GAME.modeEnv.royaleMode then
|
||||
self.modeData.place=1
|
||||
self:changeAtk()
|
||||
end
|
||||
if self.type=="human"then
|
||||
GAME.result=result or"win"
|
||||
SFX.play("win")
|
||||
VOC.play("win")
|
||||
if self.type=='human'then
|
||||
GAME.result=result or'win'
|
||||
SFX.play('win')
|
||||
VOC.play('win')
|
||||
if GAME.modeEnv.royaleMode then
|
||||
BGM.play("8-bit happiness")
|
||||
BGM.play('8-bit happiness')
|
||||
end
|
||||
end
|
||||
if GAME.curMode.id=="custom_puzzle"then
|
||||
self:showTextF(text.win,0,0,90,"beat",.4)
|
||||
if GAME.curMode.id=='custom_puzzle'then
|
||||
self:showTextF(text.win,0,0,90,'beat',.4)
|
||||
else
|
||||
self:showTextF(text.win,0,0,90,"beat",.5,.2)
|
||||
self:showTextF(text.win,0,0,90,'beat',.5,.2)
|
||||
end
|
||||
if self.type=="human"then
|
||||
if self.type=='human'then
|
||||
gameOver()
|
||||
TASK.new(tick_autoPause)
|
||||
end
|
||||
@@ -1722,7 +1722,7 @@ function Player:win(result)
|
||||
end
|
||||
function Player:lose(force)
|
||||
if self.result then return end
|
||||
if self.type=="remote"and not force then self.waiting=1e99 return end
|
||||
if self.type=='remote'and not force then self.waiting=1e99 return end
|
||||
if self.life>0 and not force then
|
||||
self.waiting=62
|
||||
local h=#self.field
|
||||
@@ -1733,7 +1733,7 @@ function Player:lose(force)
|
||||
end
|
||||
self.garbageBeneath=0
|
||||
|
||||
if self.AI_mode=="CC"then
|
||||
if self.AI_mode=='CC'then
|
||||
CC.destroy(self.AI_bot)
|
||||
TABLE.cut(self.holdQueue)
|
||||
self:loadAI(self.AIdata)
|
||||
@@ -1757,8 +1757,8 @@ function Player:lose(force)
|
||||
SYSFX.newShade(1.4,self.fieldX,self.fieldY,300*self.size,610*self.size)
|
||||
SYSFX.newRectRipple(2,self.fieldX,self.fieldY,300*self.size,610*self.size)
|
||||
SYSFX.newRipple(2,self.x+(475+25*(self.life<3 and self.life or 0)+12)*self.size,self.y+(665+12)*self.size,20)
|
||||
SFX.play("clear_3")
|
||||
SFX.play("emit")
|
||||
SFX.play('clear_3')
|
||||
SFX.play('emit')
|
||||
|
||||
return
|
||||
end
|
||||
@@ -1769,7 +1769,7 @@ function Player:lose(force)
|
||||
break
|
||||
end
|
||||
end
|
||||
self.result="K.O."
|
||||
self.result='lose'
|
||||
if GAME.modeEnv.royaleMode then
|
||||
self:changeAtk()
|
||||
self.modeData.place=#PLY_ALIVE+1
|
||||
@@ -1792,7 +1792,7 @@ function Player:lose(force)
|
||||
end
|
||||
self.lastRecv=A
|
||||
if self.id==1 or A.id==1 then
|
||||
TASK.new(tick_throwBadge,not A.type=="human",self,max(3,self.badge)*4)
|
||||
TASK.new(tick_throwBadge,not A.type=='human',self,max(3,self.badge)*4)
|
||||
end
|
||||
end
|
||||
else
|
||||
@@ -1804,16 +1804,16 @@ function Player:lose(force)
|
||||
if #PLY_ALIVE==ROYALEDATA.stage[GAME.stage]then
|
||||
royaleLevelup()
|
||||
end
|
||||
self:showTextF(self.modeData.place,0,120,60,"appear",.26,.9)
|
||||
self:showTextF(self.modeData.place,0,120,60,'appear',.26,.9)
|
||||
end
|
||||
self.gameEnv.keepVisible=self.gameEnv.visible~="show"
|
||||
self:showTextF(text.gameover,0,0,60,"appear",.26,.9)
|
||||
if self.type=="human"then
|
||||
GAME.result="gameover"
|
||||
SFX.play("fail")
|
||||
VOC.play("lose")
|
||||
self.gameEnv.keepVisible=self.gameEnv.visible~='show'
|
||||
self:showTextF(text.gameover,0,0,60,'appear',.26,.9)
|
||||
if self.type=='human'then
|
||||
GAME.result='gameover'
|
||||
SFX.play('fail')
|
||||
VOC.play('lose')
|
||||
if GAME.modeEnv.royaleMode then
|
||||
BGM.play("end")
|
||||
BGM.play('end')
|
||||
end
|
||||
gameOver()
|
||||
self:newTask(#PLAYERS>1 and tick_lose or tick_finish)
|
||||
@@ -1845,11 +1845,11 @@ function Player:act_moveLeft(auto)
|
||||
elseif self.control and self.waiting==-1 then
|
||||
if self.cur and not self:ifoverlap(self.cur.bk,self.curX-1,self.curY)then
|
||||
if self.gameEnv.moveFX and self.gameEnv.block then
|
||||
self:createMoveFX("left")
|
||||
self:createMoveFX('left')
|
||||
end
|
||||
self.curX=self.curX-1
|
||||
self:freshBlock("move")
|
||||
if self.sound and self.curY==self.ghoY then SFX.play("move")end
|
||||
self:freshBlock('move')
|
||||
if self.sound and self.curY==self.ghoY then SFX.play('move')end
|
||||
if not auto then self.moving=0 end
|
||||
self.spinLast=false
|
||||
else
|
||||
@@ -1872,11 +1872,11 @@ function Player:act_moveRight(auto)
|
||||
elseif self.control and self.waiting==-1 then
|
||||
if self.cur and not self:ifoverlap(self.cur.bk,self.curX+1,self.curY)then
|
||||
if self.gameEnv.moveFX and self.gameEnv.block then
|
||||
self:createMoveFX("right")
|
||||
self:createMoveFX('right')
|
||||
end
|
||||
self.curX=self.curX+1
|
||||
self:freshBlock("move")
|
||||
if self.sound and self.curY==self.ghoY then SFX.play("move")end
|
||||
self:freshBlock('move')
|
||||
if self.sound and self.curY==self.ghoY then SFX.play('move')end
|
||||
if not auto then self.moving=0 end
|
||||
self.spinLast=false
|
||||
else
|
||||
@@ -1922,7 +1922,7 @@ function Player:act_hardDrop()
|
||||
self.curY=self.ghoY
|
||||
self.spinLast=false
|
||||
if self.sound then
|
||||
SFX.play("drop",nil,self:getCenterX()*.15)
|
||||
SFX.play('drop',nil,self:getCenterX()*.15)
|
||||
VIB(1)
|
||||
end
|
||||
end
|
||||
@@ -1946,7 +1946,7 @@ function Player:act_softDrop()
|
||||
if self.control and self.waiting==-1 and self.cur then
|
||||
if self.curY>self.ghoY then
|
||||
self.curY=self.curY-1
|
||||
self:freshBlock("fresh")
|
||||
self:freshBlock('fresh')
|
||||
self.spinLast=false
|
||||
elseif ENV.deepDrop then
|
||||
local CB=self.cur.bk
|
||||
@@ -1959,8 +1959,8 @@ function Player:act_softDrop()
|
||||
self:createDropFX(self.curX,self.curY-1,#CB[1],self.curY-y-#CB+1)
|
||||
end
|
||||
self.curY=y
|
||||
self:freshBlock("move")
|
||||
SFX.play("swipe")
|
||||
self:freshBlock('move')
|
||||
SFX.play('swipe')
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1983,10 +1983,10 @@ function Player:act_insLeft(auto)
|
||||
local x0=self.curX
|
||||
while not self:ifoverlap(self.cur.bk,self.curX-1,self.curY)do
|
||||
if self.gameEnv.moveFX and self.gameEnv.block then
|
||||
self:createMoveFX("left")
|
||||
self:createMoveFX('left')
|
||||
end
|
||||
self.curX=self.curX-1
|
||||
self:freshBlock("move")
|
||||
self:freshBlock('move')
|
||||
end
|
||||
if self.curX~=x0 then
|
||||
self.spinLast=false
|
||||
@@ -2005,10 +2005,10 @@ function Player:act_insRight(auto)
|
||||
local x0=self.curX
|
||||
while not self:ifoverlap(self.cur.bk,self.curX+1,self.curY)do
|
||||
if self.gameEnv.moveFX and self.gameEnv.block then
|
||||
self:createMoveFX("right")
|
||||
self:createMoveFX('right')
|
||||
end
|
||||
self.curX=self.curX+1
|
||||
self:freshBlock("move")
|
||||
self:freshBlock('move')
|
||||
end
|
||||
if self.curX~=x0 then
|
||||
self.spinLast=false
|
||||
@@ -2035,16 +2035,16 @@ function Player:act_insDown()
|
||||
self.curY=self.ghoY
|
||||
self.lockDelay=ENV.lock
|
||||
self.spinLast=false
|
||||
self:freshBlock("fresh")
|
||||
self:freshBlock('fresh')
|
||||
end
|
||||
end
|
||||
function Player:act_down1()
|
||||
if self.cur and self.curY>self.ghoY then
|
||||
if self.gameEnv.moveFX and self.gameEnv.block then
|
||||
self:createMoveFX("down")
|
||||
self:createMoveFX('down')
|
||||
end
|
||||
self.curY=self.curY-1
|
||||
self:freshBlock("fresh")
|
||||
self:freshBlock('fresh')
|
||||
self.spinLast=false
|
||||
end
|
||||
end
|
||||
@@ -2056,7 +2056,7 @@ function Player:act_down4()
|
||||
self:createDropFX(self.curX,self.curY-1,#CB[1],self.curY-y-#CB+1)
|
||||
end
|
||||
self.curY=y
|
||||
self:freshBlock("fresh")
|
||||
self:freshBlock('fresh')
|
||||
self.spinLast=false
|
||||
end
|
||||
end
|
||||
@@ -2068,7 +2068,7 @@ function Player:act_down10()
|
||||
self:createDropFX(self.curX,self.curY-1,#CB[1],self.curY-y-#CB+1)
|
||||
end
|
||||
self.curY=y
|
||||
self:freshBlock("fresh")
|
||||
self:freshBlock('fresh')
|
||||
self.spinLast=false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -104,7 +104,7 @@ local function updateTasks(P)
|
||||
for i=#L,1,-1 do
|
||||
local tr=L[i].thread
|
||||
assert(resume(tr))
|
||||
if status(tr)=="dead"then
|
||||
if status(tr)=='dead'then
|
||||
rem(L,i)
|
||||
end
|
||||
end
|
||||
@@ -119,12 +119,12 @@ function update.alive(P,dt)
|
||||
P.frameRun=P.frameRun+1
|
||||
if P.frameRun<=180 then
|
||||
if P.frameRun==180 then
|
||||
if P.id==1 then SFX.play("start")end
|
||||
if P.id==1 then SFX.play('start')end
|
||||
P.control=true
|
||||
P.timing=true
|
||||
P:popNext()
|
||||
elseif P.frameRun==60 or P.frameRun==120 then
|
||||
if P.id==1 then SFX.play("ready")end
|
||||
if P.id==1 then SFX.play('ready')end
|
||||
end
|
||||
if P.movDir~=0 then
|
||||
if P.moving<P.gameEnv.das then
|
||||
@@ -163,7 +163,7 @@ function update.alive(P,dt)
|
||||
end
|
||||
end
|
||||
|
||||
if P.type=="computer"and P.control and P.waiting==-1 then
|
||||
if P.type=='computer'and P.control and P.waiting==-1 then
|
||||
local C=P.AI_keys
|
||||
P.AI_delay=P.AI_delay-1
|
||||
if not C[1]then
|
||||
@@ -172,7 +172,7 @@ function update.alive(P,dt)
|
||||
end
|
||||
elseif P.AI_delay<=0 then
|
||||
P:pressKey(C[1])P:releaseKey(C[1])
|
||||
if P.AI_mode~="CC"or C[1]>3 then
|
||||
if P.AI_mode~='CC'or C[1]>3 then
|
||||
P.AI_delay=P.AI_delay0*2
|
||||
else
|
||||
P.AI_delay=P.AI_delay0*.5
|
||||
@@ -283,7 +283,7 @@ function update.alive(P,dt)
|
||||
goto stop
|
||||
else
|
||||
local L=#P.clearingRow
|
||||
if P.sound and ENV.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play("fall")end
|
||||
if P.sound and ENV.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play('fall')end
|
||||
P.clearingRow={}
|
||||
end
|
||||
end
|
||||
@@ -307,7 +307,7 @@ function update.alive(P,dt)
|
||||
|
||||
if D==1 then
|
||||
if ENV.moveFX and ENV.block then
|
||||
P:createMoveFX("down")
|
||||
P:createMoveFX('down')
|
||||
end
|
||||
P.curY=P.curY-1
|
||||
else
|
||||
@@ -315,19 +315,19 @@ function update.alive(P,dt)
|
||||
if D>P.curY-P.ghoY then D=P.curY-P.ghoY end
|
||||
if ENV.moveFX and ENV.block then
|
||||
for _=1,D do
|
||||
P:createMoveFX("down")
|
||||
P:createMoveFX('down')
|
||||
P.curY=P.curY-1
|
||||
end
|
||||
else
|
||||
P.curY=P.curY-D
|
||||
end
|
||||
end
|
||||
P:freshBlock("fresh")
|
||||
P:freshBlock('fresh')
|
||||
P.spinLast=false
|
||||
|
||||
if P.ghoY~=P.curY then
|
||||
P.dropDelay=ENV.drop
|
||||
elseif P.AI_mode=="CC"and P.AI_bot then
|
||||
elseif P.AI_mode=='CC'and P.AI_bot then
|
||||
CC.updateField(P)
|
||||
if not P.AIdata._20G and ENV.drop<P.AI_delay0*.5 then
|
||||
CC.switch20G(P)
|
||||
@@ -337,7 +337,7 @@ function update.alive(P,dt)
|
||||
P.lockDelay=P.lockDelay-1
|
||||
if P.lockDelay>=0 then goto stop end
|
||||
P:drop()
|
||||
if P.AI_mode=="CC"and P.AI_bot then
|
||||
if P.AI_mode=='CC'and P.AI_bot then
|
||||
CC.updateField(P)
|
||||
end
|
||||
end
|
||||
@@ -378,7 +378,7 @@ function update.dead(P,dt)
|
||||
P.falling=P.falling-1
|
||||
if P.falling<0 then
|
||||
local L=#P.clearingRow
|
||||
if P.sound and P.gameEnv.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play("fall")end
|
||||
if P.sound and P.gameEnv.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play('fall')end
|
||||
P.clearingRow={}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user