swapDeck_data={ {4,0,1,1},{6,0,15,1},{5,0,9,1},{6,0,6,1}, {1,0,3,1},{3,0,12,1},{1,1,8,1},{2,1,4,2}, {3,2,13,2},{4,1,12,2},{5,2,1,2},{7,1,11,2}, {2,1,9,3},{3,0,6,3},{4,2,14,3},{1,0,4,4}, {7,1,1,4},{6,0,2,4},{5,2,6,4},{6,0,14,5}, {3,3,15,5},{4,0,7,6},{7,1,10,5},{5,0,2,6}, {2,1,1,7},{1,0,4,6},{4,1,13,5},{1,1,6,7}, {5,3,11,5},{3,2,11,7},{6,0,8,7},{4,2,12,8}, {7,0,8,9},{1,0,2,8},{5,2,4,8},{6,0,15,8}, }--Block id [ZSLJTOI] ,dir,x,y swap={ none={2,1,d=function()end}, flash={8,1,d=function()gc.clear(1,1,1)end}, deck={50,8,d=function() local t=sceneSwaping.time gc.setColor(1,1,1) if t>8 then local t=max(t,15) for i=1,51-t do local bn=swapDeck_data[i][1] local b=blocks[bn][swapDeck_data[i][2]] local cx,cy=swapDeck_data[i][3],swapDeck_data[i][4] for y=1,#b do for x=1,#b[1]do if b[y][x]>0 then gc.draw(blockSkin[bn],80*(cx+x-2),80*(10-cy-y),nil,8/3) end end end end end if t<17 then gc.setColor(1,1,1,(8-abs(t-8))*.125) gc.rectangle("fill",0,0,1280,720) end end }, }--Scene swapping animations FX={ flash=0,--Black screen(frame) shake=0,--Screen shake(frame) beam={},--Attack beam badge={},--badge thrown appear=function(t,a) setFont(t.font) gc.setColor(1,1,1,a) mStr(t.text,150,250-t.font*.5+t.dy) end, fly=function(t,a) setFont(t.font) gc.setColor(1,1,1,a) mStr(t.text,150+(t.t-15)^3*.005,250-t.font*.5+t.dy) end, stretch=function(t,a) gc.push("transform") setFont(t.font) gc.translate(150,250+t.dy) gc.setColor(1,1,1,a) if t.t<20 then gc.scale((20-t.t)*.015+1,1)end mStr(t.text,0,-t.font*.5) gc.pop() end, drive=function(t,a) gc.push("transform") setFont(t.font) gc.translate(150,290+t.dy) gc.setColor(1,1,1,a) if t.t<20 then gc.shear((20-t.t)*.05,0)end mStr(t.text,0,-t.font*.5) gc.pop() end, spin=function(t,a) gc.push("transform") setFont(t.font) gc.translate(150,250+t.dy) gc.setColor(1,1,1,a) if t.t<20 then gc.rotate((20-t.t)^2*.0015) end mStr(t.text,0,-t.font*.5) gc.pop() end, flicker=function(t,a) setFont(t.font) gc.setColor(1,1,1,a*(rnd()+.5)) mStr(t.text,150,250-t.font*.5+t.dy) end, zoomout=function(t,a) gc.push("transform") setFont(t.font) gc.translate(150,290+t.dy) gc.setColor(1,1,1,a) local k=t.t^.5*.2+1 gc.scale(k,k) mStr(t.text,0,-t.font*.5) gc.pop() end } function drawButton() for i=1,#Buttons[scene]do local B=Buttons[scene][i] if not(B.hide and B.hide())then local t=i==Buttons.sel and .3 or 0 B.alpha=abs(B.alpha-t)>.02 and(B.alpha+(B.alphat then B.alpha=B.alpha-.02 elseif B.alpha=1 and i<=#modeID then local f=80-abs(i-modeSel)*20 gc.setColor(i==modeSel and color.white or abs(i-modeSel)==1 and color.grey or color.darkGrey) setFont(f) mStr(modeName[i],640,320+70*(i-modeSel)-f*.5) end end end function Pnt.custom() setFont(80) gc.setColor(color.lightGrey) gc.print("Custom Game",20,20) gc.setColor(color.white) gc.print("Custom Game",22,23) setFont(40) for i=1,#customID do local k=customID[i] local y=90+40*i gc.print(customOption[k],50,y) if customVal[k]then gc.print(customVal[k][customSel[k]],350,y) else gc.print(customRange[k][customSel[k]],350,y) end end gc.print("→",10,90+40*optSel) end function Pnt.play() for p=1,#players do P=players[p] if P.small then gc.push("transform") gc.translate(P.x,P.y)gc.scale(P.size)--Scale gc.setColor(0,0,0,.5)gc.rectangle("fill",0,0,300,600)--Black Background gc.setLineWidth(13) gc.stencil(stencil_field_small,"replace",1) gc.translate(0,P.fieldBeneath) gc.setStencilTest("equal",1) if P.result then for j=int(P.fieldBeneath/30+1),#P.field do if P.falling<=0 or without(P.clearing,j)then for i=1,10 do if P.field[j][i]>0 then drawPixelmini(j,i,P.field[j][i],min(P.visTime[j][i],20)*.05) end end end end else for j=int(P.fieldBeneath/30+1),#P.field do if P.falling<=0 or without(P.clearing,j)then for i=1,10 do if P.field[j][i]>0 then drawPixelmini(j,i,P.field[j][i],1) end end end end end gc.setStencilTest()--In-playField mask gc.translate(0,-P.fieldBeneath) gc.setColor(frameColor[P.strength])gc.rectangle("line",-7,-7,314,614)--Draw boarder if P.result then gc.setColor(1,1,1,min(P.counter,60)*.01) setFont(100) mStr(P.result,150,250) end gc.pop() else gc.push("transform") gc.translate(P.x,P.y)gc.scale(P.size)--Scale gc.setColor(0,0,0,.7)gc.rectangle("fill",0,0,600,690)--Black Background gc.setLineWidth(7) gc.setColor(frameColor[P.strength])gc.rectangle("line",0,0,600,690)--Big frame gc.stencil(stencil_field,"replace", 1) gc.translate(150,70+P.fieldBeneath) gc.setStencilTest("equal",1) for j=int(P.fieldBeneath/30+1),#P.field do if P.falling<=0 or without(P.clearing,j)then for i=1,10 do if P.field[j][i]>0 then drawPixel(j,i,P.field[j][i],min(P.visTime[j][i],20)*.05) end end else gc.setColor(1,1,1,P.falling/P.gameEnv.fall) gc.rectangle("fill",0,600-30*j,320,30) end end--Field if P.waiting<=0 then if P.gameEnv.ghost then for i=1,P.r do for j=1,P.c do if P.cb[i][j]>0 then drawPixel(i+P.y_img-1,j+P.cx-1,P.bn,.3) end end end end--Ghost gc.setColor(1,1,1,P.lockDelay/P.gameEnv.lock) for i=1,P.r do for j=1,P.c do if P.cb[i][j]>0 then gc.rectangle("fill",30*(j+P.cx-1)-34,596-30*(i+P.cy-1),38,38) end end end--BlockShade(lockdelay indicator) for i=1,P.r do for j=1,P.c do if P.cb[i][j]>0 then drawPixel(i+P.cy-1,j+P.cx-1,P.bn,1) end end end--Block if P.gameEnv.center then local x=30*(P.cx+P.sc[2]-1)-30+15 gc.draw(spinCenter,x,600-30*(P.cy+P.sc[1]-1)+15,nil,nil,nil,4,4) gc.setColor(1,1,1,.5) gc.draw(spinCenter,x,600-30*(P.y_img+P.sc[1]-1)+15,nil,nil,nil,4,4) end--Rotate center end gc.setColor(1,1,1) gc.draw(PTC.dust[p])--Draw game field gc.setStencilTest()--In-playField mask gc.translate(0,-P.fieldBeneath) gc.setColor(1,1,1)gc.rectangle("line",-3,-13,306,616)--Draw boarder if modeEnv.royale 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) gc.draw(royaleCtrlPad) --Draw selector end local h=0 for i=1,#P.atkBuffer do local a=P.atkBuffer[i] local bar=a.amount*30 if h+bar>600 then bar=600-h end if not a.sent then if a.time<20 then bar=bar*(20*a.time)^.5*.05 --Appear end if a.countdown>0 then gc.setColor(attackColor[a.lv][1]) gc.rectangle("fill",308,600-h,8,-bar+5) gc.setColor(attackColor[a.lv][2]) gc.rectangle("fill",308,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0)) --Timing else attackColor.animate[a.lv]((sin((Timer()-i)*20)+1)*.5) gc.rectangle("fill",308,600-h,8,-bar+5) --Warning end else gc.setColor(attackColor[a.lv][1]) bar=bar*(20-a.time)*.05 gc.rectangle("fill",308,600-h,8,-bar+3) --Disappear end h=h+bar if h>=600 then break end end--Buffer line gc.setColor(P.b2b<40 and color.white or P.b2b<=480 and color.lightRed or color.lightBlue) gc.rectangle("fill",-17,600,10,-P.b2b1) gc.setColor(color.red) gc.rectangle("fill",-23,600-40,16,5) gc.setColor(color.blue) gc.rectangle("fill",-23,600-480,16,5) --B2B bar setFont(40) gc.setColor(1,1,1) if P.gameEnv.hold then gc.print("Hold",-113,0) for i=1,#P.hb do for j=1,#P.hb[1] do if P.hb[i][j]>0 then drawPixel(i+17.5-#P.hb*.5,j-2.5-#P.hb[1]*.5,P.holded and 13 or P.hn,1) end end end end--Hold gc.print("Next",336,0) for N=1,P.gameEnv.next do local b=P.nb[N] for i=1,#b do for j=1,#b[1] do if b[i][j]>0 then drawPixel(i+20-2.4*N-#b*.5,j+12.5-#b[1]*.5,P.nxt[N],1) end end end end--Next if frame<180 then local count=180-frame gc.push("transform") gc.translate(155,220) gc.setColor(1,1,1) setFont(100) if count%60>45 then gc.scale(1+(count%60-45)^2*.01,1)end mStr(int(count/60+1),0,0) gc.pop() end--Draw starting counter for i=1,#P.bonus do P.bonus[i]:draw(min((30-abs(P.bonus[i].t-30))*.05,1)*(not P.bonus[i].solid and #P.field>(9-P.bonus[i].dy*.03333)and .7 or 1)) end--Effects gc.setColor(1,1,1) setFont(40) gc.print(format("%.2f",P.time),-130,530)--Draw time if mesDisp[gamemode]then mesDisp[gamemode]()end--Draw other message setFont(15) gc.setColor(1,1,1) gc.print("BPM",380,490) gc.print("KPM",335,580) setFont(30) drawDial(350,520,P.dropSpeed) drawDial(400,570,P.keySpeed) --Speed dials gc.pop() end end--Draw players gc.setColor(1,1,1) for i=1,3 do gc.draw(PTC.attack[i]) end for i=1,#FX.badge do local b=FX.badge[i] local t=b.t<10 and 0 or b.t<50 and(sin(1.5*(b.t/20-1.5))+1)*.5 or 1 gc.setColor(1,1,1,b.t<10 and b.t*.1 or b.t<50 and 1 or(60-b.t)*.1) gc.draw(badgeIcon,b[1]+(b[3]-b[1])*t,b[2]+(b[4]-b[2])*t,nil,b.size,nil,14,14) end if setting.virtualkeySwitch then drawVirtualkey() end if modeEnv.royaleMode then gc.setLineWidth(5) gc.setColor(1,1,0,.2) P=players[1] for i=1,#players.alive do local p=players.alive[i] if p.atking==players[1]then gc.line(p.centerX,p.centerY,P.centerX,P.centerY) end end if P.atking then gc.setColor(0,.5,1,.2+(sin(Timer()*7)+1)*.1) gc.line(P.centerX,P.centerY,P.atking.centerX,P.atking.centerY) end end end function Pnt.setting() gc.setColor(1,1,1) setFont(35) mStr("DAS:"..setting.das,328,163) mStr("ARR:"..setting.arr,543,163) setFont(18) mStr("softdropDAS:"..setting.sddas,328,250) mStr("softdropARR:"..setting.sdarr,543,250) end function Pnt.setting2() if keyboardSetting then gc.setColor(1,.5,.5,.2+(sin(Timer()*15)+1)*.1) else gc.setColor(.9,.9,.9,.2+(sin(Timer()*15)+1)*.1) end gc.rectangle("fill",240,40*keyboardSet-10,200,40) if joystickSetting then gc.setColor(1,.5,.5,.2+(sin(Timer()*15)+1)*.1) else gc.setColor(.9,.9,.9,.2+(sin(Timer()*15)+1)*.1) end gc.rectangle("fill",440,40*joystickSet-10,200,40) gc.setColor(1,1,1) setFont(25) for y=1,13 do mStr(actName_show[y],150,40*y) for x=1,2 do mStr(setting.keyMap[curBoard+x*8-8][y],200*x+140,40*y) end gc.line(40,40*y-10,640,40*y-10) end for x=1,4 do gc.line(200*x-160,30,200*x-160,550) end gc.line(40,550,640,550) gc.print("Keyboard | Joystick",330,3) gc.print("Arrowkey to select/change slot,Enter to change,Esc back",50,620) setFont(40) gc.print("< P"..curBoard.."/P8 >",430,570) end function Pnt.setting3() drawVirtualkey(sel) local d=snapLevelValue[snapLevel] if d>=10 then gc.setLineWidth(3) gc.setColor(1,1,1,sin(Timer()*4)*.1+.1) for i=1,1280/d-1 do gc.line(d*i,0,d*i,720) end for i=1,720/d-1 do gc.line(0,d*i,1280,d*i) end end end function Pnt.help() setFont(32) gc.setColor(1,1,1) for i=1,11 do mStr(Text.help[i],640,15+43*i) end gc.draw(titleImage,180,600,.2,.7+.05*sin(Timer()*2),nil,140,100) end function Pnt.stat() setFont(30) gc.setColor(1,1,1) for i=1,10 do gc.print(Text.stat[i],350,20+40*i) end gc.print(stat.run,650,60) gc.print(stat.game,650,100) gc.print(format("%0.2f",stat.gametime).."s",650,140) gc.print(stat.piece,650,180) gc.print(stat.row,650,220) gc.print(stat.atk,650,260) gc.print(stat.key,650,300) gc.print(stat.rotate,650,340) gc.print(stat.hold,650,380) gc.print(stat.spin,650,420) gc.draw(titleImage,260,570,.2+.07*sin(Timer()*3),.8,nil,250,60) end