local gc=love.graphics local gc_push,gc_pop,gc_clear,gc_origin=gc.push,gc.pop,gc.clear,gc.origin local gc_translate,gc_scale,gc_rotate=gc.translate,gc.scale,gc.rotate local gc_setCanvas,gc_setShader=gc.setCanvas,gc.setShader local gc_draw,gc_line,gc_rectangle=gc.draw,gc.line,gc.rectangle local gc_print,gc_printf=gc.print,gc.printf local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth local gc_stencil,gc_setStencilTest=gc.stencil,gc.setStencilTest local int,ceil,rnd=math.floor,math.ceil,math.random local max,min,sin,modf=math.max,math.min,math.sin,math.modf local setFont,mDraw,mStr=setFont,mDraw,mStr local SKIN,TEXTURE,IMG=SKIN,TEXTURE,IMG local TEXT,COLOR,GAME,TIME=TEXT,COLOR,GAME,TIME local shader_alpha,shader_lighter=SHADER.alpha,SHADER.lighter local shader_fieldSatur,shader_blockSatur=SHADER.fieldSatur,SHADER.blockSatur local drawableText,missionEnum,minoColor=drawableText,missionEnum,minoColor local RCPB={10,33,200,33,105,5,105,60} local attackColor={ {COLOR.dH,COLOR.Z}, {COLOR.H,COLOR.Z}, {COLOR.lV,COLOR.Z}, {COLOR.lR,COLOR.Z}, {COLOR.dG,COLOR.C}, } local hideBoardStencil={ up=function()gc_rectangle('fill',0,-600,300,300,6)end, down=function()gc_rectangle('fill',0,-300,300,300,6)end, all=function()gc_rectangle('fill',0,-600,300,600,6)end, } local dialFrame=GC.DO{80,80, {'setLW',3}, {'dCirc',40,40,38}, } local dialNeedle=GC.DO{32,3, {'setLW',3}, {'fRect',0,0,32,3,2}, {'setCL',1,.3,.3}, {'fRect',0,0,12,3,2}, } local multiple=GC.DO{15,15, {'setLW',3}, {'line',2,2,12,12}, {'line',2,12,12,2}, } local playerBoarder=GC.DO{334,620, {'setLW',2}, {'setCL',.97,.97,.97}, {'dRect',16,1,302,618,5}, {'fRect',17,612,300,2}, {'dRect',318,10,15,604,3}, {'dRect',1,10,15,604,3}, } local gridLines do local L={300,640,{'setLW',2}} for x=1,9 do table.insert(L,{'line',30*x,0,30*x,640})end for y=0,20 do table.insert(L,{'line',0,10+30*y,300,10+30*y})end gridLines=GC.DO(L) end local LDmarks=gc.newSpriteBatch(GC.DO{14,5,{'fRect',0,0,14,5,3}},15,'static') for i=0,14 do LDmarks:add(3+20*i,615)end local function boardTransform(mode) if mode then if mode=="U-D"then gc_translate(0,590) gc_scale(1,-1) elseif mode=="L-R"then gc_translate(300,0) gc_scale(-1,1) elseif mode=="180"then gc_translate(300,590) gc_scale(-1,-1) end end end local function stencilBoard()gc_rectangle('fill',0,-10,300,610)end local function applyField(P) gc_push('transform') --Apply fieldOffset local O=P.fieldOff gc_translate(O.x+150+150,O.y+300) gc_rotate(O.a) gc_translate(-150,-300) --Apply stencil gc_stencil(stencilBoard) gc_setStencilTest('equal',1) --Move camera gc_push('transform') boardTransform(P.gameEnv.flipBoard) gc_translate(0,P.fieldBeneath+P.fieldUp) end local function cancelField() gc_setStencilTest() gc_pop() gc_pop() end local function drawRow(texture,h,V,L,showInvis) local t=TIME()*4 for i=1,10 do if L[i]>0 then if V[i]>0 then gc_setColor(1,1,1,V[i]*.05) gc_draw(texture[L[i]],30*i-30,-30*h) 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) end end end end local function drawField(P,showInvis) local ENV=P.gameEnv local V,F=P.visTime,P.field local start=int((P.fieldBeneath+P.fieldUp)/30+1) local texture=P.skinLib if P.falling==-1 then--Blocks only if ENV.upEdge then gc_setShader(shader_lighter) gc_translate(0,-4) -- for j=start,min(start+21,#F)do drawRow(texture,j,V[j],F[j])end -- gc_setShader(shader_fieldSatur) gc_translate(0,4) end -- for j=start,min(start+21,#F)do drawRow(texture,j,V[j],F[j],showInvis)end -- else--With falling animation local stepY=ENV.smooth and(P.falling/(ENV.fall+1))^2.5*30 or 30 local alpha=P.falling/ENV.fall local h=1 if ENV.upEdge then gc_push('transform') gc_setShader(shader_lighter) gc_translate(0,-4) -- for j=start,min(start+21,#F)do while j==P.clearingRow[h]do h=h+1 gc_translate(0,-stepY) end drawRow(texture,j,V[j],F[j]) end -- gc_setShader(shader_fieldSatur) gc_pop() h=1 end gc_push('transform') -- 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) end drawRow(texture,j,V[j],F[j],showInvis) end -- gc_pop() end gc_setShader() end local function drawFXs(P) --LockFX for i=1,#P.lockFX do 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) else gc_setColor(1,1,1,2-2*S[3]) gc_rectangle('fill',S[1]+30,S[2],60*S[3]-60,30) end end --DropFX for i=1,#P.dropFX do 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]) end --MoveFX local texture=P.skinLib for i=1,#P.moveFX do local S=P.moveFX[i] gc_setColor(1,1,1,.6-S[4]*.6) gc_draw(texture[S[1]],30*S[2]-30,-30*S[3]) end --ClearFX for i=1,#P.clearFX do local S=P.clearFX[i] local t=S[2] 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) end end local drawGhost={ color=function(CB,curX,ghoY,alpha,texture,clr) gc_setColor(1,1,1,alpha) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_draw(texture[clr],30*(j+curX-1)-30,-30*(i+ghoY-1)) end end end end, gray=function(CB,curX,ghoY,alpha,texture,_) gc_setColor(1,1,1,alpha) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_draw(texture[21],30*(j+curX-1)-30,-30*(i+ghoY-1)) end end end end, colorCell=function(CB,curX,ghoY,alpha,_,clr) clr=minoColor[clr] gc_setColor(clr[1],clr[2],clr[3],alpha) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_rectangle('fill',30*(j+curX-1)-30,-30*(i+ghoY-1),30,30) end end end end, grayCell=function(CB,curX,ghoY,alpha,_,_) gc_setColor(1,1,1,alpha) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_rectangle('fill',30*(j+curX-1)-30,-30*(i+ghoY-1),30,30) end end end end, colorLine=function(CB,curX,ghoY,alpha,_,clr) clr=minoColor[clr] gc_setColor(clr[1],clr[2],clr[3],alpha) gc_setLineWidth(4) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_rectangle('line',30*(j+curX-1)-30+4,-30*(i+ghoY-1)+4,22,22) end end end end, grayLine=function(CB,curX,ghoY,alpha,_,_) gc_setColor(1,1,1,alpha) gc_setLineWidth(4) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_rectangle('line',30*(j+curX-1)-30+4,-30*(i+ghoY-1)+4,22,22) end end end end, } local function drawBlockOutline(CB,curX,curY,texture,trans) shader_alpha:send('a',trans) gc_setShader(shader_alpha) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then local x=30*(j+curX)-60-3 local y=30-30*(i+curY)-3 gc_draw(texture,x,y) gc_draw(texture,x+6,y+6) gc_draw(texture,x+6,y) gc_draw(texture,x,y+6) end end end gc_setShader() end local function drawBlockShade(CB,curX,curY,alpha) gc_setColor(1,1,1,alpha) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_rectangle('fill',30*(j+curX)-60,30-30*(i+curY),30,30) end end end end local function drawBlock(CB,curX,curY,texture) gc_setColor(1,1,1) gc_setShader(shader_blockSatur) for i=1,#CB do for j=1,#CB[1]do if CB[i][j]then gc_draw(texture,30*(j+curX-1)-30,-30*(i+curY-1)) end end end gc_setShader() end local function drawNextPreview(B,fieldH,fieldBeneath) gc_setColor(1,1,1,.8) local y=int(fieldH+1-modf(B.sc[1]))+ceil(fieldBeneath/30) B=B.bk local x=int(6-#B[1]*.5) local cross=TEXTURE.puzzleMark[-1] for i=1,#B do for j=1,#B[1]do if B[i][j]then gc_draw(cross,30*(x+j-2),30*(1-y-i)) end end end end local function drawBuffer(atkBuffer,bufferWarn,atkBufferSum1,atkBufferSum) local h=0 for i=1,#atkBuffer do local A=atkBuffer[i] local bar=A.amount*30 if h+bar>600 then bar=600-h end if not A.sent then --Appear if A.time<20 then bar=bar*(20*A.time)^.5*.05 end if A.countdown>0 then --Timing gc_setColor(attackColor[A.lv][1]) gc_rectangle('fill',303,600-h-bar,11,bar,2) gc_setColor(1,1,1) for j=30,A.cd0-30,30 do gc_rectangle('fill',303,600-h-bar*(j/A.cd0),6,2) end gc_setColor(attackColor[A.lv][2]) gc_rectangle('fill',303,600-h-bar,11,bar*(1-A.countdown/A.cd0),2) 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,600-h-bar,11,bar,2) end else gc_setColor(attackColor[A.lv][1]) bar=bar*(20-A.time)*.05 gc_rectangle('fill',303,600-h-bar,11,bar,2) --Disappear end h=h+bar end if bufferWarn then local sum=atkBufferSum1 if sum>=8 then gc_push('transform') gc_translate(300,max(0,600-30*sum)) gc_scale(min(.2+sum/50,1)) gc_setColor(1,.2+min(sum*.02,.8)*(.5+.5*sin(TIME()*min(sum,32))),.2,min(sum/30,.8)) setFont(100) if sum>20 then local d=atkBufferSum-sum if d>.5 then gc_translate(d^.5*(rnd()-.5)*15,d^.5*(rnd()-.5)*15) end end gc_printf(int(sum),-300,-20,292,'right') gc_pop() end end end local function drawB2Bbar(b2b,b2b1) local a,b=b2b,b2b1 if a>b then a,b=b,a end if b>0 then gc_setColor(.8,1,.2) gc_rectangle('fill',-14,600-b*.6,11,b*.6,2) gc_setColor(b2b<50 and COLOR.Z or b2b<=800 and COLOR.lR or COLOR.lB) gc_rectangle('fill',-14,600-a*.6,11,a*.6,2) if TIME()%.5<.3 then gc_setColor(1,1,1) gc_rectangle('fill',-15,b<50 and 570 or 120,13,3,2) end end end local function drawLDI(easyFresh,length,freshTime)--Lock Delay Indicator if easyFresh then gc_setColor(.97,.97,.97) else gc_setColor(1,.5,.5) end if length>=0 then gc_rectangle('fill',0,602,300*length,4) end if freshTime>0 then LDmarks:setDrawRange(1,min(freshTime,15)) gc_draw(LDmarks) end end local function drawHold(holdQueue,holdCount,holdTime,skinLib) local N=holdCount*72 gc_push('transform') gc_translate(12,20) gc_setLineWidth(2) gc_setColor(0,0,0,.4)gc_rectangle('fill',0,0,100,N+8,5) gc_setColor(.97,.97,.97)gc_rectangle('line',0,0,100,N+8,5) N=#holdQueue2 then local S=P.stat local t=P.finesseComboTime local str=P.finesseCombo.."x" if S.finesseRate==5*S.piece then gc_setColor(.9,.9,.3,t*.2) gc_print(str,20,570) gc_setColor(.9,.9,.3,1.2-t*.1) elseif S.maxFinesseCombo==S.piece then gc_setColor(.7,.7,1,t*.2) gc_print(str,20,570) gc_setColor(.7,.7,1,1.2-t*.1) else gc_setColor(1,1,1,t*.2) gc_print(str,20,570) gc_setColor(1,1,1,1.2-t*.1) end gc_print(str,20,600,nil,1+t*.08,nil,0,30) end end local function drawFinesseCombo_remote(P) if P.finesseCombo>2 then local S=P.stat if S.finesseRate==5*S.piece then gc_setColor(.9,.9,.3) elseif S.maxFinesseCombo==S.piece then gc_setColor(.7,.7,1) else gc_setColor(.97,.97,.97) end gc_print(P.finesseCombo.."x",20,570) end end local function drawLife(life) gc_setColor(.97,.97,.97) gc_draw(IMG.lifeIcon,475,595,nil,.8) if life>3 then gc_draw(multiple,502,602) setFont(20)gc_print(life,517,595) else if life>1 then gc_draw(IMG.lifeIcon,500,595,nil,.8)end if life>2 then gc_draw(IMG.lifeIcon,525,595,nil,.8)end end end local function drawMission(curMission,L,missionkill) --Draw current mission setFont(35) if missionkill then gc_setColor(1,.7+.2*sin(TIME()*6.26),.4) else gc_setColor(.97,.97,.97) end gc_print(missionEnum[L[curMission]],85,110) --Draw next mission setFont(20) for i=1,3 do local m=L[curMission+i] if m then m=missionEnum[m] gc_print(m,87-28*i,117) else break end end end local function drawStartCounter(time) time=179-time gc_push('transform') gc_translate(300,300) local num=int(time/60)+1 local d=time%60 if num==3 then gc_setColor(.7,.8,.98) if d>45 then gc_rotate((d-45)^2*.00355)end elseif num==2 then gc_setColor(.98,.85,.75) if d>45 then gc_scale(1+(d/15-3)^2,1)end elseif num==1 then gc_setColor(1,.7,.7) if d>45 then gc_scale(1,1+(d/15-3)^2)end end if d<20 then gc_scale((d/20)^.4)end setFont(100) mStr(num,0,-70) gc_pop() end local draw={} draw.drawGhost=drawGhost draw.applyField=applyField draw.cancelField=cancelField function draw.drawNext_norm(P,repMode) local ENV=P.gameEnv local texture=P.skinLib gc_translate(488,20) gc_setLineWidth(2) local N=ENV.nextCount*72 gc_setColor(0,0,0,.4)gc_rectangle('fill',0,0,100,N+8,5) gc_setColor(.97,.97,.97)gc_rectangle('line',0,0,100,N+8,5) N=1 gc_push('transform') gc_translate(50,40) gc_setColor(1,1,1) --Draw nexts gc_setShader(shader_blockSatur) local queue=P.nextQueue while N<=ENV.nextCount and queue[N]do local bk,sprite=queue[N].bk,texture[queue[N].color] local k=min(2.3/#bk,3/#bk[1],.85) gc_scale(k) for i=1,#bk do for j=1,#bk[1]do if bk[i][j]then gc_draw(sprite,30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5)) end end end gc_scale(1/k) N=N+1 gc_translate(0,72) end gc_setShader() --Draw more nexts if repMode then gc_translate(50,-28) local blockImg=TEXTURE.miniBlock local skinSet=ENV.skin local n=N while n<=12 and queue[n]do local id=queue[n].id local _=minoColor[skinSet[id]] gc_setColor(_[1],_[2],_[3],.2) _=blockImg[id] local h=_:getHeight() gc_draw(_,-_:getWidth()*10,0,nil,10,nil) gc_translate(0,10*h+3) n=n+1 end end gc_pop() if ENV.bagLine then gc_setColor(.8,.5,.5) for i=-P.pieceCount%ENV.bagLine,N-1,ENV.bagLine do--i=phase gc_rectangle('fill',2,72*i+3,96,2) end end gc_translate(-488,-20) end function draw.drawNext_hidden(P,repMode) local ENV=P.gameEnv local texture=P.skinLib gc_translate(488,20) gc_setLineWidth(2) local N=ENV.nextCount*72 gc_setColor(.5,0,0,.4)gc_rectangle('fill',0,0,100,N+8,5) gc_setColor(.97,.97,.97)gc_rectangle('line',0,0,100,N+8,5) local startN=min(ENV.nextStartPos,P.pieceCount+1) if repMode then gc_setColor(1,1,1,.2) N=1 else gc_setColor(1,1,1) N=startN end gc_push('transform') gc_translate(50,72*N-32) --Draw nexts gc_setShader(shader_blockSatur) local queue=P.nextQueue while N<=ENV.nextCount and queue[N]do if N==startN then gc_setColor(1,1,1)end local bk,sprite=queue[N].bk,texture[queue[N].color] local k=min(2.3/#bk,3/#bk[1],.85) gc_scale(k) for i=1,#bk do for j=1,#bk[1]do if bk[i][j]then gc_draw(sprite,30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5)) end end end gc_scale(1/k) N=N+1 gc_translate(0,72) end gc_setShader() --Draw more nexts if repMode then gc_translate(50,-28) local blockImg=TEXTURE.miniBlock local skinSet=ENV.skin local n=N while n<=12 and queue[n]do local id=queue[n].id local _=minoColor[skinSet[id]] gc_setColor(_[1],_[2],_[3],.2) _=blockImg[id] local h=_:getHeight() gc_draw(_,-_:getWidth()*10,0,nil,10,nil) gc_translate(0,10*h+3) n=n+1 end end gc_pop() if ENV.bagLine then gc_setColor(.8,.5,.5) for i=-P.pieceCount%ENV.bagLine,N-1,ENV.bagLine do--i=phase gc_rectangle('fill',2,72*i+3,96,2) end end gc_translate(-476,-20) end function draw.drawTargetLine(P,r) if r<=20+(P.fieldBeneath+P.fieldUp+10)/30 and r>0 then gc_setLineWidth(3) gc_setColor(1,r>10 and 0 or .2+.8*rnd(),.5) applyField(P) r=600-30*r gc_line(0,r,300,r) cancelField() end end function draw.drawProgress(s1,s2) setFont(40) mStr(s1,62,322) mStr(s2,62,376) gc_rectangle('fill',24,375,76,4,2) end function draw.drawRoyaleInfo(P) setFont(35) mStr(#PLY_ALIVE.."/"..#PLAYERS,63,175) mStr(P.modeData.ko,80,215) gc_draw(drawableText.ko,60-drawableText.ko:getWidth(),222) setFont(20) gc_setColor(1,.5,0,.6) gc_print(P.badge,103,227) gc_setColor(.97,.97,.97) setFont(25) mStr(text.powerUp[P.strength],63,290) gc_setColor(1,1,1) for i=1,P.strength do gc_draw(IMG.badgeIcon,16*i+6,260) end end function draw.norm(P,repMode) local ENV=P.gameEnv local FBN,FUP=P.fieldBeneath,P.fieldUp local camDY=FBN+FUP local t=TIME() gc_push('transform') gc_translate(P.x,P.y) gc_scale(P.size) --Draw username setFont(30) gc_setColor(.97,.97,.97) mStr(P.username,300,-60) --Draw HUD P:drawNext(repMode) if P.curMission then drawMission(P.curMission,ENV.mission,ENV.missionKill)end if ENV.holdCount>0 then drawHold(P.holdQueue,ENV.holdCount,P.holdTime,P.skinLib)end drawDial(499,505,P.dropSpeed) if P.life>0 then drawLife(P.life)end --Field-related things applyField(P) --Fill field gc_setColor(0,0,0,.6) gc_rectangle('fill',0,-10-camDY,300,610) --Draw grid if ENV.grid then gc_setColor(1,1,1,ENV.grid) gc_draw(gridLines,0,-40-(camDY-camDY%30)) end gc_translate(0,600) local fieldTop=-ENV.fieldH*30 --Draw dangerous area if fieldTop-camDY<610 then gc_setColor(1,0,0,.26) gc_rectangle('fill',0,fieldTop,300,-10-camDY-(600-fieldTop)) end --Draw field drawField(P,repMode) --Draw line number if ENV.fieldH>20 and ENV.lineNum then local a=ENV.lineNum setFont(20) local dy=camDY<900 and 0 or camDY-camDY%300-600 for i=1,3 do local num=10+10*i+dy/30 local y=-325-300*i-dy gc_setColor(0,0,0,a) gc.print(num,1,y) gc.print(num,2,y+1) gc_setColor(.97,.97,.97,a) gc.print(num,2,y) gc.print(num,2,y) end end --Draw spawn line gc_setLineWidth(4) gc_setColor(1,sin(t)*.4+.5,0,.5) gc_rectangle('fill',0,fieldTop,300,4) --Draw height limit line gc_setColor(.4,.7+sin(t*12)*.3,1,.7) gc_rectangle('fill',0,-ENV.heightLimit*30-FBN-2,300,4) --Draw FXs drawFXs(P) --Draw current block if P.cur and P.waiting==-1 then local C=P.cur local curColor=C.color local trans=P.lockDelay/ENV.lock local centerX=30*(P.curX+C.sc[2])-20 --Draw ghost & rotation center local centerDisp=ENV.center and P.RS.centerDisp[C.id] if ENV.ghost then drawGhost[ENV.ghostType](P.cur.bk,P.curX,P.ghoY,ENV.ghost,P.skinLib,curColor) if centerDisp then gc_setColor(1,1,1,ENV.center) gc_draw(P.RS.centerTex,centerX,-30*(P.ghoY+C.sc[1])+10) end elseif repMode then drawGhost.gray(P.cur.bk,P.curX,P.ghoY,.15,nil,nil) end local dy=ENV.smooth and P.ghoY~=P.curY and(P.dropDelay/ENV.drop-1)*30 or 0 gc_translate(0,-dy) --Draw block & rotation center if ENV.block then drawBlockOutline(P.cur.bk,P.curX,P.curY,P.skinLib[curColor],trans) drawBlock(P.cur.bk,P.curX,P.curY,P.skinLib[curColor]) if centerDisp then gc_setColor(1,1,1,ENV.center) gc_draw(P.RS.centerTex,centerX,-30*(P.curY+C.sc[1])+10) end elseif repMode then drawBlockShade(P.cur.bk,P.curX,P.curY,trans*.3) end gc_translate(0,dy) end --Draw next preview if ENV.nextPos and P.nextQueue[1]then drawNextPreview(P.nextQueue[1],ENV.fieldH,P.fieldBeneath) end --Draw AI's drop destination if P.AI_dest then local texture=TEXTURE.puzzleMark[21] local L=P.AI_dest for i=1,#L,2 do gc_draw(texture,30*L[i],-30*L[i+1]-30) end end --Board cover if ENV.hideBoard then gc_stencil(hideBoardStencil[ENV.hideBoard]) gc_setStencilTest('equal',1) local alpha if repMode then gc_setLineWidth(18.8) alpha=.7 else gc_setLineWidth(20) alpha=1 end for i=0,24 do local l=.32+.05*sin(i*.26+t*.2) gc_setColor(l,l,l,alpha) gc_line(20*i-190,-602,20*i+10,2) end end gc_translate(0,-600) gc_setStencilTest() gc_pop() --Draw Frame and buffers gc_setColor(P.frameColor) gc_draw(playerBoarder,-17,-12) drawBuffer(P.atkBuffer,ENV.bufferWarn,P.atkBufferSum1,P.atkBufferSum) drawB2Bbar(P.b2b,P.b2b1) drawLDI(ENV.easyFresh,P.lockDelay/ENV.lock,P.freshTime) --Draw target selecting pad 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) end gc_setColor(1,1,1,P.swappingAtkMode*.025) setFont(35) gc_setLineWidth(1) for i=1,4 do 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 --Spike local sp,spt=P.spike,P.spikeTime if ENV.showSpike and spt>0 and sp>=10 then local rg=10/sp gc_setColor(rg,rg,1,min(spt/30,.8)) local x,y=150,100 if spt>85 then local d=2*(spt-85)*min(sp/50,1) x,y=x+(rnd()-.5)*d,y+(rnd()-.5)*d end mDraw(P.spikeText,x,y,nil,min(.3+(sp/26)*.4+spt/100*.3,1)) end --Bonus texts TEXT.draw(P.bonus) --Display Ys -- gc_setLineWidth(6) -- if P.curY then gc_setColor(COLOR.R) gc_line(0,611-P.curY*30,300,610-P.curY*30)end -- if P.ghoY then gc_setColor(COLOR.G) gc_line(0,615-P.ghoY*30,300,615-P.ghoY*30)end -- if P.minY then gc_setColor(COLOR.B) gc_line(0,619-P.minY*30,300,620-P.minY*30)end -- gc_line(0,600-P.garbageBeneath*30,300,600-P.garbageBeneath*30) gc_pop() --Score & Time setFont(25) local tm=int(P.stat.time*100)*.01 gc_setColor(0,0,0,.3) gc_print(P.score1,18,509) gc_print(tm,18,539) gc_setColor(.97,.97,.92) gc_print(P.score1,20,510) gc_setColor(.85,.9,.97) gc_print(tm,20,540) --FinesseCombo ;(P.type=='remote'and drawFinesseCombo_remote or drawFinesseCombo_norm)(P) --Mode informations if GAME.curMode.mesDisp then gc_setColor(.97,.97,.97) GAME.curMode.mesDisp(P) end if P.frameRun<180 then drawStartCounter(P.frameRun)end gc_pop() end function draw.small(P) --Update canvas P.frameWait=P.frameWait-1 if P.frameWait==0 then P.frameWait=10 gc_setCanvas(P.canvas) gc_clear(0,0,0,.4) gc_push('transform') gc_origin() gc_setColor(1,1,1,P.result and max(20-P.endCounter,0)*.05 or 1) --Field local F=P.field local texture=SKIN.libMini[SETTING.skinSet] for j=1,#F do for i=1,10 do if F[j][i]>0 then gc_draw(texture[F[j][i]],6*i-6,120-6*j) end end end --Draw boarder if P.alive then gc_setLineWidth(2) gc_setColor(P.frameColor) gc_rectangle('line',0,0,60,120) end --Draw badge if GAME.modeEnv.royaleMode then gc_setColor(1,1,1) for i=1,P.strength do gc_draw(IMG.badgeIcon,12*i-7,4,nil,.5) end end --Draw result if P.result then gc_setColor(1,1,1,min(P.endCounter,60)*.01) setFont(20)mDraw(drawableText[P.result],30,60,nil,P.size) setFont(15)mStr(P.modeData.place,30,82) end gc_pop() gc_setCanvas() end --Draw Canvas gc_setColor(1,1,1) local size=P.size gc_draw(P.canvas,P.x,P.y,nil,size*10) if P.killMark then gc_setColor(1,0,0) gc_rectangle('fill',P.x+40*size,P.y+40*size,160*size,160*size) end end function draw.demo(P) local ENV=P.gameEnv local curColor=P.cur.color --Camera gc_push('transform') gc_translate(P.x,P.y) gc_scale(P.size) gc_translate(-150,0) applyField(P) gc_setStencilTest() gc_setColor(0,0,0,.6) gc_rectangle('fill',0,0,300,600,3) gc_push('transform') gc_translate(0,600) drawField(P) drawFXs(P) if P.cur and P.waiting==-1 then if ENV.ghost then drawGhost[ENV.ghostType](P.cur.bk,P.curX,P.ghoY,ENV.ghost,P.skinLib,curColor)end if ENV.block then local dy=ENV.smooth and P.ghoY~=P.curY and(P.dropDelay/ENV.drop-1)*30 or 0 gc_translate(0,-dy) drawBlockOutline(P.cur.bk,P.curX,P.curY,P.skinLib[curColor],P.lockDelay/ENV.lock) drawBlock(P.cur.bk,P.curX,P.curY,P.skinLib[curColor]) gc_translate(0,dy) end end gc_pop() local blockImg=TEXTURE.miniBlock local skinSet=ENV.skin --Draw hold local N=1 while P.holdQueue[N]do local id=P.holdQueue[N].id local _=minoColor[skinSet[id]] gc_setColor(_[1],_[2],_[3],.3) _=blockImg[id] gc_draw(_,15,40*N-10,nil,16,nil,0,_:getHeight()*.5) N=N+1 end --Draw next N=1 while N<=ENV.nextCount and P.nextQueue[N]do local id=P.nextQueue[N].id local _=minoColor[skinSet[id]] gc_setColor(_[1],_[2],_[3],.3) _=blockImg[id] gc_draw(_,285,40*N-10,nil,16,nil,_:getWidth(),_:getHeight()*.5) N=N+1 end --Frame gc_setLineWidth(2) gc_setColor(COLOR.Z) gc_rectangle('line',-1,-1,302,602,3) gc_pop() gc_pop() gc_translate(150,0) TEXT.draw(P.bonus) gc_pop() end return draw