diff --git a/Zframework/bg.lua b/Zframework/bg.lua index e87fee3b..9cb63d5d 100644 --- a/Zframework/bg.lua +++ b/Zframework/bg.lua @@ -1,512 +1,11 @@ -local gc=love.graphics -local int,ceil,rnd=math.floor,math.ceil,math.random -local max,min,sin=math.max,math.min,math.sin -local ins,rem=table.insert,table.remove - local function NULL(...)end -local SCR=SCR -local BGvars={_G=_G,SHADER=SHADER} -local BG -local back={} -back.none={ - draw=function() - gc.clear(.15,.15,.15) - end, -} -back.grey={ - draw=function() - gc.clear(.3,.3,.3) - end, -} -back.glow={ - init=function() - t=rnd()*2600 - end, - update=function(dt) - t=t+dt - end, - draw=function() - local t=(sin(t*.5)+sin(t*.7)+sin(t*.9+1)+sin(t*1.5)+sin(t*2+10))*.08 - gc.clear(t,t,t) - end, -}--Light-dark -back.rgb={ - init=function() - t=rnd()*2600 - end, - update=function(dt) - t=t+dt - end, - draw=function() - gc.clear( - sin(t*1.2)*.15+.2, - sin(t*1.5)*.15+.2, - sin(t*1.9)*.15+.2 - ) - end, -}--Changing pure color -back.flink={ - init=function() - t=rnd()*2600 - end, - update=function(dt) - t=t+dt - end, - draw=function() - local t=.13-t%3%1.9 - if t<.2 then gc.clear(t,t,t) - else gc.clear(0,0,0) - end - end, -}--Flash after random time - -local wingColor={ - {0., .9, .9,.626}, - {.3, 1., .3,.626}, - {.9, .9, 0.,.626}, - {1., .5, 0.,.626}, - {1., .3, .3,.626}, - {.5, 0., 1.,.626}, - {.3, .3, 1.,.626}, - {0., .9, .9,.626}, -} -back.wing={ - init=function() - bar=gc.newCanvas(41,1) - gc.setCanvas(bar) - gc.push("transform") - gc.origin() - for x=0,20 do - gc.setColor(1,1,1,x/11) - gc.rectangle("fill",x,0,1,1) - gc.rectangle("fill",41-x,0,1,1) - end - gc.pop() - gc.setCanvas() - BG.resize() - end, - resize=function() - crystal={} - W,H=SCR.w,SCR.h - for i=1,16 do - crystal[i]={ - x=i<9 and W*.05*i or W*.05*(28-i), - y=H*.1, - a=0, - va=0, - f=i<9 and .012-i*.0005 or .012-(17-i)*.0005 - } - end - end, - update=function() - for i=1,16 do - local B=crystal[i] - B.a=B.a+B.va - B.va=B.va*.986-B.a*B.f - end - end, - draw=function() - gc.clear(.06,.06,.06) - local sy=H*.8 - for i=1,8 do - gc.setColor(wingColor[i]) - local B=crystal[i] - gc.draw(bar,B.x,B.y,B.a,1,sy,20,0) - B=crystal[17-i] - gc.draw(bar,B.x,B.y,B.a,1,sy,20,0) - end - end, - event=function(level) - for i=1,8 do - local B=crystal[i] - B.va=B.va+.001*level*(1+rnd()) - B=crystal[17-i] - B.va=B.va-.001*level*(1+rnd()) - end - end, - discard=function() - bar,crystal=nil - end, -}--Flandre's wing - -back.fan={ - init=function() - fan=_G.title_fan - t=rnd(2600) - petal={} - BG.resize() - end, - resize=function() - CX,CY=SCR.w/2,SCR.h/2 - W,H=SCR.w,SCR.h - end, - update=function() - t=t+1 - if t%10==0 then - ins(petal,{ - x=SCR.w*rnd(), - y=0, - vy=2+rnd()*2, - vx=rnd()*2-.5, - rx=4+rnd()*4, - ry=4+rnd()*4, - }) - end - for i=#petal,1,-1 do - local P=petal[i] - P.y=P.y+P.vy - if P.y>H then - rem(petal,i) - else - P.x=P.x+P.vx - P.vx=P.vx+rnd()*.01 - P.rx=max(min(P.rx+rnd()-.5,10),2) - P.ry=max(min(P.ry+rnd()-.5,10),2) - end - end - end, - draw=function() - gc.push("transform") - gc.translate(CX,CY+20*sin(t*.02)) - gc.scale(SCR.k) - gc.clear(.1,.1,.1) - gc.setLineWidth(320) - gc.setColor(.3,.2,.3) - gc.arc("line","open",0,420,500,-.8*3.1416,-.2*3.1416) - - gc.setLineWidth(4) - gc.setColor(.7,.5,.65) - gc.arc("line","open",0,420,660,-.799*3.1416,-.201*3.1416) - gc.arc("line","open",0,420,340,-.808*3.1416,-.192*3.1416) - gc.line(-281,224,-530,30.5) - gc.line(281,224,530,30.5) - - gc.setLineWidth(6) - gc.setColor(.55,.5,.6) - local F=fan - for i=1,8 do - gc.polygon("line",F[i]) - end - - gc.setLineWidth(2) - gc.setColor(.6,.3,.5) - gc.origin() - for i=1,#petal do - local P=petal[i] - gc.ellipse("fill",P.x,P.y,P.rx,P.ry) - end - gc.pop() - end, - discard=function() - petal=nil - end, -} - -local video--128x96, 10fps, 2192f -back.badapple={ - init=function() - if not video then - video=_G.love.data.decompress("string","zlib",_G.love.filesystem.read("Zframework/badapple.dat")) - end - t=0 - BG.resize() - end, - resize=function() - local W,H=SCR.w,SCR.h - if H/W>=96/128 then - K=W/128 - X,Y=0,(H-W*96/128)*.5 - else - K=H/96 - X,Y=(W-H*128/96)*.5,0 - end - end, - update=function() - t=t+1 - if t==13146 then - t=0 - end - end, - draw=function() - gc.clear(.2,.2,.2) - gc.push("transform") - gc.origin() - gc.translate(X,Y) - gc.scale(K) - gc.setColor(.4,.4,.4) - local t=int(t/6) - local bAnd,bRshift=_G.bit.band,_G.bit.rshift - for i=0,1535 do - local B=video:byte(1536*t+i+1) - for j=7,0,-1 do - local p=8*i+j - if bAnd(B,1)==0 then - gc.rectangle("fill",p%128,int(p/128),1,1) - end - B=bRshift(B,1) - end - end - gc.pop() - end, - discard=function() - video=nil - end -} - -back.welcome={ - init=function() - t=rnd()*2600 - txt=gc.newText(_G.getFont(80),"Welcome To Techmino") - end, - update=function(dt) - t=t+dt - end, - draw=function() - if -t%13.55<.1 then - gc.clear(.2+.1*sin(t),.2+.1*sin(1.26*t),.2+.1*sin(1.626*t)) - else - gc.clear(.1,.1,.1) - end - gc.push("transform") - gc.replaceTransform(_G.xOy) - gc.translate(640,360) - if -t%18.26<1 then - gc.scale(6.26) - gc.translate(-t*400%800-400,0) - else - gc.scale(1.1626,1.26) - end - if -t%12.6<.1 then - gc.translate(60*sin(t*.26),100*sin(t*.626)) - end - if -t%16.26<.1 then - gc.rotate(t+5*sin(.26*t)+5*sin(.626*t)) - end - gc.setColor(.2,.3,.5) - gc.draw(txt,-883*.5+4*sin(t*.7942),-110*.5+4*sin(t*.7355)) - gc.setColor(.4,.6,.8) - gc.draw(txt,-883*.5+2*sin(t*.77023),-110*.5+2*sin(t*.7026)) - gc.setColor(.9,.9,.9) - gc.draw(txt,-883*.5+3*sin(t*.7283),-110*.5+3*sin(t*.7626)) - gc.pop() - end, -} - -back.aura={ - init=function() - t=rnd()*2600 - BG.resize(SCR.w,SCR.h) - end, - resize=function(_,h) - SHADER.aura:send("w",SCR.W) - SHADER.aura:send("h",h*SCR.dpi) - end, - update=function(dt) - t=t+dt - end, - draw=function() - SHADER.aura:send("t",t) - gc.setShader(SHADER.aura) - gc.rectangle("fill",0,0,SCR.w,SCR.h) - gc.setShader() - end, -}--Cool liquid background -back.bg1={ - init=function() - t=rnd()*2600 - BG.resize() - end, - resize=function() - SHADER.gradient1:send("w",SCR.W) - end, - update=function(dt) - t=t+dt - end, - draw=function() - SHADER.gradient1:send("t",t) - gc.setShader(SHADER.gradient1) - gc.rectangle("fill",0,0,SCR.w,SCR.h) - gc.setShader() - end, -}--Horizonal red-blue gradient -back.bg2={ - init=function() - t=rnd()*2600 - BG.resize(nil,SCR.h) - end, - resize=function(_,h) - SHADER.gradient2:send("h",h*SCR.dpi) - end, - update=function(dt) - t=t+dt - end, - draw=function() - SHADER.gradient2:send("t",t) - gc.setShader(SHADER.gradient2) - gc.rectangle("fill",0,0,SCR.w,SCR.h) - gc.setShader() - end, -}--Vertical red-green gradient -back.rainbow={ - init=function() - t=rnd()*2600 - BG.resize(SCR.w,SCR.h) - end, - resize=function(_,h) - SHADER.rgb1:send("w",SCR.W) - SHADER.rgb1:send("h",h*SCR.dpi) - end, - update=function(dt) - t=t+dt - end, - draw=function() - SHADER.rgb1:send("t",t) - gc.setShader(SHADER.rgb1) - gc.rectangle("fill",0,0,SCR.w,SCR.h) - gc.setShader() - end, -}--Colorful RGB -back.rainbow2={ - init=function() - t=rnd()*2600 - BG.resize(SCR.w,SCR.h) - end, - resize=function(_,h) - SHADER.rgb2:send("w",SCR.W) - SHADER.rgb2:send("h",h*SCR.dpi) - end, - update=function(dt) - t=t+dt - end, - draw=function() - SHADER.rgb2:send("t",t) - gc.setShader(SHADER.rgb2) - gc.rectangle("fill",0,0,SCR.w,SCR.h) - gc.setShader() - end, -}--Blue RGB -back.lightning={ - init=function() - t=rnd()*2600 - end, - update=function(dt) - t=t+dt - end, - draw=function() - local t=2.5-t%20%6%2.5 - if t<.3 then gc.clear(t,t,t) - else gc.clear(0,0,0) - end - end, -}--Lightning - -local blocks=require("parts/mino") -back.lightning2={ - init=function() - t=rnd()*2600 - colorLib=_G.SKIN.libColor - colorSet=_G.SETTING.skin - blockImg=_G.TEXTURE.miniBlock - scs=_G.spinCenters - end, - update=function(dt) - t=t+dt - end, - draw=function() - local R=7-int(t*.5%7) - local T=1.2-t%10%3%1.2 - if T<.3 then gc.clear(T,T,T) - else gc.clear(0,0,0) - end - local _=colorLib[colorSet[R]] - gc.setColor(_[1],_[2],_[3],.12) - gc.draw(blockImg[R],640,360,t%3.1416*6,400,400,scs[R][0][2]+.5,#blocks[R][0]-scs[R][0][1]-.5) - end, -}--Fast lightning + spining tetromino - -local matrixT={}for i=1,50 do matrixT[i]={}for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end -back.matrix={ - init=function() - t=rnd()*2600 - end, - update=function(dt) - t=t+dt - end, - draw=function() - gc.clear(.15,.15,.15) - gc.push("transform") - local k=SCR.k - gc.scale(k) - local Y=ceil(SCR.h/80/k) - for x=1,ceil(SCR.w/80/k)do - for y=1,Y do - gc.setColor(1,1,1,sin(x+matrixT[x][y]*t)*.1+.1) - gc.rectangle("fill",80*x,80*y,-80,-80) - end - end - gc.pop() - end, -} - -back.space={ - init=function() - stars={} - W,H=SCR.w+20,SCR.h+20 - BG.resize(SCR.w,SCR.h) - end, - resize=function() - local S=stars - for i=1,1260,5 do - local s=rnd(26,40)*.1 - S[i]=s*SCR.k --Size - S[i+1]=rnd(W)-10 --X - S[i+2]=rnd(H)-10 --Y - S[i+3]=(rnd()-.5)*.01*s --Vx - S[i+4]=(rnd()-.5)*.01*s --Vy - end - end, - update=function() - local S=stars - --Star moving - for i=1,1260,5 do - S[i+1]=(S[i+1]+S[i+3])%W - S[i+2]=(S[i+2]+S[i+4])%H - end - end, - draw=function() - gc.clear(.2,.2,.2) - if not stars[1]then return end - gc.translate(-10,-10) - gc.setColor(.8,.8,.8) - for i=1,1260,5 do - local s=stars - local x,y=s[i+1],s[i+2] - s=s[i] - gc.rectangle("fill",x,y,s,s) - end - gc.translate(10,10) - end, - discard=function() - stars=nil - end, -} - ---Make BG vars invisible -for _,bg in next,back do - if bg.init then setfenv(bg.init, BGvars)else bg.init=NULL end - if bg.resize then setfenv(bg.resize, BGvars)else bg.resize=NULL end - if bg.update then setfenv(bg.update, BGvars)else bg.update=NULL end - if bg.draw then setfenv(bg.draw, BGvars)else bg.draw=NULL end - if bg.event then setfenv(bg.event, BGvars)else bg.event=NULL end - if bg.discard then setfenv(bg.discard, BGvars)else bg.discard=NULL end -end - -BG={ - cur="none", +local BG={ + list={}, + cur="", init=NULL, resize=NULL, update=NULL, - draw=back.none.draw, + draw=NULL, event=NULL, discard=NULL, } @@ -515,22 +14,22 @@ function BG.send(data) BG.event(data) end end -function BG.set(bg) - if bg==BG.cur or not SETTING.bg then return end +function BG.set(background) + if background==BG.cur or not SETTING.bg then return end BG.discard() - if not back[bg]then - LOG.print("No BG called"..bg,"warn") + background=BG.list[background] + if not background then + LOG.print("No BG called"..background,"warn") return end - BG.cur=bg - bg=back[bg] + BG.cur=background - BG.init= bg.init - BG.resize= bg.resize - BG.update= bg.update - BG.draw= bg.draw - BG.event= bg.event - BG.discard= bg.discard + BG.init= background.init or NULL + BG.resize= background.resize or NULL + BG.update= background.update or NULL + BG.draw= background.draw or NULL + BG.event= background.event or NULL + BG.discard= background.discard or NULL BG.init() end return BG \ No newline at end of file diff --git a/Zframework/bgm.lua b/Zframework/bgm.lua index 04ba7e43..d545a2de 100644 --- a/Zframework/bgm.lua +++ b/Zframework/bgm.lua @@ -55,7 +55,7 @@ function BGM.loadOne(N) BGM.list[N]:setLooping(true) BGM.list[N]:setVolume(0) else - LOG.print("No BGM file: "..N,5,color.orange) + LOG.print("No BGM file: "..N,5,COLOR.orange) end end function BGM.loadAll() diff --git a/Zframework/color.lua b/Zframework/color.lua index 9fff7dad..73670e3d 100644 --- a/Zframework/color.lua +++ b/Zframework/color.lua @@ -1,6 +1,6 @@ local rnd=math.random local sin=math.sin -local color={ +local COLOR={ red={1,0,0}, green={0,1,0}, blue={.2,.2,1}, @@ -41,27 +41,27 @@ local color={ } local list_norm={"red","green","blue","yellow","magenta","cyan","purple","orange","pink","grass"} local len_list_norm=#list_norm -function color.random_norm() - return color[list_norm[rnd(len_list_norm)]] +function COLOR.random_norm() + return COLOR[list_norm[rnd(len_list_norm)]] end local list_bright={"lRed","lGreen","lBlue","lYellow","lMagenta","lCyan","lPurple","lOrange"} local len_list_bright=#list_bright -function color.random_bright() - return color[list_bright[rnd(len_list_bright)]] +function COLOR.random_bright() + return COLOR[list_bright[rnd(len_list_bright)]] end local list_dark={"dRed","dGreen","dBlue","dYellow","dMagenta","dCyan","dPurple","dOrange"} local len_list_dark=#list_dark -function color.random_bright() - return color[list_dark[rnd(len_list_dark)]] +function COLOR.random_bright() + return COLOR[list_dark[rnd(len_list_dark)]] end -function color.rainbow(phase) +function COLOR.rainbow(phase) return sin(phase)*.4+.6, sin(phase+2.0944)*.4+.6, sin(phase-2.0944)*.4+.6 end -return color \ No newline at end of file +return COLOR \ No newline at end of file diff --git a/Zframework/file.lua b/Zframework/file.lua index 3e15f11b..26d905fa 100644 --- a/Zframework/file.lua +++ b/Zframework/file.lua @@ -28,7 +28,7 @@ function FILE.saveRecord(N,L) local _,mes=F:write(dumpTable(L)) F:flush()F:close() if not _ then - LOG.print(text.recSavingError..(mes or"unknown error"),color.red) + LOG.print(text.recSavingError..(mes or"unknown error"),COLOR.red) end end function FILE.delRecord(N) @@ -36,7 +36,7 @@ function FILE.delRecord(N) end function FILE.exportUnlock() - sys.setClipboardText(dumpTable(modeRanks)) + sys.setClipboardText(dumpTable(RANKS)) end function FILE.loadUnlock() local F=files.unlock @@ -47,17 +47,17 @@ function FILE.loadUnlock() F:close() if s then setfenv(s,{}) - modeRanks=s() + RANKS=s() end end end function FILE.saveUnlock() local F=files.unlock F:open("w") - local _,mes=F:write(dumpTable(modeRanks)) + local _,mes=F:write(dumpTable(RANKS)) F:flush()F:close() if not _ then - LOG.print(text.unlockSavingError..(mes or"unknown error"),color.red) + LOG.print(text.unlockSavingError..(mes or"unknown error"),COLOR.red) end end @@ -86,7 +86,7 @@ function FILE.saveData() local _,mes=F:write(dumpTable(STAT)) F:flush()F:close() if not _ then - LOG.print(text.statSavingError..(mes or"unknown error"),color.red) + LOG.print(text.statSavingError..(mes or"unknown error"),COLOR.red) end end @@ -113,8 +113,8 @@ function FILE.saveSetting() F:open("w") local _,mes=F:write(dumpTable(SETTING)) F:flush()F:close() - if _ then LOG.print(text.settingSaved,color.green) - else LOG.print(text.settingSavingError..(mes or"unknown error"),color.red) + if _ then LOG.print(text.settingSaved,COLOR.green) + else LOG.print(text.settingSavingError..(mes or"unknown error"),COLOR.red) end end @@ -134,8 +134,8 @@ function FILE.saveKeyMap() F:open("w") local _,mes=F:write(dumpTable(keyMap)) F:flush()F:close() - if _ then LOG.print(text.keyMapSaved,color.green) - else LOG.print(text.keyMapSavingError..(mes or"unknown error"),color.red) + if _ then LOG.print(text.keyMapSaved,COLOR.green) + else LOG.print(text.keyMapSavingError..(mes or"unknown error"),COLOR.red) end end @@ -158,8 +158,8 @@ function FILE.saveVK() F:open("w") local _,mes=F:write(dumpTable(VK_org)) F:flush()F:close() - if _ then LOG.print(text.VKSaved,color.green) - else LOG.print(text.VKSavingError..(mes or"unknown error"),color.red) + if _ then LOG.print(text.VKSaved,COLOR.green) + else LOG.print(text.VKSavingError..(mes or"unknown error"),COLOR.red) end end return FILE \ No newline at end of file diff --git a/Zframework/init.lua b/Zframework/init.lua index 40bac421..bcf0860e 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -1,21 +1,25 @@ -color= require("Zframework/color") +COLOR= require("Zframework/color") SCN= require("Zframework/scene") LOG= require("Zframework/log") require("Zframework/toolfunc") -SHADER= require("Zframework/shader") + VIB= require("Zframework/vib") SFX= require("Zframework/sfx") -sysFX= require("Zframework/sysFX") + +LIGHT= require("Zframework/light") +SHADER= require("Zframework/shader") BG= require("Zframework/bg") +WIDGET= require("Zframework/widget") +TEXT= require("Zframework/text") +sysFX= require("Zframework/sysFX") + +IMG= require("Zframework/img") BGM= require("Zframework/bgm") VOC= require("Zframework/voice") + LANG= require("Zframework/languages") -FILE= require("Zframework/file") -TEXT= require("Zframework/text") TASK= require("Zframework/task") -IMG= require("Zframework/img") -WIDGET= require("Zframework/widget") -LIGHT= require("Zframework/light") +FILE= require("Zframework/file") PROFILE=require("Zframework/profile") local ms,kb=love.mouse,love.keyboard @@ -24,6 +28,7 @@ local int,rnd,abs=math.floor,math.random,math.abs local min=math.min local ins,rem=table.insert,table.remove local SCR=SCR +local setFont=setFont local mx,my,mouseShow=-20,-20,false local touching=nil--First touching ID(userdata) @@ -212,11 +217,11 @@ function love.keypressed(i) elseif i=="f5"then if love._openConsole then love._openConsole()end elseif i=="f6"then if WIDGET.sel then DBP(WIDGET.sel)end elseif i=="f7"then for k,v in next,_G do DBP(k,v)end - elseif i=="f8"then devMode=nil LOG.print("DEBUG OFF",color.yellow) - elseif i=="f9"then devMode=1 LOG.print("DEBUG 1",color.yellow) - elseif i=="f10"then devMode=2 LOG.print("DEBUG 2",color.yellow) - elseif i=="f11"then devMode=3 LOG.print("DEBUG 3",color.yellow) - elseif i=="f12"then devMode=4 LOG.print("DEBUG 4",color.yellow) + elseif i=="f8"then devMode=nil LOG.print("DEBUG OFF",COLOR.yellow) + elseif i=="f9"then devMode=1 LOG.print("DEBUG 1",COLOR.yellow) + elseif i=="f10"then devMode=2 LOG.print("DEBUG 2",COLOR.yellow) + elseif i=="f11"then devMode=3 LOG.print("DEBUG 3",COLOR.yellow) + elseif i=="f12"then devMode=4 LOG.print("DEBUG 4",COLOR.yellow) elseif devMode==2 then if WIDGET.sel then local W=WIDGET.sel @@ -250,7 +255,7 @@ function love.keypressed(i) end else devMode=1 - LOG.print("DEBUG ON",color.yellow) + LOG.print("DEBUG ON",COLOR.yellow) end end function love.keyreleased(i) @@ -279,7 +284,7 @@ function love.joystickremoved(JS) for i=1,#joysticks do if joysticks[i]==JS then rem(joysticks,i) - LOG.print("Joystick removed",color.yellow) + LOG.print("Joystick removed",COLOR.yellow) return end end @@ -360,9 +365,9 @@ function love.focus(f) end end function love.errorhandler(msg) - local PUMP,POLL=love.event.pump,love.event.poll - love.mouse.setVisible(true) + ms.setVisible(true) love.audio.stop() + local err={"Error:"..msg} local trace=debug.traceback("",2) local c=2 @@ -379,9 +384,9 @@ function love.errorhandler(msg) end DBP(table.concat(err,"\n"),1,c-2) gc.reset() - local CAP - local function _(_)CAP=gc.newImage(_)end - gc.captureScreenshot(_) + + local errScrShot + gc.captureScreenshot(function (_)errScrShot=gc.newImage(_)end) gc.present() SFX.fplay("error",SETTING.voc*.8) @@ -390,8 +395,8 @@ function love.errorhandler(msg) local needDraw=true local count=0 return function() - PUMP() - for E,a,b in POLL()do + love.event.pump() + for E,a,b in love.event.poll()do if E=="quit"or a=="escape"then destroyPlayers() return 1 @@ -422,7 +427,7 @@ function love.errorhandler(msg) gc.setColor(1,1,1) gc.push("transform") gc.replaceTransform(xOy) - gc.draw(CAP,100,365,nil,512/CAP:getWidth(),288/CAP:getHeight()) + gc.draw(errScrShot,100,365,nil,512/errScrShot:getWidth(),288/errScrShot:getHeight()) setFont(120)gc.print(":(",100,40) setFont(38)gc.printf(text.errorMsg,100,200,1280-100) setFont(20) @@ -437,14 +442,14 @@ function love.errorhandler(msg) gc.present() needDraw=false end - love.timer.sleep(.2) + love.timer.sleep(.26) end end local devColor={ - color.white, - color.lMagenta, - color.lGreen, - color.lBlue, + COLOR.white, + COLOR.lMagenta, + COLOR.lGreen, + COLOR.lBlue, } local FPS=love.timer.getFPS love.draw,love.update=nil--remove default draw/update @@ -473,6 +478,7 @@ function love.run() else SCN.init("load") end + BG.set("none") return function() local _ @@ -526,7 +532,7 @@ function love.run() local R=int(r)%7+1 _=SKIN.libColor[SETTING.skin[R]] gc.setColor(_[1],_[2],_[3],min(1-abs(1-r%1*2),.3)) - gc.draw(TEXTURE.miniBlock[R],mx,my,Timer()%3.1416*4,20,20,spinCenters[R][0][2]+.5,#blocks[R][0]-spinCenters[R][0][1]-.5) + gc.draw(TEXTURE.miniBlock[R],mx,my,Timer()%3.1416*4,20,20,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5) gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5) gc.setColor(1,1,1)gc.circle("fill",mx,my,3) end @@ -549,7 +555,7 @@ function love.run() --Draw network working if TASK.netTaskCount>0 then setFont(30) - gc.setColor(color.rainbow(Timer()*5)) + gc.setColor(COLOR.rainbow(Timer()*5)) gc.print("E",1250,0,.26+.355*math.sin(Timer()*6.26)) end @@ -563,7 +569,7 @@ function love.run() if devMode then gc.setColor(devColor[devMode]) gc.print("Memory:"..gcinfo(),5,_-40) - gc.print("Lines:"..freeRow.getCount(),5,_-60) + gc.print("Lines:"..FREEROW.getCount(),5,_-60) gc.print("Cursor:"..int(mx+.5).." "..int(my+.5),5,_-80) gc.print("Voices:"..VOC.getCount(),5,_-100) gc.print("Tasks:"..TASK.getCount(),5,_-120) @@ -590,7 +596,7 @@ function love.run() end if gc.getWidth()~=SCR.w then love.resize(gc.getWidth(),gc.getHeight()) - LOG.print("Screen Resized",color.yellow) + LOG.print("Screen Resized",COLOR.yellow) end end diff --git a/Zframework/log.lua b/Zframework/log.lua index bfd8e156..83faef44 100644 --- a/Zframework/log.lua +++ b/Zframework/log.lua @@ -41,23 +41,23 @@ function LOG.print(text,T,C)--text,type/time,color local time local his if T=="warn"then - C=C or color.yellow + C=C or COLOR.yellow his=true time=180 elseif T=="error"then - C=C or color.red + C=C or COLOR.red his=true time=210 elseif T=="message"then - C=C or color.sky + C=C or COLOR.sky his=true elseif type(T)=="number"then - C=C or color.white + C=C or COLOR.white time=T elseif type(T)=="table"then C,T=T elseif not C then - C=color.white + C=COLOR.white end if his then ins(debugMesHistory,SCN.cur..": "..tostring(text)) @@ -67,6 +67,6 @@ end function LOG.copy() local str=table.concat(debugMesHistory,"\n") love.system.setClipboardText(str) - LOG.print("Log copied",color.blue) + LOG.print("Log copied",COLOR.blue) end return LOG \ No newline at end of file diff --git a/Zframework/sfx.lua b/Zframework/sfx.lua index 90d64a44..d96f0ce6 100644 --- a/Zframework/sfx.lua +++ b/Zframework/sfx.lua @@ -30,7 +30,7 @@ function SFX.loadOne(_) if love.filesystem.getInfo(N)then SFX.list[_]={love.audio.newSource(N,"static")} else - LOG.print("No SFX file: "..N,5,color.orange) + LOG.print("No SFX file: "..N,5,COLOR.orange) end end function SFX.loadAll() diff --git a/Zframework/sysFX.lua b/Zframework/sysFX.lua index 806ae6d3..68c21c41 100644 --- a/Zframework/sysFX.lua +++ b/Zframework/sysFX.lua @@ -1,8 +1,7 @@ local gc=love.graphics -local setColor=gc.setColor -local setWidth=gc.setLineWidth -local rem=table.remove +local setColor,setWidth=gc.setColor,gc.setLineWidth local max,min=math.max,math.min +local rem=table.remove local fx={} diff --git a/Zframework/task.lua b/Zframework/task.lua index 92eee54a..3f4bee7d 100644 --- a/Zframework/task.lua +++ b/Zframework/task.lua @@ -15,7 +15,7 @@ function TASK.update() TASK.netTaskCount=TASK.netTaskCount-1 end rem(tasks,i) - end + end end end function TASK.new(code,data) diff --git a/Zframework/text.lua b/Zframework/text.lua index 2edebba0..93822804 100644 --- a/Zframework/text.lua +++ b/Zframework/text.lua @@ -1,7 +1,7 @@ local gc=love.graphics local rnd=math.random local rem=table.remove -local mStr=mStr +local setFont,mStr=setFont,mStr local texts={} diff --git a/Zframework/toolfunc.lua b/Zframework/toolfunc.lua index f94db8cb..92fe201a 100644 --- a/Zframework/toolfunc.lua +++ b/Zframework/toolfunc.lua @@ -24,7 +24,7 @@ do--LOADLIB if success then return success else - LOG.print("Cannot load "..name..": "..message,"warn",color.red) + LOG.print("Cannot load "..name..": "..message,"warn",COLOR.red) end elseif SYSTEM=="Android"then local fs=love.filesystem @@ -37,25 +37,25 @@ do--LOADLIB if success then libFunc,message=package.loadlib(table.concat({fs.getSaveDirectory(),libName.Android},"/"),libName.libFunc) if libFunc then - LOG.print(name.." lib loaded","warn",color.green) + LOG.print(name.." lib loaded","warn",COLOR.green) break else - LOG.print("Cannot load "..name..": "..message,"warn",color.red) + LOG.print("Cannot load "..name..": "..message,"warn",COLOR.red) end else - LOG.print("Write "..name.."-"..platform[i].." to saving failed: "..message,"warn",color.red) + LOG.print("Write "..name.."-"..platform[i].." to saving failed: "..message,"warn",COLOR.red) end else - LOG.print("Read "..name.."-"..platform[i].." failed","warn",color.red) + LOG.print("Read "..name.."-"..platform[i].." failed","warn",COLOR.red) end end if not libFunc then - LOG.print("failed to load "..name,"warn",color.red) + LOG.print("failed to load "..name,"warn",COLOR.red) return end return libFunc() else - LOG.print("No "..name.." for "..SYSTEM,"warn",color.red) + LOG.print("No "..name.." for "..SYSTEM,"warn",COLOR.red) return end return true @@ -180,7 +180,7 @@ do--httpRequest TASK.netTaskCount=TASK.netTaskCount+1 end or function() - LOG.print("[NO NETlib]",5,color.yellow) + LOG.print("[NO NETlib]",5,COLOR.yellow) end end do--json diff --git a/Zframework/vib.lua b/Zframework/vib.lua index 68142e01..7c8d223b 100644 --- a/Zframework/vib.lua +++ b/Zframework/vib.lua @@ -1,8 +1,8 @@ local level={0,0,.015,.02,.03,.04,.05,.06,.07,.08} -local _=love.system.vibrate +local VIB=love.system.vibrate return function(t) local L=SETTING.vib if L>0 then - _(level[L+t]) + VIB(level[L+t]) end end \ No newline at end of file diff --git a/Zframework/voice.lua b/Zframework/voice.lua index 04fe1a37..cd82ea07 100644 --- a/Zframework/voice.lua +++ b/Zframework/voice.lua @@ -31,7 +31,7 @@ function VOC.loadOne(name) if i==1 then if not loadVoiceFile(N,N)then - LOG.print("No VOICE file: "..N,5,color.orange) + LOG.print("No VOICE file: "..N,5,COLOR.orange) end end if not VOC.list[N][1]then VOC.list[N]=nil end diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 195f3e4d..97b2a0aa 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -5,10 +5,8 @@ local max,min=math.max,math.min local sub,format=string.sub,string.format local ins=table.insert -local color=color -local setFont=setFont local Timer=love.timer.getTime -local mStr=mStr +local setFont,mStr=setFont,mStr local Empty={} local widgetList={} @@ -42,7 +40,7 @@ function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,hide] name= D.name, x= D.x, y= D.y, - color= D.color and(color[D.color]or D.color)or color.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.white, font= D.font or 30, align= D.align or"M", hide= D.hide, @@ -161,7 +159,7 @@ function WIDGET.newButton(D)--name,x,y,w[,h][,color][,font],code[,hide] D.x+D.w*.35,D.y+D.h*.35, }, - color= D.color and(color[D.color]or D.color)or color.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.white, font= D.font or 30, code= D.code, hide= D.hide, @@ -236,7 +234,7 @@ function WIDGET.newKey(D)--name,x,y,w[,h][,color][,font],code[,hide] D.x+D.w*.35,D.y+D.h*.35, }, - color= D.color and(color[D.color]or D.color)or color.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.white, font= D.font or 30, code= D.code, hide= D.hide, @@ -567,7 +565,7 @@ function WIDGET.newSelector(D)--name,x,y,w[,color],list,disp,code,hide D.x+D.w,D.y, }, - color= D.color and(color[D.color]or D.color)or color.white, + color= D.color and(COLOR[D.color]or D.color)or COLOR.white, list= D.list, disp= D.disp, code= D.code, @@ -870,7 +868,6 @@ function WIDGET.keyPressed(key) local dist=(x-WX)*dir if dist>10 then dist=dist+abs(y-WY)*6.26 - print(W1.name,dist) if dist0 then - for i=1,#Modes do - if Modes[i].name==name and Modes[i].unlock then - for _,unlockName in next,Modes[i].unlock do - if not modeRanks[unlockName]then - modeRanks[unlockName]=0 + for i=1,#MODES do + if MODES[i].name==name and MODES[i].unlock then + for _,unlockName in next,MODES[i].unlock do + if not RANKS[unlockName]then + RANKS[unlockName]=0 end end end @@ -230,7 +242,7 @@ do FILE.saveSetting() end if MOBILE and not SETTING.fullscreen then - LOG.print("如果手机上方状态栏不消失,请到设置界面开启全屏",300,color.yellow) - LOG.print("Switch fullscreen on if titleBar don't disappear",300,color.yellow) + LOG.print("如果手机上方状态栏不消失,请到设置界面开启全屏",300,COLOR.yellow) + LOG.print("Switch fullscreen on if titleBar don't disappear",300,COLOR.yellow) end end \ No newline at end of file diff --git a/modes/GM.lua b/modes/GM.lua index b0b2afba..191222c3 100644 --- a/modes/GM.lua +++ b/modes/GM.lua @@ -12,7 +12,7 @@ local function score(P) end return{ - color=color.lBlue, + color=COLOR.lBlue, env={ noTele=true, minarr=1, diff --git a/modes/attacker_hard.lua b/modes/attacker_hard.lua index daf59e22..d102555c 100644 --- a/modes/attacker_hard.lua +++ b/modes/attacker_hard.lua @@ -1,5 +1,5 @@ return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=30,lock=60, fall=12, diff --git a/modes/attacker_ultimate.lua b/modes/attacker_ultimate.lua index dfbc3e53..e4600ea4 100644 --- a/modes/attacker_ultimate.lua +++ b/modes/attacker_ultimate.lua @@ -1,6 +1,6 @@ local min=math.min return{ - color=color.lYellow, + color=COLOR.lYellow, env={ drop=5,lock=60, fall=8, diff --git a/modes/bigbang.lua b/modes/bigbang.lua index a8c83c05..ae3dbe26 100644 --- a/modes/bigbang.lua +++ b/modes/bigbang.lua @@ -1,6 +1,6 @@ local format=string.format return{ - color=color.lGrey, + color=COLOR.lGrey, env={ drop=1e99,lock=1e99, hold=false, diff --git a/modes/blind_easy.lua b/modes/blind_easy.lua index b221c8de..b0c08518 100644 --- a/modes/blind_easy.lua +++ b/modes/blind_easy.lua @@ -1,6 +1,6 @@ local min=math.min return{ - color=color.cyan, + color=COLOR.cyan, env={ drop=30,lock=45, visible="time", diff --git a/modes/blind_hard.lua b/modes/blind_hard.lua index 7b0911ff..ee9fc3bc 100644 --- a/modes/blind_hard.lua +++ b/modes/blind_hard.lua @@ -1,7 +1,7 @@ local gc=love.graphics local min=math.min return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=15,lock=45, fall=10, diff --git a/modes/blind_lunatic.lua b/modes/blind_lunatic.lua index a34c21ed..2c1348b2 100644 --- a/modes/blind_lunatic.lua +++ b/modes/blind_lunatic.lua @@ -1,7 +1,7 @@ local gc=love.graphics local min=math.min return{ - color=color.red, + color=COLOR.red, env={ drop=10,lock=60, fall=5, diff --git a/modes/blind_normal.lua b/modes/blind_normal.lua index d70b6c1f..bb2da193 100644 --- a/modes/blind_normal.lua +++ b/modes/blind_normal.lua @@ -1,7 +1,7 @@ local gc=love.graphics local min=math.min return{ - color=color.green, + color=COLOR.green, env={ drop=15,lock=45, freshLimit=10, diff --git a/modes/blind_ultimate.lua b/modes/blind_ultimate.lua index c3114390..d55e4aad 100644 --- a/modes/blind_ultimate.lua +++ b/modes/blind_ultimate.lua @@ -1,7 +1,7 @@ local gc=love.graphics local min=math.min return{ - color=color.red, + color=COLOR.red, env={ drop=30,lock=60, block=false,center=0,ghost=0, diff --git a/modes/blind_wtf.lua b/modes/blind_wtf.lua index 62183679..6373815c 100644 --- a/modes/blind_wtf.lua +++ b/modes/blind_wtf.lua @@ -2,7 +2,7 @@ local gc=love.graphics local sin,min=math.sin,math.min local Timer=love.timer.getTime return{ - color=color.red, + color=COLOR.red, env={ drop=30,lock=60, next=1, @@ -18,7 +18,7 @@ return{ load=function() PLY.newPlayer(1,340,15) if SETTING.spawn==0 then - LOG.print(text.switchSpawnSFX,color.yellow) + LOG.print(text.switchSpawnSFX,COLOR.yellow) end end, mesDisp=function(P) diff --git a/modes/c4wtrain_lunatic.lua b/modes/c4wtrain_lunatic.lua index 6ca6f687..5bde1875 100644 --- a/modes/c4wtrain_lunatic.lua +++ b/modes/c4wtrain_lunatic.lua @@ -4,8 +4,8 @@ local function check_c4w(P) P:lose() else for _=1,#P.clearedRow do - P.field[#P.field+1]=freeRow.get(13) - P.visTime[#P.visTime+1]=freeRow.get(20) + P.field[#P.field+1]=FREEROW.get(13) + P.visTime[#P.visTime+1]=FREEROW.get(20) for i=4,7 do P.field[#P.field][i]=0 end end if P.combo>P.modeData.point then @@ -18,7 +18,7 @@ local function check_c4w(P) end return{ - color=color.red, + color=COLOR.red, env={ drop=5,lock=30, dropPiece=check_c4w, @@ -31,8 +31,8 @@ return{ local P=PLAYERS[1] local F=P.field for i=1,24 do - F[i]=freeRow.get(13) - P.visTime[i]=freeRow.get(20) + F[i]=FREEROW.get(13) + P.visTime[i]=FREEROW.get(20) for x=4,7 do F[i][x]=0 end end local r=P:RND(6) diff --git a/modes/c4wtrain_normal.lua b/modes/c4wtrain_normal.lua index a673fbde..92a2b4d0 100644 --- a/modes/c4wtrain_normal.lua +++ b/modes/c4wtrain_normal.lua @@ -2,8 +2,8 @@ local min=math.min local function check_c4w(P) if #P.clearedRow>0 then for _=1,#P.clearedRow do - P.field[#P.field+1]=freeRow.get(13) - P.visTime[#P.visTime+1]=freeRow.get(20) + P.field[#P.field+1]=FREEROW.get(13) + P.visTime[#P.visTime+1]=FREEROW.get(20) for i=4,7 do P.field[#P.field][i]=0 end end if P.combo>P.modeData.point then @@ -16,7 +16,7 @@ local function check_c4w(P) end return{ - color=color.green, + color=COLOR.green, env={ drop=30,lock=60,oncehold=false, dropPiece=check_c4w, @@ -29,8 +29,8 @@ return{ local P=PLAYERS[1] local F=P.field for i=1,24 do - F[i]=freeRow.get(13) - P.visTime[i]=freeRow.get(20) + F[i]=FREEROW.get(13) + P.visTime[i]=FREEROW.get(20) for x=4,7 do F[i][x]=0 end end local r=P:RND(6) diff --git a/modes/classic_fast.lua b/modes/classic_fast.lua index 496dade0..abf029e9 100644 --- a/modes/classic_fast.lua +++ b/modes/classic_fast.lua @@ -15,7 +15,7 @@ local function check_LVup(P) end return{ - color=color.lBlue, + color=COLOR.lBlue, env={ noTele=true, das=16,arr=6,sddas=2,sdarr=2, diff --git a/modes/custom_clear.lua b/modes/custom_clear.lua index 3d43749f..21f022a1 100644 --- a/modes/custom_clear.lua +++ b/modes/custom_clear.lua @@ -17,8 +17,8 @@ local function setField(P,page) local t=P.showTime*3 for y=1,height do local solid=notAir(F[y]) - P.field[y]=freeRow.get(0,solid) - P.visTime[y]=freeRow.get(t) + P.field[y]=FREEROW.get(0,solid) + P.visTime[y]=FREEROW.get(t) if solid then for x=1,10 do P.field[y][x]=F[y][x] @@ -33,8 +33,8 @@ local function checkClear(P) if FIELD[P.modeData.point+1]then P.waiting=26 for _=#P.field,1,-1 do - freeRow.discard(P.field[_]) - freeRow.discard(P.visTime[_]) + FREEROW.discard(P.field[_]) + FREEROW.discard(P.visTime[_]) P.field[_],P.visTime[_]=nil end setField(P,P.modeData.point+1) @@ -46,7 +46,7 @@ local function checkClear(P) end end return{ - color=color.white, + color=COLOR.white, env={}, load=function() for k,v in next,customEnv do @@ -80,9 +80,9 @@ return{ if L~=0 then modeEnv.target=nil if L<6 then - PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",2*L)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",2*L)) else - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L)) end end for _,P in next,PLAYERS.alive do diff --git a/modes/custom_puzzle.lua b/modes/custom_puzzle.lua index 3b696824..7fa1b166 100644 --- a/modes/custom_puzzle.lua +++ b/modes/custom_puzzle.lua @@ -18,8 +18,8 @@ local function puzzleCheck(P) if FIELD[P.modeData.point+1]then P.waiting=26 for _=#P.field,1,-1 do - freeRow.discard(P.field[_]) - freeRow.discard(P.visTime[_]) + FREEROW.discard(P.field[_]) + FREEROW.discard(P.visTime[_]) P.field[_],P.visTime[_]=nil end sysFX.newShade(.7,.3,1,.3,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size) @@ -32,7 +32,7 @@ local function puzzleCheck(P) end return{ - color=color.white, + color=COLOR.white, env={ Fkey=function(P)P.modeData.event=1-P.modeData.event end, dropPiece=puzzleCheck, @@ -56,9 +56,9 @@ return{ if L~=0 then modeEnv.target=nil if L<6 then - PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",2*L)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",2*L)) else - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L)) end end modeEnv.bg=customEnv.bg diff --git a/modes/defender_lunatic.lua b/modes/defender_lunatic.lua index 9741b8da..0ae744b9 100644 --- a/modes/defender_lunatic.lua +++ b/modes/defender_lunatic.lua @@ -1,6 +1,6 @@ local int=math.floor return{ - color=color.red, + color=COLOR.red, env={ drop=5,lock=60, fall=6, diff --git a/modes/defender_normal.lua b/modes/defender_normal.lua index 2578632c..33fb54ac 100644 --- a/modes/defender_normal.lua +++ b/modes/defender_normal.lua @@ -1,6 +1,6 @@ local int=math.floor return{ - color=color.green, + color=COLOR.green, env={ drop=30,lock=60, fall=10, diff --git a/modes/dig_10.lua b/modes/dig_10.lua index 95e5ddfa..47bd8b69 100644 --- a/modes/dig_10.lua +++ b/modes/dig_10.lua @@ -5,7 +5,7 @@ local function check_rise(P) end return{ - color=color.cyan, + color=COLOR.cyan, env={ pushSpeed=6, dropPiece=check_rise, diff --git a/modes/dig_100.lua b/modes/dig_100.lua index 76a3ceda..161965a9 100644 --- a/modes/dig_100.lua +++ b/modes/dig_100.lua @@ -8,7 +8,7 @@ local function check_rise(P) end return{ - color=color.green, + color=COLOR.green, env={ pushSpeed=6, dropPiece=check_rise, diff --git a/modes/dig_40.lua b/modes/dig_40.lua index 0c7f78f9..0b752f82 100644 --- a/modes/dig_40.lua +++ b/modes/dig_40.lua @@ -8,7 +8,7 @@ local function check_rise(P) end return{ - color=color.lBlue, + color=COLOR.lBlue, env={ pushSpeed=6, dropPiece=check_rise, diff --git a/modes/dig_400.lua b/modes/dig_400.lua index f19c2589..5be3d95b 100644 --- a/modes/dig_400.lua +++ b/modes/dig_400.lua @@ -8,7 +8,7 @@ local function check_rise(P) end return{ - color=color.orange, + color=COLOR.orange, env={ pushSpeed=6, dropPiece=check_rise, diff --git a/modes/dig_hard.lua b/modes/dig_hard.lua index f0de4cb3..b2b36104 100644 --- a/modes/dig_hard.lua +++ b/modes/dig_hard.lua @@ -1,6 +1,6 @@ local max=math.max return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=60,lock=120, fall=20, diff --git a/modes/dig_ultimate.lua b/modes/dig_ultimate.lua index eeea8a8d..06a0b6ae 100644 --- a/modes/dig_ultimate.lua +++ b/modes/dig_ultimate.lua @@ -1,6 +1,6 @@ local max=math.max return{ - color=color.lYellow, + color=COLOR.lYellow, env={ drop=10,lock=30, freshLimit=15, diff --git a/modes/drought_lunatic.lua b/modes/drought_lunatic.lua index de31fe99..b5888d96 100644 --- a/modes/drought_lunatic.lua +++ b/modes/drought_lunatic.lua @@ -1,6 +1,6 @@ local min=math.min return{ - color=color.red, + color=COLOR.red, env={ drop=20,lock=60, sequence=function(P) @@ -8,7 +8,7 @@ return{ end, freshMethod=function(P) if not P.next[1] then - local height=freeRow.get(0) + local height=FREEROW.get(0) local max=#P.field if max>0 then --Get heights @@ -87,7 +87,7 @@ return{ end ::END:: - freeRow.discard(height) + FREEROW.discard(height) P:getNext(res[P:RND(#res)]) end end, diff --git a/modes/drought_normal.lua b/modes/drought_normal.lua index dbd75931..2cb26d76 100644 --- a/modes/drought_normal.lua +++ b/modes/drought_normal.lua @@ -1,6 +1,6 @@ local min=math.min return{ - color=color.green, + color=COLOR.green, env={ drop=20,lock=60, sequence="bag", diff --git a/modes/infinite.lua b/modes/infinite.lua index 984ada4a..aaf855a3 100644 --- a/modes/infinite.lua +++ b/modes/infinite.lua @@ -1,6 +1,6 @@ local format=string.format return{ - color=color.lGrey, + color=COLOR.lGrey, env={ drop=1e99,lock=1e99, oncehold=false, diff --git a/modes/infinite_dig.lua b/modes/infinite_dig.lua index 889e6b35..81d8fdad 100644 --- a/modes/infinite_dig.lua +++ b/modes/infinite_dig.lua @@ -27,7 +27,7 @@ local function check_rise(P) end return{ - color=color.white, + color=COLOR.white, env={ drop=1e99,lock=1e99, oncehold=false, diff --git a/modes/marathon_hard.lua b/modes/marathon_hard.lua index b451a9fe..4453ba87 100644 --- a/modes/marathon_hard.lua +++ b/modes/marathon_hard.lua @@ -17,7 +17,7 @@ local function check(P) end return{ - color=color.magenta, + color=COLOR.magenta, env={ noTele=true, mindas=7,minarr=1,minsdarr=1, diff --git a/modes/marathon_normal.lua b/modes/marathon_normal.lua index 3a44e153..9686183e 100644 --- a/modes/marathon_normal.lua +++ b/modes/marathon_normal.lua @@ -14,7 +14,7 @@ local function check_LVup(P) end return{ - color=color.green, + color=COLOR.green, env={ noTele=true, wait=8,fall=20, diff --git a/modes/marathon_ultimate.lua b/modes/marathon_ultimate.lua index 4dd7a15f..07964747 100644 --- a/modes/marathon_ultimate.lua +++ b/modes/marathon_ultimate.lua @@ -21,7 +21,7 @@ local function check_LVup(P) end return{ - color=color.yellow, + color=COLOR.yellow, env={ noTele=true, wait=8,fall=20, diff --git a/modes/master_advance.lua b/modes/master_advance.lua index b482096a..ac3acf04 100644 --- a/modes/master_advance.lua +++ b/modes/master_advance.lua @@ -40,7 +40,7 @@ local function score(P) end return{ - color=color.red, + color=COLOR.red, env={ noTele=true, das=6,arr=1, diff --git a/modes/master_beginner.lua b/modes/master_beginner.lua index 4e9dbbc0..7a8dc649 100644 --- a/modes/master_beginner.lua +++ b/modes/master_beginner.lua @@ -42,7 +42,7 @@ local function score(P) end return{ - color=color.red, + color=COLOR.red, env={ noTele=true, das=9,arr=3, diff --git a/modes/master_final.lua b/modes/master_final.lua index 6b410606..964c4e59 100644 --- a/modes/master_final.lua +++ b/modes/master_final.lua @@ -40,7 +40,7 @@ local function score(P) end return{ - color=color.lGrey, + color=COLOR.lGrey, env={ noTele=true, das=5,arr=1, diff --git a/modes/master_phantasm.lua b/modes/master_phantasm.lua index 09b5dd45..1e812adb 100644 --- a/modes/master_phantasm.lua +++ b/modes/master_phantasm.lua @@ -38,8 +38,8 @@ local function check_LVup(P) P.field[i][P:RND(10)]=0 end else - P.field[i]=freeRow.get(0) - P.visTime[i]=freeRow.get(30) + P.field[i]=FREEROW.get(0) + P.visTime[i]=FREEROW.get(30) for j=1,10 do if P:RND()>.9 then P.field[i][j]=math.random(16) @@ -132,7 +132,7 @@ local function check_LVup(P) end return{ - color=color.black, + color=COLOR.black, env={ noTele=true, das=5,arr=1, diff --git a/modes/pcchallenge_hard.lua b/modes/pcchallenge_hard.lua index f7e64900..ed094714 100644 --- a/modes/pcchallenge_hard.lua +++ b/modes/pcchallenge_hard.lua @@ -1,5 +1,5 @@ return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=60,lock=120, fall=10, diff --git a/modes/pcchallenge_lunatic.lua b/modes/pcchallenge_lunatic.lua index d00e01e0..dc12c969 100644 --- a/modes/pcchallenge_lunatic.lua +++ b/modes/pcchallenge_lunatic.lua @@ -1,5 +1,5 @@ return{ - color=color.red, + color=COLOR.red, env={ drop=20,lock=60, fall=20, diff --git a/modes/pcchallenge_normal.lua b/modes/pcchallenge_normal.lua index fe73d0e1..0038e889 100644 --- a/modes/pcchallenge_normal.lua +++ b/modes/pcchallenge_normal.lua @@ -1,5 +1,5 @@ return{ - color=color.green, + color=COLOR.green, env={ oncehold=false, drop=300,lock=1e99, diff --git a/modes/pctrain_lunatic.lua b/modes/pctrain_lunatic.lua index 11c5d3a6..a1ed8e39 100644 --- a/modes/pctrain_lunatic.lua +++ b/modes/pctrain_lunatic.lua @@ -47,7 +47,7 @@ local function newPC(P) end return{ - color=color.red, + color=COLOR.red, env={ next=4, hold=false, diff --git a/modes/pctrain_normal.lua b/modes/pctrain_normal.lua index a358f55f..644b0461 100644 --- a/modes/pctrain_normal.lua +++ b/modes/pctrain_normal.lua @@ -40,7 +40,7 @@ local function newPC(P) end end return{ - color=color.green, + color=COLOR.green, env={ next=4, hold=false, diff --git a/modes/round_1.lua b/modes/round_1.lua index bc85a69d..12df5ecf 100644 --- a/modes/round_1.lua +++ b/modes/round_1.lua @@ -11,7 +11,7 @@ local function update_round(P) end return{ - color=color.cyan, + color=COLOR.cyan, env={ drop=300,lock=300, oncehold=false, @@ -20,7 +20,7 @@ return{ }, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,10000)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",10,1,true,10000)) GAME.garbageSpeed=1e99 end, score=function(P)return{P.stat.piece,P.stat.time}end, diff --git a/modes/round_2.lua b/modes/round_2.lua index 3f071e66..c9eac0d8 100644 --- a/modes/round_2.lua +++ b/modes/round_2.lua @@ -11,7 +11,7 @@ local function update_round(P) end return{ - color=color.green, + color=COLOR.green, env={ drop=300,lock=300, oncehold=false, @@ -20,7 +20,7 @@ return{ }, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,13000)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",10,1,true,13000)) GAME.garbageSpeed=1e99 end, score=function(P)return{P.stat.piece,P.stat.time}end, diff --git a/modes/round_3.lua b/modes/round_3.lua index 6a60842a..bc31e8a7 100644 --- a/modes/round_3.lua +++ b/modes/round_3.lua @@ -11,7 +11,7 @@ local function update_round(P) end return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=300,lock=300, oncehold=false, @@ -20,7 +20,7 @@ return{ }, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,2,true,16000)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",10,2,true,16000)) GAME.garbageSpeed=1e99 end, score=function(P)return{P.stat.piece,P.stat.time}end, diff --git a/modes/round_4.lua b/modes/round_4.lua index 4bbc3094..d0152a1f 100644 --- a/modes/round_4.lua +++ b/modes/round_4.lua @@ -11,7 +11,7 @@ local function update_round(P) end return{ - color=color.red, + color=COLOR.red, env={ drop=300,lock=300, oncehold=false, @@ -20,7 +20,7 @@ return{ }, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,26000)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",10,3,true,26000)) GAME.garbageSpeed=1e99 end, score=function(P)return{P.stat.piece,P.stat.time}end, diff --git a/modes/round_5.lua b/modes/round_5.lua index efd80962..3562fab5 100644 --- a/modes/round_5.lua +++ b/modes/round_5.lua @@ -11,7 +11,7 @@ local function update_round(P) end return{ - color=color.lYellow, + color=COLOR.lYellow, env={ drop=300,lock=300, oncehold=false, @@ -20,7 +20,7 @@ return{ }, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,40000)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",10,3,true,40000)) GAME.garbageSpeed=1e99 end, score=function(P)return{P.stat.piece,P.stat.time}end, diff --git a/modes/solo_1.lua b/modes/solo_1.lua index 396f0eb8..b38523ef 100644 --- a/modes/solo_1.lua +++ b/modes/solo_1.lua @@ -1,5 +1,5 @@ return{ - color=color.cyan, + color=COLOR.cyan, env={ life=2, drop=60,lock=60, @@ -9,7 +9,7 @@ return{ pauseLimit=true, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",4)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",4)) end, score=function(P)return{P.stat.time}end, scoreDisp=function(D)return toTime(D[1])end, diff --git a/modes/solo_2.lua b/modes/solo_2.lua index 019183fd..bd475f70 100644 --- a/modes/solo_2.lua +++ b/modes/solo_2.lua @@ -1,5 +1,5 @@ return{ - color=color.green, + color=COLOR.green, env={ life=2, drop=60,lock=60, @@ -9,7 +9,7 @@ return{ pauseLimit=true, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",5)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",5)) end, score=function(P)return{P.stat.time}end, scoreDisp=function(D)return toTime(D[1])end, diff --git a/modes/solo_3.lua b/modes/solo_3.lua index 10da0d9c..68ad7704 100644 --- a/modes/solo_3.lua +++ b/modes/solo_3.lua @@ -1,5 +1,5 @@ return{ - color=color.magenta, + color=COLOR.magenta, env={ life=2, drop=60,lock=60, @@ -9,7 +9,7 @@ return{ pauseLimit=true, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",6)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",6)) end, score=function(P)return{P.stat.time}end, scoreDisp=function(D)return toTime(D[1])end, diff --git a/modes/solo_4.lua b/modes/solo_4.lua index 96966092..43c6b495 100644 --- a/modes/solo_4.lua +++ b/modes/solo_4.lua @@ -1,5 +1,5 @@ return{ - color=color.red, + color=COLOR.red, env={ life=2, drop=60,lock=60, @@ -9,7 +9,7 @@ return{ pauseLimit=true, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",6,2,true,30000)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",6,2,true,30000)) end, score=function(P)return{P.stat.time}end, scoreDisp=function(D)return toTime(D[1])end, diff --git a/modes/solo_5.lua b/modes/solo_5.lua index 5c3c056d..50540647 100644 --- a/modes/solo_5.lua +++ b/modes/solo_5.lua @@ -1,5 +1,5 @@ return{ - color=color.lYellow, + color=COLOR.lYellow, env={ life=2, drop=60,lock=60, @@ -9,7 +9,7 @@ return{ pauseLimit=true, load=function() PLY.newPlayer(1,340,15) - PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",7,3,true,50000)) + PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",7,3,true,50000)) end, score=function(P)return{P.stat.time}end, scoreDisp=function(D)return toTime(D[1])end, diff --git a/modes/sprintFix.lua b/modes/sprintFix.lua index f05b5bde..47d8016b 100644 --- a/modes/sprintFix.lua +++ b/modes/sprintFix.lua @@ -1,5 +1,5 @@ return{ - color=color.green, + color=COLOR.green, env={ drop=60,lock=180, noTele=true, diff --git a/modes/sprintLock.lua b/modes/sprintLock.lua index 66a7b2c0..78092a28 100644 --- a/modes/sprintLock.lua +++ b/modes/sprintLock.lua @@ -1,5 +1,5 @@ return{ - color=color.green, + color=COLOR.green, env={ drop=60,lock=180, keyCancel={3,4,5}, diff --git a/modes/sprintMPH.lua b/modes/sprintMPH.lua index 2b579ccb..807bc912 100644 --- a/modes/sprintMPH.lua +++ b/modes/sprintMPH.lua @@ -1,5 +1,5 @@ return{ - color=color.green, + color=COLOR.green, env={ drop=60,lock=60, next=0,hold=false, diff --git a/modes/sprintPenta.lua b/modes/sprintPenta.lua index c8caee4e..ba268f6f 100644 --- a/modes/sprintPenta.lua +++ b/modes/sprintPenta.lua @@ -1,5 +1,5 @@ return{ - color=color.green, + color=COLOR.green, env={ drop=60,lock=60, sequence="bag",bag={8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}, diff --git a/modes/sprint_10.lua b/modes/sprint_10.lua index c865de3d..2d9a2998 100644 --- a/modes/sprint_10.lua +++ b/modes/sprint_10.lua @@ -1,5 +1,5 @@ return{ - color=color.cyan, + color=COLOR.cyan, env={ drop=60,lock=60, target=10,dropPiece=PLY.check_lineReach, diff --git a/modes/sprint_100.lua b/modes/sprint_100.lua index 1c126ed4..d837f591 100644 --- a/modes/sprint_100.lua +++ b/modes/sprint_100.lua @@ -1,5 +1,5 @@ return{ - color=color.red, + color=COLOR.red, env={ drop=60,lock=60, target=100,dropPiece=PLY.check_lineReach, diff --git a/modes/sprint_1000.lua b/modes/sprint_1000.lua index 58e8d35a..d63fd503 100644 --- a/modes/sprint_1000.lua +++ b/modes/sprint_1000.lua @@ -1,5 +1,5 @@ return{ - color=color.lGrey, + color=COLOR.lGrey, env={ drop=60,lock=60, target=1000,dropPiece=PLY.check_lineReach, diff --git a/modes/sprint_20.lua b/modes/sprint_20.lua index e72bc878..89578120 100644 --- a/modes/sprint_20.lua +++ b/modes/sprint_20.lua @@ -1,5 +1,5 @@ return{ - color=color.lBlue, + color=COLOR.lBlue, env={ drop=60,lock=60, target=20,dropPiece=PLY.check_lineReach, diff --git a/modes/sprint_40.lua b/modes/sprint_40.lua index f62a4ec7..0cf894c8 100644 --- a/modes/sprint_40.lua +++ b/modes/sprint_40.lua @@ -1,5 +1,5 @@ return{ - color=color.green, + color=COLOR.green, env={ drop=60,lock=60, target=40,dropPiece=PLY.check_lineReach, diff --git a/modes/sprint_400.lua b/modes/sprint_400.lua index 13ef0fe3..d92c97d9 100644 --- a/modes/sprint_400.lua +++ b/modes/sprint_400.lua @@ -1,5 +1,5 @@ return{ - color=color.dRed, + color=COLOR.dRed, env={ drop=60,lock=60, target=400,dropPiece=PLY.check_lineReach, diff --git a/modes/survivor_easy.lua b/modes/survivor_easy.lua index 65004ae1..a3629e32 100644 --- a/modes/survivor_easy.lua +++ b/modes/survivor_easy.lua @@ -1,6 +1,6 @@ local max=math.max return{ - color=color.cyan, + color=COLOR.cyan, env={ drop=30,lock=45, freshLimit=10, diff --git a/modes/survivor_hard.lua b/modes/survivor_hard.lua index c2528c0b..ac4ee36a 100644 --- a/modes/survivor_hard.lua +++ b/modes/survivor_hard.lua @@ -1,6 +1,6 @@ local max=math.max return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=30,lock=45, freshLimit=10, diff --git a/modes/survivor_lunatic.lua b/modes/survivor_lunatic.lua index 2079b647..083d8f9b 100644 --- a/modes/survivor_lunatic.lua +++ b/modes/survivor_lunatic.lua @@ -1,6 +1,6 @@ local max=math.max return{ - color=color.red, + color=COLOR.red, env={ drop=30,lock=45, freshLimit=10, diff --git a/modes/survivor_normal.lua b/modes/survivor_normal.lua index efb4543a..346ab336 100644 --- a/modes/survivor_normal.lua +++ b/modes/survivor_normal.lua @@ -1,6 +1,6 @@ local max=math.max return{ - color=color.green, + color=COLOR.green, env={ drop=30,lock=45, freshLimit=10, diff --git a/modes/survivor_ultimate.lua b/modes/survivor_ultimate.lua index 4baf5c1b..06f898eb 100644 --- a/modes/survivor_ultimate.lua +++ b/modes/survivor_ultimate.lua @@ -1,6 +1,6 @@ local max=math.max return{ - color=color.lYellow, + color=COLOR.lYellow, env={ drop=5,lock=60, fall=10, diff --git a/modes/tech_finesse.lua b/modes/tech_finesse.lua index c5a1ad38..6e5405b2 100644 --- a/modes/tech_finesse.lua +++ b/modes/tech_finesse.lua @@ -1,7 +1,7 @@ local format=string.format local int=math.floor return{ - color=color.lYellow, + color=COLOR.lYellow, env={ arr=0, drop=1e99,lock=60, diff --git a/modes/tech_finesse2.lua b/modes/tech_finesse2.lua index 0181887e..3408d8c1 100644 --- a/modes/tech_finesse2.lua +++ b/modes/tech_finesse2.lua @@ -13,7 +13,7 @@ local function tech_check_hard(P) end return{ - color=color.grey, + color=COLOR.grey, env={ arr=0, drop=1e99,lock=60, diff --git a/modes/tech_hard.lua b/modes/tech_hard.lua index 36db2c11..ebbfccaa 100644 --- a/modes/tech_hard.lua +++ b/modes/tech_hard.lua @@ -9,7 +9,7 @@ local function tech_check_easy(P) end return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=20,lock=60, freshLimit=15, diff --git a/modes/tech_hard2.lua b/modes/tech_hard2.lua index 61ccfa9d..cf5df31b 100644 --- a/modes/tech_hard2.lua +++ b/modes/tech_hard2.lua @@ -13,7 +13,7 @@ local function tech_check_hard(P) end return{ - color=color.dMagenta, + color=COLOR.dMagenta, env={ drop=30,lock=60, freshLimit=15, diff --git a/modes/tech_lunatic.lua b/modes/tech_lunatic.lua index e6f12c25..38ab16fb 100644 --- a/modes/tech_lunatic.lua +++ b/modes/tech_lunatic.lua @@ -9,7 +9,7 @@ local function tech_check_easy(P) end return{ - color=color.red, + color=COLOR.red, env={ drop=0,lock=60, freshLimit=15, diff --git a/modes/tech_lunatic2.lua b/modes/tech_lunatic2.lua index 57de02e6..4298c70c 100644 --- a/modes/tech_lunatic2.lua +++ b/modes/tech_lunatic2.lua @@ -13,7 +13,7 @@ local function tech_check_hard(P) end return{ - color=color.dRed, + color=COLOR.dRed, env={ drop=0,lock=60, freshLimit=15, diff --git a/modes/tech_normal.lua b/modes/tech_normal.lua index 2e0805ce..498f036f 100644 --- a/modes/tech_normal.lua +++ b/modes/tech_normal.lua @@ -9,7 +9,7 @@ local function tech_check_easy(P) end return{ - color=color.green, + color=COLOR.green, env={ oncehold=false, drop=1e99,lock=1e99, diff --git a/modes/tech_normal2.lua b/modes/tech_normal2.lua index dc48193b..27af2cf7 100644 --- a/modes/tech_normal2.lua +++ b/modes/tech_normal2.lua @@ -13,7 +13,7 @@ local function tech_check_hard(P) end return{ - color=color.dGreen, + color=COLOR.dGreen, env={ oncehold=false, drop=1e99,lock=1e99, diff --git a/modes/techmino49_easy.lua b/modes/techmino49_easy.lua index 44c7fc52..90a1bd14 100644 --- a/modes/techmino49_easy.lua +++ b/modes/techmino49_easy.lua @@ -16,7 +16,7 @@ local function selectTarget(P) end return{ - color=color.cyan, + color=COLOR.cyan, env={ drop=60,lock=60, fall=20, @@ -41,17 +41,17 @@ return{ local n=2 for i=1,4 do for j=1,6 do if L[n]then - PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,6))) + PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AIBUILDER("9S",rnd(4,6))) else - PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(2,4),2,true,20000)) + PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AIBUILDER("CC",rnd(2,4),2,true,20000)) end n=n+1 end end for i=9,12 do for j=1,6 do if L[n]then - PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,5))) + PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AIBUILDER("9S",rnd(4,5))) else - PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(3,5),2,true,20000)) + PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AIBUILDER("CC",rnd(3,5),2,true,20000)) end n=n+1 end end diff --git a/modes/techmino49_hard.lua b/modes/techmino49_hard.lua index 14520e5b..8e067627 100644 --- a/modes/techmino49_hard.lua +++ b/modes/techmino49_hard.lua @@ -16,7 +16,7 @@ local function selectTarget(P) end return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=60,lock=60, fall=20, @@ -41,17 +41,17 @@ return{ local n=2 for i=1,4 do for j=1,6 do if L[n]then - PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,8))) + PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AIBUILDER("9S",rnd(4,8))) else - PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(3,6),3,true,30000)) + PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AIBUILDER("CC",rnd(3,6),3,true,30000)) end n=n+1 end end for i=9,12 do for j=1,6 do if L[n]then - PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,7))) + PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AIBUILDER("9S",rnd(4,7))) else - PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,6),3,true,30000)) + PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AIBUILDER("CC",rnd(4,6),3,true,30000)) end n=n+1 end end diff --git a/modes/techmino49_ultimate.lua b/modes/techmino49_ultimate.lua index b790bac2..b2d98aeb 100644 --- a/modes/techmino49_ultimate.lua +++ b/modes/techmino49_ultimate.lua @@ -16,7 +16,7 @@ local function selectTarget(P) end return{ - color=color.lYellow, + color=COLOR.lYellow, env={ drop=15,lock=60, fall=20, @@ -41,17 +41,17 @@ return{ local n=2 for i=1,4 do for j=1,6 do if L[n]then - PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(8,10))) + PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AIBUILDER("9S",rnd(8,10))) else - PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,7),3,true,40000)) + PLY.newAIPlayer(n,78*i-54,115*j-98,.09,AIBUILDER("CC",rnd(4,7),3,true,40000)) end n=n+1 end end for i=9,12 do for j=1,6 do if L[n]then - PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(8,9))) + PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AIBUILDER("9S",rnd(8,9))) else - PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(5,8),3,true,40000)) + PLY.newAIPlayer(n,78*i+267,115*j-98,.09,AIBUILDER("CC",rnd(5,8),3,true,40000)) end n=n+1 end end diff --git a/modes/techmino99_easy.lua b/modes/techmino99_easy.lua index f7ababaf..873ce23a 100644 --- a/modes/techmino99_easy.lua +++ b/modes/techmino99_easy.lua @@ -16,7 +16,7 @@ local function selectTarget(P) end return{ - color=color.cyan, + color=COLOR.cyan, env={ drop=60,lock=60, fall=20, @@ -41,17 +41,17 @@ return{ local n=2 for i=1,7 do for j=1,7 do if L[n]then - PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,6))) + PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AIBUILDER("9S",rnd(4,6))) else - PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(2,4),2,true,20000)) + PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AIBUILDER("CC",rnd(2,4),2,true,20000)) end n=n+1 end end for i=15,21 do for j=1,7 do if L[n]then - PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,5))) + PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AIBUILDER("9S",rnd(4,5))) else - PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(3,5),2,true,20000)) + PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AIBUILDER("CC",rnd(3,5),2,true,20000)) end n=n+1 end end diff --git a/modes/techmino99_hard.lua b/modes/techmino99_hard.lua index 90efbd5f..02b79d62 100644 --- a/modes/techmino99_hard.lua +++ b/modes/techmino99_hard.lua @@ -16,7 +16,7 @@ local function selectTarget(P) end return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=60,lock=60, fall=20, @@ -41,17 +41,17 @@ return{ local n=2 for i=1,7 do for j=1,7 do if L[n]then - PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,8))) + PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AIBUILDER("9S",rnd(4,8))) else - PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(3,6),3,true,30000)) + PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AIBUILDER("CC",rnd(3,6),3,true,30000)) end n=n+1 end end for i=15,21 do for j=1,7 do if L[n]then - PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,7))) + PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AIBUILDER("9S",rnd(4,7))) else - PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6),3,true,30000)) + PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AIBUILDER("CC",rnd(4,6),3,true,30000)) end n=n+1 end end diff --git a/modes/techmino99_ultimate.lua b/modes/techmino99_ultimate.lua index d62d8c7d..a0cf7d70 100644 --- a/modes/techmino99_ultimate.lua +++ b/modes/techmino99_ultimate.lua @@ -16,7 +16,7 @@ local function selectTarget(P) end return{ - color=color.lYellow, + color=COLOR.lYellow, env={ drop=15,lock=60, fall=20, @@ -41,17 +41,17 @@ return{ local n=2 for i=1,7 do for j=1,7 do if L[n]then - PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(8,10))) + PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AIBUILDER("9S",rnd(8,10))) else - PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,7),3,true,40000)) + PLY.newAIPlayer(n,46*i-36,97*j-72,.068,AIBUILDER("CC",rnd(4,7),3,true,40000)) end n=n+1 end end for i=15,21 do for j=1,7 do if L[n]then - PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(8,9))) + PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AIBUILDER("9S",rnd(8,9))) else - PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(5,8),3,true,40000)) + PLY.newAIPlayer(n,46*i+264,97*j-72,.068,AIBUILDER("CC",rnd(5,8),3,true,40000)) end n=n+1 end end diff --git a/modes/tsd_easy.lua b/modes/tsd_easy.lua index b173efe1..d5c763ae 100644 --- a/modes/tsd_easy.lua +++ b/modes/tsd_easy.lua @@ -10,7 +10,7 @@ local function check_tsd(P) end return{ - color=color.green, + color=COLOR.green, env={ drop=1e99,lock=1e99, oncehold=false, diff --git a/modes/tsd_hard.lua b/modes/tsd_hard.lua index 6d375b4a..427291a1 100644 --- a/modes/tsd_hard.lua +++ b/modes/tsd_hard.lua @@ -10,7 +10,7 @@ local function check_tsd(P) end return{ - color=color.magenta, + color=COLOR.magenta, env={ drop=60,lock=60, freshLimit=15, diff --git a/modes/tsd_ultimate.lua b/modes/tsd_ultimate.lua index b6663a74..c536a1da 100644 --- a/modes/tsd_ultimate.lua +++ b/modes/tsd_ultimate.lua @@ -10,7 +10,7 @@ local function check_tsd(P) end return{ - color=color.lYellow, + color=COLOR.lYellow, env={ drop=60,lock=60, freshLimit=15, diff --git a/modes/ultra.lua b/modes/ultra.lua index 85c11988..3924738b 100644 --- a/modes/ultra.lua +++ b/modes/ultra.lua @@ -1,7 +1,7 @@ local gc=love.graphics local warnTime={60,90,105,115,116,117,118,119,120} return{ - color=color.lGrey, + color=COLOR.lGrey, env={ noTele=true, minarr=1,minsdarr=1, diff --git a/modes/zen.lua b/modes/zen.lua index 8468900a..3c8a231f 100644 --- a/modes/zen.lua +++ b/modes/zen.lua @@ -1,5 +1,5 @@ return{ - color=color.lGrey, + color=COLOR.lGrey, env={ drop=120,lock=120, oncehold=false, diff --git a/parts/AITemplate.lua b/parts/AITemplate.lua index bba8c5fa..3fc94405 100644 --- a/parts/AITemplate.lua +++ b/parts/AITemplate.lua @@ -1,4 +1,4 @@ - local AISpeed={60,50,40,30,20,14,10,6,4,3} +local AISpeed={60,50,40,30,20,14,10,6,4,3} return function(type,speedLV,next,hold,node) if type=="CC"then return{ diff --git a/parts/ai.lua b/parts/ai.lua index 80e7b906..76bde561 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -113,8 +113,8 @@ local function ifoverlapAI(f,bk,x,y) if f[y+i-1]and bk[i][j]and f[y+i-1][x+j-1]>0 then return true end end end end -local discardRow=freeRow.discard -local getRow=freeRow.get +local discardRow=FREEROW.discard +local getRow=FREEROW.get local function resetField(f0,f,start) for _=#f,start,-1 do discardRow(f[_]) @@ -215,7 +215,7 @@ return{ if not bn then goto CTN end for dir=0,dirCount[bn]do--Each dir - local cb=blocks[bn][dir] + local cb=BLOCKS[bn][dir] for cx=1,11-#cb[1]do--Each pos local cy=#Tfield+1 diff --git a/parts/backgrounds/aura.lua b/parts/backgrounds/aura.lua new file mode 100644 index 00000000..15eb1e1d --- /dev/null +++ b/parts/backgrounds/aura.lua @@ -0,0 +1,24 @@ +--Cool liquid background +local gc=love.graphics +local rnd=math.random +local back={} + +local t +function back.init() + t=rnd()*2600 + BG.resize(SCR.w,SCR.h) +end +function back.resize(_,h) + SHADER.aura:send("w",SCR.W) + SHADER.aura:send("h",h*SCR.dpi) +end +function back.update(dt) + t=t+dt +end +function back.draw() + SHADER.aura:send("t",t) + gc.setShader(SHADER.aura) + gc.rectangle("fill",0,0,SCR.w,SCR.h) + gc.setShader() +end +return back \ No newline at end of file diff --git a/parts/backgrounds/badapple.lua b/parts/backgrounds/badapple.lua new file mode 100644 index 00000000..5a99f238 --- /dev/null +++ b/parts/backgrounds/badapple.lua @@ -0,0 +1,56 @@ +--Bad Apple!! (128x96, 10fps, 2192f) +local gc=love.graphics +local int=math.floor +local back={} + +local bAnd,bRshift=bit.band,bit.rshift +local t +local video +local X,Y,K +function back.init() + if not video then + video=love.data.decompress("string","zlib",love.filesystem.read("Zframework/badapple.dat")) + end + t=0 + BG.resize() +end +function back.resize() + local W,H=SCR.w,SCR.h + if H/W>=96/128 then + K=W/128 + X,Y=0,(H-W*96/128)*.5 + else + K=H/96 + X,Y=(W-H*128/96)*.5,0 + end +end +function back.update() + t=t+1 + if t==13146 then + t=0 + end +end +function back.draw() + gc.clear(.2,.2,.2) + gc.push("transform") + gc.origin() + gc.translate(X,Y) + gc.scale(K) + gc.setColor(.4,.4,.4) + local t1=1536*int(t/6)+1 + for i=0,1535 do + local B=video:byte(t1+i) + for j=7,0,-1 do + local p=8*i+j + if bAnd(B,1)==0 then + gc.rectangle("fill",p%128,int(p/128),1,1) + end + B=bRshift(B,1) + end + end + gc.pop() +end +function back.discard() + video=nil +end +return back \ No newline at end of file diff --git a/parts/backgrounds/bg1.lua b/parts/backgrounds/bg1.lua new file mode 100644 index 00000000..da1e436d --- /dev/null +++ b/parts/backgrounds/bg1.lua @@ -0,0 +1,23 @@ +--Horizonal red-blue gradient +local gc=love.graphics +local rnd=math.random +local back={} + +local t +function back.init() + t=rnd()*2600 + BG.resize() +end +function back.resize() + SHADER.gradient1:send("w",SCR.W) +end +function back.update(dt) + t=t+dt +end +function back.draw() + SHADER.gradient1:send("t",t) + gc.setShader(SHADER.gradient1) + gc.rectangle("fill",0,0,SCR.w,SCR.h) + gc.setShader() +end +return back \ No newline at end of file diff --git a/parts/backgrounds/bg2.lua b/parts/backgrounds/bg2.lua new file mode 100644 index 00000000..e18ece21 --- /dev/null +++ b/parts/backgrounds/bg2.lua @@ -0,0 +1,23 @@ +--Vertical red-green gradient +local gc=love.graphics +local rnd=math.random +local back={} + +local t +function back.init() + t=rnd()*2600 + BG.resize(nil,SCR.h) +end +function back.resize(_,h) + SHADER.gradient2:send("h",h*SCR.dpi) +end +function back.update(dt) + t=t+dt +end +function back.draw() + SHADER.gradient2:send("t",t) + gc.setShader(SHADER.gradient2) + gc.rectangle("fill",0,0,SCR.w,SCR.h) + gc.setShader() +end +return back \ No newline at end of file diff --git a/parts/backgrounds/fan.lua b/parts/backgrounds/fan.lua new file mode 100644 index 00000000..9204de28 --- /dev/null +++ b/parts/backgrounds/fan.lua @@ -0,0 +1,75 @@ +--UUZ's fan +local gc=love.graphics +local rnd=math.random +local max,min,sin=math.max,math.min,math.sin +local ins,rem=table.insert,table.remove +local back={} + +local t +local fan,petal +function back.init() + t=rnd(2600) + fan=title_fan + petal={} + BG.resize() +end +function back.update() + t=t+1 + if t%10==0 then + ins(petal,{ + x=SCR.w*rnd(), + y=0, + vy=2+rnd()*2, + vx=rnd()*2-.5, + rx=4+rnd()*4, + ry=4+rnd()*4, + }) + end + for i=#petal,1,-1 do + local P=petal[i] + P.y=P.y+P.vy + if P.y>SCR.h then + rem(petal,i) + else + P.x=P.x+P.vx + P.vx=P.vx+rnd()*.01 + P.rx=max(min(P.rx+rnd()-.5,10),2) + P.ry=max(min(P.ry+rnd()-.5,10),2) + end + end +end +function back.draw() + gc.push("transform") + gc.translate(SCR.w/2,SCR.h/2+20*sin(t*.02)) + gc.scale(SCR.k) + gc.clear(.1,.1,.1) + gc.setLineWidth(320) + gc.setColor(.3,.2,.3) + gc.arc("line","open",0,420,500,-.8*3.1416,-.2*3.1416) + + gc.setLineWidth(4) + gc.setColor(.7,.5,.65) + gc.arc("line","open",0,420,660,-.799*3.1416,-.201*3.1416) + gc.arc("line","open",0,420,340,-.808*3.1416,-.192*3.1416) + gc.line(-281,224,-530,30.5) + gc.line(281,224,530,30.5) + + gc.setLineWidth(6) + gc.setColor(.55,.5,.6) + for i=1,8 do + gc.polygon("line",fan[i]) + end + + gc.setLineWidth(2) + gc.setColor(.6,.3,.5) + gc.origin() + for i=1,#petal do + local P=petal[i] + gc.ellipse("fill",P.x,P.y,P.rx,P.ry) + end + gc.pop() +end +function back.discard() + petal=nil +end +return back \ No newline at end of file diff --git a/parts/backgrounds/flink.lua b/parts/backgrounds/flink.lua new file mode 100644 index 00000000..f02870fb --- /dev/null +++ b/parts/backgrounds/flink.lua @@ -0,0 +1,19 @@ +--Flash after random time +local gc=love.graphics +local rnd=math.random +local back={} + +local t +function back.init() + t=rnd()*2600 +end +function back.update(dt) + t=t+dt +end +function back.draw() + local t1=.13-t%3%1.9 + if t1<.2 then gc.clear(t1,t1,t1) + else gc.clear(0,0,0) + end +end +return back \ No newline at end of file diff --git a/parts/backgrounds/glow.lua b/parts/backgrounds/glow.lua new file mode 100644 index 00000000..19c3b105 --- /dev/null +++ b/parts/backgrounds/glow.lua @@ -0,0 +1,17 @@ +--Light-dark +local gc=love.graphics +local rnd,sin=math.random,math.sin +local back={} + +local t +function back.init() + t=rnd()*2600 +end +function back.update(dt) + t=t+dt +end +function back.draw() + local t1=(sin(t*.5)+sin(t*.7)+sin(t*.9+1)+sin(t*1.5)+sin(t*2+10))*.08 + gc.clear(t1,t1,t1) +end +return back \ No newline at end of file diff --git a/parts/backgrounds/grey.lua b/parts/backgrounds/grey.lua new file mode 100644 index 00000000..57784406 --- /dev/null +++ b/parts/backgrounds/grey.lua @@ -0,0 +1,6 @@ +local gc=love.graphics +local back={} +function back.draw() + gc.clear(.3,.3,.3) +end +return back \ No newline at end of file diff --git a/parts/backgrounds/lightning.lua b/parts/backgrounds/lightning.lua new file mode 100644 index 00000000..51f1d1e0 --- /dev/null +++ b/parts/backgrounds/lightning.lua @@ -0,0 +1,19 @@ +--Lightning +local gc=love.graphics +local rnd=math.random +local back={} + +local t +function back.init() + t=rnd()*2600 +end +function back.update(dt) + t=t+dt +end +function back.draw() + local t1=2.5-t%20%6%2.5 + if t1<.3 then gc.clear(t1,t1,t1) + else gc.clear(0,0,0) + end +end +return back \ No newline at end of file diff --git a/parts/backgrounds/lightning2.lua b/parts/backgrounds/lightning2.lua new file mode 100644 index 00000000..67cbd288 --- /dev/null +++ b/parts/backgrounds/lightning2.lua @@ -0,0 +1,27 @@ +--Fast lightning + spining tetromino +local gc=love.graphics +local int,rnd=math.floor,math.random +local back={} + +local t +local colorLib +local blocks=BLOCKS +local scs=spinCenters +function back.init() + colorLib=SKIN.libColor + t=rnd()*2600 +end +function back.update(dt) + t=t+dt +end +function back.draw() + local R=7-int(t*.5%7) + local T=1.2-t%10%3%1.2 + if T<.3 then gc.clear(T,T,T) + else gc.clear(0,0,0) + end + local _=colorLib[SETTING.skin[R]] + gc.setColor(_[1],_[2],_[3],.12) + gc.draw(TEXTURE.miniBlock[R],640,360,t%3.1416*6,400,400,scs[R][0][2]+.5,#blocks[R][0]-scs[R][0][1]-.5) +end +return back \ No newline at end of file diff --git a/parts/backgrounds/matrix.lua b/parts/backgrounds/matrix.lua new file mode 100644 index 00000000..17c41d0c --- /dev/null +++ b/parts/backgrounds/matrix.lua @@ -0,0 +1,29 @@ +--Black-White grid +local gc=love.graphics +local rnd,sin=math.random,math.sin +local ceil=math.ceil +local back={} + +local t +local matrixT={}for i=1,50 do matrixT[i]={}for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end +function back.init() + t=rnd()*2600 +end +function back.update(dt) + t=t+dt +end +function back.draw() + gc.clear(.15,.15,.15) + gc.push("transform") + local k=SCR.k + gc.scale(k) + local Y=ceil(SCR.h/80/k) + for x=1,ceil(SCR.w/80/k)do + for y=1,Y do + gc.setColor(1,1,1,sin(x+matrixT[x][y]*t)*.1+.1) + gc.rectangle("fill",80*x,80*y,-80,-80) + end + end + gc.pop() +end +return back \ No newline at end of file diff --git a/parts/backgrounds/none.lua b/parts/backgrounds/none.lua new file mode 100644 index 00000000..c2f8a071 --- /dev/null +++ b/parts/backgrounds/none.lua @@ -0,0 +1,6 @@ +local gc=love.graphics +local back={} +function back.draw() + gc.clear(.15,.15,.15) +end +return back \ No newline at end of file diff --git a/parts/backgrounds/rainbow.lua b/parts/backgrounds/rainbow.lua new file mode 100644 index 00000000..bf112bbd --- /dev/null +++ b/parts/backgrounds/rainbow.lua @@ -0,0 +1,24 @@ +--Colorful RGB +local gc=love.graphics +local rnd=math.random +local back={} + +local t +function back.init() + t=rnd()*2600 + BG.resize(SCR.w,SCR.h) +end +function back.resize(_,h) + SHADER.rgb1:send("w",SCR.W) + SHADER.rgb1:send("h",h*SCR.dpi) +end +function back.update(dt) + t=t+dt +end +function back.draw() + SHADER.rgb1:send("t",t) + gc.setShader(SHADER.rgb1) + gc.rectangle("fill",0,0,SCR.w,SCR.h) + gc.setShader() +end +return back \ No newline at end of file diff --git a/parts/backgrounds/rainbow2.lua b/parts/backgrounds/rainbow2.lua new file mode 100644 index 00000000..a75457ea --- /dev/null +++ b/parts/backgrounds/rainbow2.lua @@ -0,0 +1,24 @@ +--Blue RGB +local gc=love.graphics +local rnd=math.random +local back={} + +local t +function back.init() + t=rnd()*2600 + BG.resize(SCR.w,SCR.h) +end +function back.resize(_,h) + SHADER.rgb2:send("w",SCR.W) + SHADER.rgb2:send("h",h*SCR.dpi) +end +function back.update(dt) + t=t+dt +end +function back.draw() + SHADER.rgb2:send("t",t) + gc.setShader(SHADER.rgb2) + gc.rectangle("fill",0,0,SCR.w,SCR.h) + gc.setShader() +end +return back \ No newline at end of file diff --git a/parts/backgrounds/rgb.lua b/parts/backgrounds/rgb.lua new file mode 100644 index 00000000..5c75e59d --- /dev/null +++ b/parts/backgrounds/rgb.lua @@ -0,0 +1,20 @@ +--Changing pure color +local gc=love.graphics +local rnd,sin=math.random,math.sin +local back={} + +local t +function back.init() + t=rnd()*2600 +end +function back.update(dt) + t=t+dt +end +function back.draw() + gc.clear( + sin(t*1.2)*.15+.2, + sin(t*1.5)*.15+.2, + sin(t*1.9)*.15+.2 + ) +end +return back \ No newline at end of file diff --git a/parts/backgrounds/space.lua b/parts/backgrounds/space.lua new file mode 100644 index 00000000..ff65c65f --- /dev/null +++ b/parts/backgrounds/space.lua @@ -0,0 +1,48 @@ +--Space with stars +local gc=love.graphics +local rnd=math.random +local back={} + +local stars +local W,H +function back.init() + stars={} + W,H=SCR.w+20,SCR.h+20 + BG.resize(SCR.w,SCR.h) +end +function back.resize() + local S=stars + for i=1,1260,5 do + local s=rnd(26,40)*.1 + S[i]=s*SCR.k --Size + S[i+1]=rnd(W)-10 --X + S[i+2]=rnd(H)-10 --Y + S[i+3]=(rnd()-.5)*.01*s --Vx + S[i+4]=(rnd()-.5)*.01*s --Vy + end +end +function back.update() + local S=stars + --Star moving + for i=1,1260,5 do + S[i+1]=(S[i+1]+S[i+3])%W + S[i+2]=(S[i+2]+S[i+4])%H + end +end +function back.draw() + gc.clear(.2,.2,.2) + if not stars[1]then return end + gc.translate(-10,-10) + gc.setColor(.8,.8,.8) + for i=1,1260,5 do + local s=stars + local x,y=s[i+1],s[i+2] + s=s[i] + gc.rectangle("fill",x,y,s,s) + end + gc.translate(10,10) +end +function back.discard() + stars=nil +end +return back \ No newline at end of file diff --git a/parts/backgrounds/welcome.lua b/parts/backgrounds/welcome.lua new file mode 100644 index 00000000..4546743b --- /dev/null +++ b/parts/backgrounds/welcome.lua @@ -0,0 +1,39 @@ +--Welcome to Techmino +local gc=love.graphics +local rnd,sin=math.random,math.sin +local back={} + +local t +local txt +function back.init() + t=rnd()*2600 + txt=gc.newText(getFont(80),"Welcome To Techmino") +end +function back.update(dt) + t=t+dt +end +function back.draw() + if -t%13.55<.1283 then + gc.clear(.2+.1*sin(t),.2+.1*sin(1.26*t),.2+.1*sin(1.626*t)) + else + gc.clear(.1,.1,.1) + end + gc.push("transform") + gc.replaceTransform(xOy) + gc.translate(640,360) + gc.scale(1.1626,1.26) + if -t%6.26<.1355 then + gc.translate(60*sin(t*.26),100*sin(t*.626)) + end + if -t%12.6<.1626 then + gc.rotate(t+5*sin(.26*t)+5*sin(.626*t)) + end + gc.setColor(.2,.3,.5) + gc.draw(txt,-883*.5+4*sin(t*.7942),-110*.5+4*sin(t*.7355)) + gc.setColor(.4,.6,.8) + gc.draw(txt,-883*.5+2*sin(t*.77023),-110*.5+2*sin(t*.7026)) + gc.setColor(.9,.9,.9) + gc.draw(txt,-883*.5+3*sin(t*.7283),-110*.5+3*sin(t*.7626)) + gc.pop() +end +return back \ No newline at end of file diff --git a/parts/backgrounds/wing.lua b/parts/backgrounds/wing.lua new file mode 100644 index 00000000..28be42fe --- /dev/null +++ b/parts/backgrounds/wing.lua @@ -0,0 +1,73 @@ +--Flandre's wing +local gc=love.graphics +local rnd=math.random +local back={} +local wingColor={ + {0., .9, .9,.626}, + {.3, 1., .3,.626}, + {.9, .9, 0.,.626}, + {1., .5, 0.,.626}, + {1., .3, .3,.626}, + {.5, 0., 1.,.626}, + {.3, .3, 1.,.626}, + {0., .9, .9,.626}, +} +local bar,crystal +local W,H +function back.init() + bar=gc.newCanvas(41,1) + gc.setCanvas(bar) + gc.push("transform") + gc.origin() + for x=0,20 do + gc.setColor(1,1,1,x/11) + gc.rectangle("fill",x,0,1,1) + gc.rectangle("fill",41-x,0,1,1) + end + gc.pop() + gc.setCanvas() + BG.resize() +end +function back.resize() + crystal={} + W,H=SCR.w,SCR.h + for i=1,16 do + crystal[i]={ + x=i<9 and W*.05*i or W*.05*(28-i), + y=H*.1, + a=0, + va=0, + f=i<9 and .012-i*.0005 or .012-(17-i)*.0005 + } + end +end +function back.update() + for i=1,16 do + local B=crystal[i] + B.a=B.a+B.va + B.va=B.va*.986-B.a*B.f + end +end +function back.draw() + gc.clear(.06,.06,.06) + local sy=H*.8 + for i=1,8 do + gc.setColor(wingColor[i]) + local B=crystal[i] + gc.draw(bar,B.x,B.y,B.a,1,sy,20,0) + B=crystal[17-i] + gc.draw(bar,B.x,B.y,B.a,1,sy,20,0) + end +end +function back.event(level) + for i=1,8 do + local B=crystal[i] + B.va=B.va+.001*level*(1+rnd()) + B=crystal[17-i] + B.va=B.va-.001*level*(1+rnd()) + end +end +function back.discard() + bar,crystal=nil +end +return back \ No newline at end of file diff --git a/parts/freeRow.lua b/parts/freeRow.lua index 343aac80..7a8abba0 100644 --- a/parts/freeRow.lua +++ b/parts/freeRow.lua @@ -1,7 +1,7 @@ -local freeRow={} +local FREEROW={} local L={}--Storage local _=0--Length -function freeRow.reset(num) +function FREEROW.reset(num) if num<_ then for i=_,num+1,-1 do L[i]=nil @@ -13,7 +13,7 @@ function freeRow.reset(num) end _=num end -function freeRow.get(val,type)--type: nil=norm, true=garbage +function FREEROW.get(val,type)--type: nil=norm, true=garbage if _==0 then for i=1,10 do L[i]={0,0,0,0,0,0,0,0,0,0} @@ -27,11 +27,11 @@ function freeRow.get(val,type)--type: nil=norm, true=garbage _=_-1 return t end -function freeRow.discard(t) +function FREEROW.discard(t) _=_+1 L[_]=t end -function freeRow.getCount() +function FREEROW.getCount() return _ end -return freeRow \ No newline at end of file +return FREEROW \ No newline at end of file diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index e2091a25..ad7b7d6c 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -29,8 +29,8 @@ function destroyPlayers() local P=PLAYERS[i] if P.canvas then P.canvas:release()end while P.field[1]do - freeRow.discard(rem(P.field)) - freeRow.discard(rem(P.visTime)) + FREEROW.discard(rem(P.field)) + FREEROW.discard(rem(P.visTime)) end if P.AI_mode=="CC"then CC.free(P.bot_opt) @@ -63,11 +63,11 @@ end function copyQuestArgs() local ENV=customEnv - local str="" - str=str..(ENV.hold and"H"or"Z") - str=str..(ENV.ospin and"O"or"Z") - str=str..(ENV.missionKill and"M"or"Z") - str=str..ENV.sequence + local str="".. + (ENV.hold and"H"or"Z").. + (ENV.ospin and"O"or"Z").. + (ENV.missionKill and"M"or"Z").. + ENV.sequence return str end function pasteQuestArgs(str) @@ -84,7 +84,7 @@ end --[[ Count: 34~96 Block: 97~125 - Encode: [A] or [AB] sequence, A = block ID, B = repeat times, no B means do not repeat. + Encode: A[B] sequence, A = block ID, B = repeat times, no B means do not repeat. Example: "abcdefg" is [SZJLTOI], "a^aDb)" is [Z*63,Z*37,S*10] ]] function copySequence() @@ -424,7 +424,7 @@ function resumeGame() end function loadGame(M,ifQuickPlay) STAT.lastPlay=M - CURMODE=Modes[M] + CURMODE=MODES[M] drawableText.modeName:set(text.modes[M][1]) drawableText.levelName:set(text.modes[M][2]) needResetGameData=true @@ -477,7 +477,7 @@ function resetGameData() GAME.garbageSpeed=.3 end STAT.game=STAT.game+1 - freeRow.reset(30*#PLAYERS) + FREEROW.reset(30*#PLAYERS) SFX.play("ready") collectgarbage() end diff --git a/parts/kickList.lua b/parts/kickList.lua index 5188cd34..f5eed250 100644 --- a/parts/kickList.lua +++ b/parts/kickList.lua @@ -130,7 +130,7 @@ do local L=OspinList[i] if D==L[1]then local id,dir=L[2],L[3] - local bk=blocks[id][dir] + local bk=BLOCKS[id][dir] x,y=P.curX+L[4],P.curY+L[5] if not P:ifoverlap(bk,x,y)and(L[6]>0 or P:ifoverlap(bk,x-1,y)and P:ifoverlap(bk,x+1,y))and(L[6]==2 or P:ifoverlap(bk,x,y-1))and P:ifoverlap(bk,x,y+1)then local C=P.cur diff --git a/parts/list.lua b/parts/list.lua index 2b04f3f5..48f81255 100644 --- a/parts/list.lua +++ b/parts/list.lua @@ -179,12 +179,12 @@ for k,v in next,missionEnum do _[v]=k end for k,v in next,_ do missionEnum[k]=v end rankColor={ - color.dRed, --D - color.dOrange, --C - color.lYellow, --B - color.lBlue, --A - color.lCyan, --S - color.lGreen, --Special + COLOR.dRed, --D + COLOR.dOrange, --C + COLOR.lYellow, --B + COLOR.lBlue, --A + COLOR.lCyan, --S + COLOR.lGreen, --Special } local function T(s,t)return love.graphics.newText(getFont(s),t)end diff --git a/parts/player.lua b/parts/player.lua index 6575a3c9..07f8327f 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -190,7 +190,7 @@ local function Pupdate_alive(P,dt) local C=P.AI_keys P.AI_delay=P.AI_delay-1 if not C[1]then - P.AI_stage=AIfunc[P.AI_mode][P.AI_stage](P,C) + P.AI_stage=AIFUNC[P.AI_mode][P.AI_stage](P,C) elseif P.AI_delay<=0 then P:pressKey(C[1])P:releaseKey(C[1]) if P.AI_mode~="CC"or C[1]>3 then @@ -403,13 +403,13 @@ end ---------------------------------------------------- local frameColor={ - [0]=color.white, - color.lGreen, - color.lBlue, - color.lPurple, - color.lOrange, + [0]=COLOR.white, + COLOR.lGreen, + COLOR.lBlue, + COLOR.lPurple, + COLOR.lOrange, } ---local function drawCell(y,x,id)gc.draw(blockSkin[id],30*x-30,-30*y)end +--local function drawCell(y,x,id)gc.draw(SKIN.curText[id],30*x-30,-30*y)end local function drawGrid(P) local FBN,FUP=P.fieldBeneath,P.fieldUp gc.setLineWidth(1) @@ -426,13 +426,14 @@ local function drawField(P) local V,F=P.visTime,P.field local start=int((P.fieldBeneath+P.fieldUp)/30+1) local rep=GAME.replaying + local texture=SKIN.curText if P.falling==-1 then--Blocks only for j=start,min(start+21,#F)do for i=1,10 do if F[j][i]>0 then if V[j][i]>0 then gc.setColor(1,1,1,min(V[j][i]*.05,1)) - gc.draw(blockSkin[F[j][i]],30*i-30,-30*j)-- drawCell(j,i,F[j][i]) + gc.draw(texture[F[j][i]],30*i-30,-30*j)-- drawCell(j,i,F[j][i]) elseif rep then gc.setColor(1,1,1,.3+.08*sin(.5*(j-i)+Timer()*4)) gc.rectangle("fill",30*i-30,-30*j,30,30) @@ -457,7 +458,7 @@ local function drawField(P) if F[j][i]>0 then if V[j][i]>0 then gc.setColor(1,1,1,min(V[j][i]*.05,1)) - gc.draw(blockSkin[F[j][i]],30*i-30,-30*j)-- drawCell(j,i,F[j][i]) + gc.draw(texture[F[j][i]],30*i-30,-30*j)-- drawCell(j,i,F[j][i]) elseif rep then gc.setColor(1,1,1,.2) gc.rectangle("fill",30*i-30,-30*j,30,30) @@ -490,10 +491,11 @@ local function drawFXs(P) end --MoveFX + local texture=SKIN.curText for i=1,#P.moveFX do local S=P.moveFX[i] gc.setColor(1,1,1,.6-S[4]*.6) - gc.draw(blockSkin[S[1]],30*S[2]-30,-30*S[3])-- drawCell(S[3],S[2],S[1]) + gc.draw(texture[S[1]],30*S[2]-30,-30*S[3])-- drawCell(S[3],S[2],S[1]) end --ClearFX @@ -508,31 +510,34 @@ local function drawFXs(P) end local function drawGhost(P,clr) gc.setColor(1,1,1,P.gameEnv.ghost) + local texture=SKIN.curText for i=1,P.r do for j=1,P.c do if P.cur.bk[i][j]then - gc.draw(blockSkin[clr],30*(j+P.curX-1)-30,-30*(i+P.imgY-1))-- drawCell(i+P.imgY-1,j+P.curX-1,clr) + gc.draw(texture[clr],30*(j+P.curX-1)-30,-30*(i+P.imgY-1))-- drawCell(i+P.imgY-1,j+P.curX-1,clr) end end end end -local function drawBlockOutline(P,clr,trans) +local function drawBlockOutline(P,texture,trans) SHADER.alpha:send("a",trans) gc.setShader(SHADER.alpha) - local _=blockSkin[clr] for i=1,P.r do for j=1,P.c do if P.cur.bk[i][j]then local x=30*(j+P.curX)-60-3 local y=30-30*(i+P.curY)-3 - gc.draw(_,x,y)gc.draw(_,x+6,y+6) - gc.draw(_,x+6,y)gc.draw(_,x,y+6) + 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 drawBlock(P,clr) gc.setColor(1,1,1) + local texture=SKIN.curText for i=1,P.r do for j=1,P.c do if P.cur.bk[i][j]then - gc.draw(blockSkin[clr],30*(j+P.curX-1)-30,-30*(i+P.curY-1))-- drawCell(i+P.curY-1,j+P.curX-1,clr) + gc.draw(texture[clr],30*(j+P.curX-1)-30,-30*(i+P.curY-1))-- drawCell(i+P.curY-1,j+P.curX-1,clr) end end end end @@ -548,20 +553,21 @@ local function drawNextPreview(P,B) end local function drawHold(P,clr) local B=P.hd.bk + local texture=SKIN.curText for i=1,#B do for j=1,#B[1]do if B[i][j]then - gc.draw(blockSkin[clr],30*(j+2.06-#B[1]*.5)-30,-30*(i+1.36-#B*.5))-- drawCell(i+1.36-#B*.5,j+2.06-#B[1]*.5,clr) + gc.draw(texture[clr],30*(j+2.06-#B[1]*.5)-30,-30*(i+1.36-#B*.5))-- drawCell(i+1.36-#B*.5,j+2.06-#B[1]*.5,clr) end end end end local Pdraw_norm do local attackColor={ - {color.dGrey,color.white}, - {color.grey,color.white}, - {color.lPurple,color.white}, - {color.lRed,color.white}, - {color.dGreen,color.cyan}, + {COLOR.dGrey,COLOR.white}, + {COLOR.grey,COLOR.white}, + {COLOR.lPurple,COLOR.white}, + {COLOR.lRed,COLOR.white}, + {COLOR.dGreen,COLOR.cyan}, } local RCPB={10,33,200,33,105,5,105,60} local function drawDial(x,y,speed) @@ -634,7 +640,7 @@ local Pdraw_norm do --Draw block if ENV.block then - drawBlockOutline(P,curColor,trans) + drawBlockOutline(P,SKIN.curText[curColor],trans) drawBlock(P,curColor) end @@ -702,7 +708,7 @@ local Pdraw_norm do 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*.5) - gc.setColor(P.b2b<40 and color.white or P.b2b<=1e3 and color.lRed or color.lBlue) + gc.setColor(P.b2b<40 and COLOR.white or P.b2b<=1e3 and COLOR.lRed or COLOR.lBlue) gc.rectangle("fill",-14,599,11,-a*.5) gc.setColor(1,1,1) if Timer()%.5<.3 then @@ -743,11 +749,12 @@ local Pdraw_norm do gc.setColor(1,1,1)gc.rectangle("line",316,36,124,N) mText(drawableText.next,378,-15) N=1 + local texture=SKIN.curText while N<=ENV.next and P.next[N]do local bk,clr=P.next[N].bk,P.next[N].color for i=1,#bk do for j=1,#bk[1] do if bk[i][j]then - gc.draw(blockSkin[clr],30*(j+12.6-#bk[1]*.5)-30,-30*(i-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr) + gc.draw(texture[clr],30*(j+12.6-#bk[1]*.5)-30,-30*(i-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr) end end end N=N+1 @@ -798,8 +805,8 @@ local Pdraw_norm do gc.print(P.score1,18,579) gc.print(format("%.2f",P.stat.time),18,609) - gc.setColor(color.lYellow)gc.print(P.score1,20,580) - gc.setColor(color.sky)gc.print(format("%.2f",P.stat.time),20,610) + gc.setColor(COLOR.lYellow)gc.print(P.score1,20,580) + gc.setColor(COLOR.sky)gc.print(format("%.2f",P.stat.time),20,610) --FinesseCombo if P.finesseCombo>2 then @@ -902,9 +909,10 @@ local function Pdraw_small(P) --Field local F=P.field + local texture=SKIN.curTextMini for j=1,#F do for i=1,10 do if F[j][i]>0 then - gc.draw(blockSkinMini[F[j][i]],6*i-6,120-6*j) + gc.draw(texture[F[j][i]],6*i-6,120-6*j) end end end @@ -968,7 +976,7 @@ local function Pdraw_demo(P) if P.cur and P.waiting==-1 then if ENV.ghost then drawGhost(P,curColor)end if ENV.block then - drawBlockOutline(P,curColor,P.lockDelay/ENV.lock) + drawBlockOutline(P,SKIN.curText[curColor],P.lockDelay/ENV.lock) drawBlock(P,curColor) end end @@ -1264,8 +1272,6 @@ local prepareSequence do if P.seqData[1]then P:getNext(rem(P.seqData)) else - print(P.cur) - print(P.hd) if not(P.cur or P.hd)then P:lose(true)end return end @@ -1624,8 +1630,8 @@ function player.garbageRise(P,color,amount,pos) local _ local t=P.showTime*2 for _=1,amount do - ins(P.field,1,freeRow.get(color,true)) - ins(P.visTime,1,freeRow.get(t)) + ins(P.field,1,FREEROW.get(color,true)) + ins(P.visTime,1,FREEROW.get(t)) P.field[1][pos]=0 end P.fieldBeneath=P.fieldBeneath+amount*30 @@ -1654,7 +1660,7 @@ function player.pushLine(P,L,mir) local l=#L local S=P.gameEnv.skin for i=1,l do - local r=freeRow.get(0) + local r=FREEROW.get(0) if not mir then for j=1,10 do r[j]=S[L[i][j]]or 0 @@ -1665,7 +1671,7 @@ function player.pushLine(P,L,mir) end end ins(P.field,1,r) - ins(P.visTime,1,freeRow.get(20)) + ins(P.visTime,1,FREEROW.get(20)) end P.fieldBeneath=P.fieldBeneath+30*l P.curY=P.curY+l @@ -1791,7 +1797,7 @@ function player.lock(P) local has_dest=dest~=nil for i=1,P.r do local y=P.curY+i-1 - if not P.field[y]then P.field[y],P.visTime[y]=freeRow.get(0),freeRow.get(0)end + if not P.field[y]then P.field[y],P.visTime[y]=FREEROW.get(0),FREEROW.get(0)end for j=1,P.c do if P.cur.bk[i][j]then P.field[y][P.curX+j-1]=P.cur.color @@ -1867,7 +1873,7 @@ function player.spin(P,d,ifpre) local iki=P.RS[P.cur.id] if type(iki)=="table"then local idir=(P.dir+d)%4 - local icb=blocks[P.cur.id][idir] + local icb=BLOCKS[P.cur.id][idir] local isc=scs[P.cur.id][idir] local ir,ic=#icb,#icb[1] local ix,iy=P.curX+P.sc[2]-isc[2],P.curY+P.sc[1]-isc[1] @@ -1932,7 +1938,7 @@ function player.hold(P,ifpre) if H then local hid=P.hd.id - P.hd.bk=blocks[hid][P.gameEnv.face[hid]] + P.hd.bk=BLOCKS[hid][P.gameEnv.face[hid]] end if not C then C=rem(P.next,1) @@ -1968,7 +1974,7 @@ end function player.getNext(P,n) local E=P.gameEnv - ins(P.next,{bk=blocks[n][E.face[n]],id=n,color=E.bone and 17 or E.skin[n],name=n}) + ins(P.next,{bk=BLOCKS[n][E.face[n]],id=n,color=E.bone and 17 or E.skin[n],name=n}) end function player.popNext(P)--Pop next queue to hand P.holded=false @@ -2232,8 +2238,8 @@ do--player.drop(P)--Place piece P.garbageBeneath=P.garbageBeneath-1 gbcc=gbcc+1 end - freeRow.discard(rem(P.field,_)) - freeRow.discard(rem(P.visTime,_)) + FREEROW.discard(rem(P.field,_)) + FREEROW.discard(rem(P.visTime,_)) end end @@ -2603,10 +2609,10 @@ local function gameOver()--Save record local P=PLAYERS[1] R=R(P)--New rank if R then - local r=modeRanks[M.name]--Old rank + local r=RANKS[M.name]--Old rank local needSave if R>r then - modeRanks[M.name]=R + RANKS[M.name]=R needSave=true end if R>0 then @@ -2614,9 +2620,9 @@ local function gameOver()--Save record if M.unlock then for i=1,#M.unlock do local m=M.unlock[i] - local n=Modes[m].name - if not modeRanks[n]then - modeRanks[n]=Modes[m].score and 0 or 6 + local n=MODES[m].name + if not RANKS[n]then + RANKS[n]=MODES[m].score and 0 or 6 needSave=true end end @@ -2698,8 +2704,8 @@ function player.lose(P,force) if P.life>0 and not force then P.waiting=62 for _=#P.field,1,-1 do - freeRow.discard(P.field[_]) - freeRow.discard(P.visTime[_]) + FREEROW.discard(P.field[_]) + FREEROW.discard(P.visTime[_]) P.field[_],P.visTime[_]=nil end @@ -2948,7 +2954,7 @@ function player.act.restart() if GAME.frame<240 or GAME.result then resetPartGameData() else - LOG.print(text.holdR,20,color.orange) + LOG.print(text.holdR,20,COLOR.orange) end end function player.act.insLeft(P,auto) diff --git a/parts/scenes/calculator.lua b/parts/scenes/calculator.lua index 21a4d0e8..d79dadd8 100644 --- a/parts/scenes/calculator.lua +++ b/parts/scenes/calculator.lua @@ -1,8 +1,6 @@ local gc=love.graphics local kb=love.keyboard -local setFont=setFont - local find,sub,byte=string.find,string.sub,string.byte function sceneInit.calculator() @@ -87,9 +85,9 @@ function keyDown.calculator(k) SFX.play("clear") elseif v==72943816 then S.pass=true - for name,M in next,Modes do - if not modeRanks[name]then - modeRanks[name]=M.score and 0 or 6 + for name,M in next,MODES do + if not RANKS[name]then + RANKS[name]=M.score and 0 or 6 end end FILE.saveUnlock() diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index a1bd516a..2f0c740e 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -2,7 +2,6 @@ local gc,sys=love.graphics,love.system local kb=love.keyboard local Timer=love.timer.getTime -local setFont=setFont local int=math.floor local find,sub=string.find,string.sub @@ -43,7 +42,7 @@ function keyDown.customGame(key) str=str.."!"..copyBoard().."!" if #MISSION>0 then str=str..copyMission()end sys.setClipboardText(str.."!") - LOG.print(text.copySuccess,color.green) + LOG.print(text.copySuccess,COLOR.green) elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p1,p2,p3,p4,p5--ptr* @@ -71,10 +70,10 @@ function keyDown.customGame(key) break end end - LOG.print(text.pasteSuccess,color.green) + LOG.print(text.pasteSuccess,COLOR.green) return end - LOG.print(text.dataCorrupted,color.red) + LOG.print(text.dataCorrupted,COLOR.red) elseif key=="escape"then SCN.back() else @@ -92,10 +91,11 @@ function Pnt.customGame() gc.rectangle("line",-2,-2,304,604) local F=FIELD[1] local cross=puzzleMark[-1] + local texture=SKIN.curText for y=1,20 do for x=1,10 do local B=F[y][x] if B>0 then - gc.draw(blockSkin[B],30*x-30,600-30*y) + gc.draw(texture[B],30*x-30,600-30*y) elseif B==-1 then gc.draw(cross,30*x-30,600-30*y) end diff --git a/parts/scenes/custom_field.lua b/parts/scenes/custom_field.lua index 8cec20c7..59aa9a16 100644 --- a/parts/scenes/custom_field.lua +++ b/parts/scenes/custom_field.lua @@ -1,9 +1,6 @@ local gc,sys=love.graphics,love.system local ms,kb=love.mouse,love.keyboard -local setFont=setFont -local mStr=mStr - local max,min,int=math.max,math.min,math.floor local ins,rem=table.insert,table.remove local sub=string.sub @@ -118,15 +115,15 @@ function keyDown.custom_field(key) end elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then sys.setClipboardText("Techmino Field:"..copyBoard(S.page)) - LOG.print(text.copySuccess,color.green) + LOG.print(text.copySuccess,COLOR.green) elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=string.find(str,":")--ptr* if p then str=sub(str,p+1)end if pasteBoard(str,S.page)then - LOG.print(text.pasteSuccess,color.green) + LOG.print(text.pasteSuccess,COLOR.green) else - LOG.print(text.dataCorrupted,color.red) + LOG.print(text.dataCorrupted,COLOR.red) end elseif key=="tab"or key=="sTab"then if key=="sTab"or kb.isDown("lshift","rshift")then @@ -177,10 +174,11 @@ function Pnt.custom_field() gc.setLineWidth(2) local cross=puzzleMark[-1] local F=FIELD[S.page] + local texture=SKIN.curText for y=1,20 do for x=1,10 do local B=F[y][x] if B>0 then - gc.draw(blockSkin[B],30*x-30,600-30*y) + gc.draw(texture[B],30*x-30,600-30*y) elseif B==-1 and not S.demo then gc.draw(cross,30*x-30,600-30*y) end @@ -237,23 +235,23 @@ WIDGET.init("custom_field",{ WIDGET.newText({name="title", x=1020,y=5,font=70,align="R"}), WIDGET.newText({name="subTitle", x=1030,y=50,font=35,align="L",color="grey"}), - WIDGET.newButton({name="b1", x=580, y=130,w=75,color={color.rainbow( 1.471)},code=setPen(1)}),--B1 - WIDGET.newButton({name="b2", x=660, y=130,w=75,color={color.rainbow( 1.078)},code=setPen(2)}),--B2 - WIDGET.newButton({name="b3", x=740, y=130,w=75,color={color.rainbow( 0.685)},code=setPen(3)}),--B3 - WIDGET.newButton({name="b4", x=820, y=130,w=75,color={color.rainbow( 0.293)},code=setPen(4)}),--B4 - WIDGET.newButton({name="b5", x=900, y=130,w=75,color={color.rainbow(-0.100)},code=setPen(5)}),--B5 - WIDGET.newButton({name="b6", x=980, y=130,w=75,color={color.rainbow(-0.493)},code=setPen(6)}),--B6 - WIDGET.newButton({name="b7", x=1060, y=130,w=75,color={color.rainbow(-0.885)},code=setPen(7)}),--B7 - WIDGET.newButton({name="b8", x=1140, y=130,w=75,color={color.rainbow(-1.278)},code=setPen(8)}),--B8 + WIDGET.newButton({name="b1", x=580, y=130,w=75,color={COLOR.rainbow( 1.471)},code=setPen(1)}),--B1 + WIDGET.newButton({name="b2", x=660, y=130,w=75,color={COLOR.rainbow( 1.078)},code=setPen(2)}),--B2 + WIDGET.newButton({name="b3", x=740, y=130,w=75,color={COLOR.rainbow( 0.685)},code=setPen(3)}),--B3 + WIDGET.newButton({name="b4", x=820, y=130,w=75,color={COLOR.rainbow( 0.293)},code=setPen(4)}),--B4 + WIDGET.newButton({name="b5", x=900, y=130,w=75,color={COLOR.rainbow(-0.100)},code=setPen(5)}),--B5 + WIDGET.newButton({name="b6", x=980, y=130,w=75,color={COLOR.rainbow(-0.493)},code=setPen(6)}),--B6 + WIDGET.newButton({name="b7", x=1060, y=130,w=75,color={COLOR.rainbow(-0.885)},code=setPen(7)}),--B7 + WIDGET.newButton({name="b8", x=1140, y=130,w=75,color={COLOR.rainbow(-1.278)},code=setPen(8)}),--B8 - WIDGET.newButton({name="b9", x=580, y=210,w=75,color={color.rainbow(-1.671)},code=setPen(9)}),--B9 - WIDGET.newButton({name="b10", x=660, y=210,w=75,color={color.rainbow(-2.063)},code=setPen(10)}),--B10 - WIDGET.newButton({name="b11", x=740, y=210,w=75,color={color.rainbow(-2.456)},code=setPen(11)}),--B11 - WIDGET.newButton({name="b12", x=820, y=210,w=75,color={color.rainbow(-2.849)},code=setPen(12)}),--B12 - WIDGET.newButton({name="b13", x=900, y=210,w=75,color={color.rainbow(-3.242)},code=setPen(13)}),--B13 - WIDGET.newButton({name="b14", x=980, y=210,w=75,color={color.rainbow(-3.634)},code=setPen(14)}),--B14 - WIDGET.newButton({name="b15", x=1060, y=210,w=75,color={color.rainbow(-4.027)},code=setPen(15)}),--B15 - WIDGET.newButton({name="b16", x=1140, y=210,w=75,color={color.rainbow(-4.412)},code=setPen(16)}),--B16 + WIDGET.newButton({name="b9", x=580, y=210,w=75,color={COLOR.rainbow(-1.671)},code=setPen(9)}),--B9 + WIDGET.newButton({name="b10", x=660, y=210,w=75,color={COLOR.rainbow(-2.063)},code=setPen(10)}),--B10 + WIDGET.newButton({name="b11", x=740, y=210,w=75,color={COLOR.rainbow(-2.456)},code=setPen(11)}),--B11 + WIDGET.newButton({name="b12", x=820, y=210,w=75,color={COLOR.rainbow(-2.849)},code=setPen(12)}),--B12 + WIDGET.newButton({name="b13", x=900, y=210,w=75,color={COLOR.rainbow(-3.242)},code=setPen(13)}),--B13 + WIDGET.newButton({name="b14", x=980, y=210,w=75,color={COLOR.rainbow(-3.634)},code=setPen(14)}),--B14 + WIDGET.newButton({name="b15", x=1060, y=210,w=75,color={COLOR.rainbow(-4.027)},code=setPen(15)}),--B15 + WIDGET.newButton({name="b16", x=1140, y=210,w=75,color={COLOR.rainbow(-4.412)},code=setPen(16)}),--B16 WIDGET.newButton({name="b17", x=580, y=290,w=75,color="dGrey", code=setPen(17)}),--BONE WIDGET.newButton({name="b18", x=660, y=290,w=75,color="black", code=setPen(18)}),--HIDE diff --git a/parts/scenes/custom_mission.lua b/parts/scenes/custom_mission.lua index 08fb5b95..d7281e99 100644 --- a/parts/scenes/custom_mission.lua +++ b/parts/scenes/custom_mission.lua @@ -2,7 +2,6 @@ local gc,sys=love.graphics,love.system local kb=love.keyboard local Timer=love.timer.getTime -local setFont=setFont local int,sin=math.floor,math.sin local ins,rem=table.insert,table.remove local sub=string.sub @@ -73,16 +72,16 @@ function keyDown.custom_mission(key) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then if #MISSION>0 then sys.setClipboardText("Techmino Target:"..copyMission()) - LOG.print(text.copySuccess,color.green) + LOG.print(text.copySuccess,COLOR.green) end elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=string.find(str,":")--ptr* if p then str=sub(str,p+1)end if pasteMission(str)then - LOG.print(text.pasteSuccess,color.green) + LOG.print(text.pasteSuccess,COLOR.green) else - LOG.print(text.dataCorrupted,color.red) + LOG.print(text.dataCorrupted,COLOR.red) end elseif key=="escape"then SCN.back() @@ -161,9 +160,9 @@ function Pnt.custom_mission() if N>0 then gc.setColor(libColor[set[N]]) elseif L[i]>4 then - gc.setColor(color.rainbow(i+Timer()*6.26)) + gc.setColor(COLOR.rainbow(i+Timer()*6.26)) else - gc.setColor(color.grey) + gc.setColor(COLOR.grey) end gc.print(missionEnum[L[i]],x,y-25) x=x+56 diff --git a/parts/scenes/custom_sequence.lua b/parts/scenes/custom_sequence.lua index e8db1e14..f0b3b52c 100644 --- a/parts/scenes/custom_sequence.lua +++ b/parts/scenes/custom_sequence.lua @@ -2,8 +2,6 @@ local gc,sys=love.graphics,love.system local kb=love.keyboard local Timer=love.timer.getTime -local setFont=setFont - local sin=math.sin local ins,rem=table.insert,table.remove local sub=string.sub @@ -76,16 +74,16 @@ function keyDown.custom_sequence(key) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then if #BAG>0 then sys.setClipboardText("Techmino SEQ:"..copySequence()) - LOG.print(text.copySuccess,color.green) + LOG.print(text.copySuccess,COLOR.green) end elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then local str=sys.getClipboardText() local p=string.find(str,":")--ptr* if p then str=sub(str,p+1)end if pasteSequence(str)then - LOG.print(text.pasteSuccess,color.green) + LOG.print(text.pasteSuccess,COLOR.green) else - LOG.print(text.dataCorrupted,color.red) + LOG.print(text.dataCorrupted,COLOR.red) end elseif key=="escape"then SCN.back() diff --git a/parts/scenes/dict.lua b/parts/scenes/dict.lua index b0183f15..29a292c8 100644 --- a/parts/scenes/dict.lua +++ b/parts/scenes/dict.lua @@ -1,7 +1,6 @@ local gc=love.graphics local Timer=love.timer.getTime -local setFont=setFont local int,abs=math.floor,math.abs local min,sin=math.min,math.sin local ins,rem=table.insert,table.remove @@ -115,12 +114,12 @@ function Tmr.dict(dt) end local typeColor={ - help=color.lGrey, - other=color.lOrange, - game=color.lCyan, - term=color.lRed, - english=color.green, - name=color.lPurple, + help=COLOR.lGrey, + other=COLOR.lOrange, + game=COLOR.lCyan, + term=COLOR.lRed, + english=COLOR.green, + name=COLOR.lPurple, } function Pnt.dict() local S=sceneTemp @@ -171,7 +170,7 @@ function Pnt.dict() local r=Timer()*2 local R=int(r)%7+1 gc.setColor(1,1,1,1-abs(r%1*2-1)) - gc.draw(TEXTURE.miniBlock[R],785,140,Timer()*10%6.2832,15,15,spinCenters[R][0][2]+.5,#blocks[R][0]-spinCenters[R][0][1]-.5) + gc.draw(TEXTURE.miniBlock[R],785,140,Timer()*10%6.2832,15,15,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5) end end diff --git a/parts/scenes/help.lua b/parts/scenes/help.lua index 8e5cc4a3..d3827a5e 100644 --- a/parts/scenes/help.lua +++ b/parts/scenes/help.lua @@ -1,8 +1,6 @@ local gc=love.graphics local Timer=love.timer.getTime -local setFont=setFont -local mStr=mStr local sin=math.sin function sceneInit.help() diff --git a/parts/scenes/history.lua b/parts/scenes/history.lua index 8413fbc8..3bd6ce4d 100644 --- a/parts/scenes/history.lua +++ b/parts/scenes/history.lua @@ -1,5 +1,4 @@ local gc=love.graphics -local setFont=setFont local max,min=math.max,math.min local floatWheel=0 diff --git a/parts/scenes/intro.lua b/parts/scenes/intro.lua index 319278dd..d6f81bb0 100644 --- a/parts/scenes/intro.lua +++ b/parts/scenes/intro.lua @@ -23,11 +23,11 @@ function mouseDown.intro(_,_,k) VOC.play("bye") SCN.back() elseif NOGAME=="delSetting"then - LOG.print("检测到过老版本非法设置数据,设置已经全部重置,请重启游戏完成",600,color.yellow) - LOG.print("Old version detected, setting file deleted, please restart the game",600,color.yellow) + LOG.print("检测到过老版本非法设置数据,设置已经全部重置,请重启游戏完成",600,COLOR.yellow) + LOG.print("Old version detected, setting file deleted, please restart the game",600,COLOR.yellow) elseif NOGAME=="delCC"then - LOG.print("请关闭游戏,然后删除存档文件夹内的 CCloader.dll(21KB) !",600,color.yellow) - LOG.print("Please quit the game, then delete CCloader.dll(21KB) in saving folder!",600,color.yellow) + LOG.print("请关闭游戏,然后删除存档文件夹内的 CCloader.dll(21KB) !",600,COLOR.yellow) + LOG.print("Please quit the game, then delete CCloader.dll(21KB) in saving folder!",600,COLOR.yellow) TASK.new(function(S) S[1]=S[1]-1 if S[1]==0 then @@ -39,7 +39,7 @@ function mouseDown.intro(_,_,k) if newVersionLaunch then SCN.push("main","fade") SCN.swapTo("history","fade") - LOG.print(text.newVersion,"warn",color.lBlue) + LOG.print(text.newVersion,"warn",COLOR.lBlue) else SCN.go("main") end diff --git a/parts/scenes/load.lua b/parts/scenes/load.lua index 3e9f3fdc..1c5bcfdb 100644 --- a/parts/scenes/load.lua +++ b/parts/scenes/load.lua @@ -2,7 +2,6 @@ local gc=love.graphics local tc=love.touch local Timer=love.timer.getTime -local setFont=setFont local max,min,sin=math.max,math.min,math.sin function sceneInit.load() @@ -18,7 +17,7 @@ function sceneInit.load() IMG.getCount(), 17,--Fontsize 20~100 SKIN.getCount(), - #Modes, + #MODES, 1, 1, }, @@ -65,19 +64,19 @@ function Tmr.load() elseif S.phase==6 then SKIN.loadOne(S.cur) elseif S.phase==7 then - local m=Modes[S.cur]--Mode template + local m=MODES[S.cur]--Mode template local M=require("modes/"..m.name)--Mode file - Modes[m.name],Modes[S.cur]=M + MODES[m.name],MODES[S.cur]=M for k,v in next,m do M[k]=v end M.records=FILE.loadRecord(m.name)or M.score and{} if M.score then - if modeRanks[M.name]==6 then - modeRanks[M.name]=0 + if RANKS[M.name]==6 then + RANKS[M.name]=0 end else - modeRanks[M.name]=6 + RANKS[M.name]=6 end -- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png") -- M.icon=gc.newImage("image/modeIcon/custom.png") @@ -153,15 +152,15 @@ function Pnt.load() gc.rectangle("fill",0,0,440,260) local T=Timer() - gc.setColor(color.dCyan) + gc.setColor(COLOR.dCyan) mDraw(S.text,220,Y*.2-1204) mDraw(S.text,220,-Y*.2+1476) - gc.setColor(color.cyan) + gc.setColor(COLOR.cyan) mDraw(S.text,220+4*sin(T*10),136+4*sin(T*6)) mDraw(S.text,220+4*sin(T*12),136+4*sin(T*8)) - gc.setColor(color.dCyan) + gc.setColor(COLOR.dCyan) mDraw(S.text,219,137) mDraw(S.text,219,135) mDraw(S.text,221,137) @@ -177,7 +176,7 @@ function Pnt.load() setFont(50) for i=1,27 do if i<26 then - local r,g,b=color.rainbow(i+3.5) + local r,g,b=COLOR.rainbow(i+3.5) gc.setColor(r*.26,g*.26,b*.26) gc.rectangle("fill",-220,Y-260*i-80,440,260) gc.setColor(r*1.6,g*1.6,b*1.6) diff --git a/parts/scenes/main.lua b/parts/scenes/main.lua index 171d82fd..9410d71e 100644 --- a/parts/scenes/main.lua +++ b/parts/scenes/main.lua @@ -1,5 +1,4 @@ local gc=love.graphics -local setFont=setFont function sceneInit.main() sceneTemp={ @@ -37,7 +36,7 @@ end WIDGET.init("main",{ WIDGET.newButton({name="play", x=150,y=220,w=200,h=140,color="lRed", font=55,code=WIDGET.lnk.goScene("mode")}), WIDGET.newButton({name="setting", x=370,y=220,w=200,h=140,color="sky", font=45,code=WIDGET.lnk.goScene("setting_game")}), - WIDGET.newButton({name="custom", x=590,y=220,w=200,h=140,color="lPurple",font=45,code=WIDGET.lnk.goScene("customGame"),hide=function()return not modeRanks.marathon_normal end}), + WIDGET.newButton({name="custom", x=590,y=220,w=200,h=140,color="lPurple",font=45,code=WIDGET.lnk.goScene("customGame"),hide=function()return not RANKS.marathon_normal end}), WIDGET.newButton({name="help", x=150,y=380,w=200,h=140,color="lYellow",font=50,code=WIDGET.lnk.goScene("help")}), WIDGET.newButton({name="stat", x=370,y=380,w=200,h=140,color="lGreen", font=40,code=WIDGET.lnk.goScene("stat")}), WIDGET.newButton({name="qplay", x=590,y=380,w=200,h=140,color="white", font=45,code=function()SCN.push()loadGame(STAT.lastPlay,true)end}), diff --git a/parts/scenes/mode.lua b/parts/scenes/mode.lua index 10b4c480..5c3d647b 100644 --- a/parts/scenes/mode.lua +++ b/parts/scenes/mode.lua @@ -2,9 +2,6 @@ local gc=love.graphics local ms,kb,tc=love.mouse,love.keyboard,love.touch local Timer=love.timer.getTime -local setFont=setFont -local mStr=mStr - local int,abs=math.floor,math.abs local sin=math.sin @@ -30,7 +27,7 @@ function sceneInit.mode(org) local cam=mapCam cam.zoomK=org=="main"and 5 or 1 if cam.sel then - local M=Modes[cam.sel] + local M=MODES[cam.sel] cam.x,cam.y=M.x*cam.k+180,M.y*cam.k cam.x1,cam.y1=cam.x,cam.y end @@ -40,8 +37,8 @@ local function onMode(x,y) local cam=mapCam x=(cam.x1-640+x)/cam.k1 y=(cam.y1-360+y)/cam.k1 - for name,M in next,Modes do - if modeRanks[name]then + for name,M in next,MODES do + if RANKS[name]then local s=M.size if M.shape==1 then if x>M.x-s and xM.y-s and y