重构背景系统(每个背景使用独立文件),全局变量名整理

This commit is contained in:
MrZ626
2020-11-04 00:08:50 +08:00
parent c688fef3f6
commit a485a71dfc
149 changed files with 1087 additions and 1046 deletions

View File

@@ -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 function NULL(...)end
local SCR=SCR local BG={
local BGvars={_G=_G,SHADER=SHADER} list={},
local BG cur="",
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",
init=NULL, init=NULL,
resize=NULL, resize=NULL,
update=NULL, update=NULL,
draw=back.none.draw, draw=NULL,
event=NULL, event=NULL,
discard=NULL, discard=NULL,
} }
@@ -515,22 +14,22 @@ function BG.send(data)
BG.event(data) BG.event(data)
end end
end end
function BG.set(bg) function BG.set(background)
if bg==BG.cur or not SETTING.bg then return end if background==BG.cur or not SETTING.bg then return end
BG.discard() BG.discard()
if not back[bg]then background=BG.list[background]
LOG.print("No BG called"..bg,"warn") if not background then
LOG.print("No BG called"..background,"warn")
return return
end end
BG.cur=bg BG.cur=background
bg=back[bg]
BG.init= bg.init BG.init= background.init or NULL
BG.resize= bg.resize BG.resize= background.resize or NULL
BG.update= bg.update BG.update= background.update or NULL
BG.draw= bg.draw BG.draw= background.draw or NULL
BG.event= bg.event BG.event= background.event or NULL
BG.discard= bg.discard BG.discard= background.discard or NULL
BG.init() BG.init()
end end
return BG return BG

View File

@@ -55,7 +55,7 @@ function BGM.loadOne(N)
BGM.list[N]:setLooping(true) BGM.list[N]:setLooping(true)
BGM.list[N]:setVolume(0) BGM.list[N]:setVolume(0)
else else
LOG.print("No BGM file: "..N,5,color.orange) LOG.print("No BGM file: "..N,5,COLOR.orange)
end end
end end
function BGM.loadAll() function BGM.loadAll()

View File

@@ -1,6 +1,6 @@
local rnd=math.random local rnd=math.random
local sin=math.sin local sin=math.sin
local color={ local COLOR={
red={1,0,0}, red={1,0,0},
green={0,1,0}, green={0,1,0},
blue={.2,.2,1}, blue={.2,.2,1},
@@ -41,27 +41,27 @@ local color={
} }
local list_norm={"red","green","blue","yellow","magenta","cyan","purple","orange","pink","grass"} local list_norm={"red","green","blue","yellow","magenta","cyan","purple","orange","pink","grass"}
local len_list_norm=#list_norm local len_list_norm=#list_norm
function color.random_norm() function COLOR.random_norm()
return color[list_norm[rnd(len_list_norm)]] return COLOR[list_norm[rnd(len_list_norm)]]
end end
local list_bright={"lRed","lGreen","lBlue","lYellow","lMagenta","lCyan","lPurple","lOrange"} local list_bright={"lRed","lGreen","lBlue","lYellow","lMagenta","lCyan","lPurple","lOrange"}
local len_list_bright=#list_bright local len_list_bright=#list_bright
function color.random_bright() function COLOR.random_bright()
return color[list_bright[rnd(len_list_bright)]] return COLOR[list_bright[rnd(len_list_bright)]]
end end
local list_dark={"dRed","dGreen","dBlue","dYellow","dMagenta","dCyan","dPurple","dOrange"} local list_dark={"dRed","dGreen","dBlue","dYellow","dMagenta","dCyan","dPurple","dOrange"}
local len_list_dark=#list_dark local len_list_dark=#list_dark
function color.random_bright() function COLOR.random_bright()
return color[list_dark[rnd(len_list_dark)]] return COLOR[list_dark[rnd(len_list_dark)]]
end end
function color.rainbow(phase) function COLOR.rainbow(phase)
return return
sin(phase)*.4+.6, sin(phase)*.4+.6,
sin(phase+2.0944)*.4+.6, sin(phase+2.0944)*.4+.6,
sin(phase-2.0944)*.4+.6 sin(phase-2.0944)*.4+.6
end end
return color return COLOR

View File

@@ -28,7 +28,7 @@ function FILE.saveRecord(N,L)
local _,mes=F:write(dumpTable(L)) local _,mes=F:write(dumpTable(L))
F:flush()F:close() F:flush()F:close()
if not _ then 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
end end
function FILE.delRecord(N) function FILE.delRecord(N)
@@ -36,7 +36,7 @@ function FILE.delRecord(N)
end end
function FILE.exportUnlock() function FILE.exportUnlock()
sys.setClipboardText(dumpTable(modeRanks)) sys.setClipboardText(dumpTable(RANKS))
end end
function FILE.loadUnlock() function FILE.loadUnlock()
local F=files.unlock local F=files.unlock
@@ -47,17 +47,17 @@ function FILE.loadUnlock()
F:close() F:close()
if s then if s then
setfenv(s,{}) setfenv(s,{})
modeRanks=s() RANKS=s()
end end
end end
end end
function FILE.saveUnlock() function FILE.saveUnlock()
local F=files.unlock local F=files.unlock
F:open("w") F:open("w")
local _,mes=F:write(dumpTable(modeRanks)) local _,mes=F:write(dumpTable(RANKS))
F:flush()F:close() F:flush()F:close()
if not _ then 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
end end
@@ -86,7 +86,7 @@ function FILE.saveData()
local _,mes=F:write(dumpTable(STAT)) local _,mes=F:write(dumpTable(STAT))
F:flush()F:close() F:flush()F:close()
if not _ then 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
end end
@@ -113,8 +113,8 @@ function FILE.saveSetting()
F:open("w") F:open("w")
local _,mes=F:write(dumpTable(SETTING)) local _,mes=F:write(dumpTable(SETTING))
F:flush()F:close() F:flush()F:close()
if _ then LOG.print(text.settingSaved,color.green) if _ then LOG.print(text.settingSaved,COLOR.green)
else LOG.print(text.settingSavingError..(mes or"unknown error"),color.red) else LOG.print(text.settingSavingError..(mes or"unknown error"),COLOR.red)
end end
end end
@@ -134,8 +134,8 @@ function FILE.saveKeyMap()
F:open("w") F:open("w")
local _,mes=F:write(dumpTable(keyMap)) local _,mes=F:write(dumpTable(keyMap))
F:flush()F:close() F:flush()F:close()
if _ then LOG.print(text.keyMapSaved,color.green) if _ then LOG.print(text.keyMapSaved,COLOR.green)
else LOG.print(text.keyMapSavingError..(mes or"unknown error"),color.red) else LOG.print(text.keyMapSavingError..(mes or"unknown error"),COLOR.red)
end end
end end
@@ -158,8 +158,8 @@ function FILE.saveVK()
F:open("w") F:open("w")
local _,mes=F:write(dumpTable(VK_org)) local _,mes=F:write(dumpTable(VK_org))
F:flush()F:close() F:flush()F:close()
if _ then LOG.print(text.VKSaved,color.green) if _ then LOG.print(text.VKSaved,COLOR.green)
else LOG.print(text.VKSavingError..(mes or"unknown error"),color.red) else LOG.print(text.VKSavingError..(mes or"unknown error"),COLOR.red)
end end
end end
return FILE return FILE

View File

@@ -1,21 +1,25 @@
color= require("Zframework/color") COLOR= require("Zframework/color")
SCN= require("Zframework/scene") SCN= require("Zframework/scene")
LOG= require("Zframework/log") LOG= require("Zframework/log")
require("Zframework/toolfunc") require("Zframework/toolfunc")
SHADER= require("Zframework/shader")
VIB= require("Zframework/vib") VIB= require("Zframework/vib")
SFX= require("Zframework/sfx") SFX= require("Zframework/sfx")
sysFX= require("Zframework/sysFX")
LIGHT= require("Zframework/light")
SHADER= require("Zframework/shader")
BG= require("Zframework/bg") BG= require("Zframework/bg")
WIDGET= require("Zframework/widget")
TEXT= require("Zframework/text")
sysFX= require("Zframework/sysFX")
IMG= require("Zframework/img")
BGM= require("Zframework/bgm") BGM= require("Zframework/bgm")
VOC= require("Zframework/voice") VOC= require("Zframework/voice")
LANG= require("Zframework/languages") LANG= require("Zframework/languages")
FILE= require("Zframework/file")
TEXT= require("Zframework/text")
TASK= require("Zframework/task") TASK= require("Zframework/task")
IMG= require("Zframework/img") FILE= require("Zframework/file")
WIDGET= require("Zframework/widget")
LIGHT= require("Zframework/light")
PROFILE=require("Zframework/profile") PROFILE=require("Zframework/profile")
local ms,kb=love.mouse,love.keyboard 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 min=math.min
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local SCR=SCR local SCR=SCR
local setFont=setFont
local mx,my,mouseShow=-20,-20,false local mx,my,mouseShow=-20,-20,false
local touching=nil--First touching ID(userdata) 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=="f5"then if love._openConsole then love._openConsole()end
elseif i=="f6"then if WIDGET.sel then DBP(WIDGET.sel)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=="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=="f8"then devMode=nil LOG.print("DEBUG OFF",COLOR.yellow)
elseif i=="f9"then devMode=1 LOG.print("DEBUG 1",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=="f10"then devMode=2 LOG.print("DEBUG 2",COLOR.yellow)
elseif i=="f11"then devMode=3 LOG.print("DEBUG 3",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=="f12"then devMode=4 LOG.print("DEBUG 4",COLOR.yellow)
elseif devMode==2 then elseif devMode==2 then
if WIDGET.sel then if WIDGET.sel then
local W=WIDGET.sel local W=WIDGET.sel
@@ -250,7 +255,7 @@ function love.keypressed(i)
end end
else else
devMode=1 devMode=1
LOG.print("DEBUG ON",color.yellow) LOG.print("DEBUG ON",COLOR.yellow)
end end
end end
function love.keyreleased(i) function love.keyreleased(i)
@@ -279,7 +284,7 @@ function love.joystickremoved(JS)
for i=1,#joysticks do for i=1,#joysticks do
if joysticks[i]==JS then if joysticks[i]==JS then
rem(joysticks,i) rem(joysticks,i)
LOG.print("Joystick removed",color.yellow) LOG.print("Joystick removed",COLOR.yellow)
return return
end end
end end
@@ -360,9 +365,9 @@ function love.focus(f)
end end
end end
function love.errorhandler(msg) function love.errorhandler(msg)
local PUMP,POLL=love.event.pump,love.event.poll ms.setVisible(true)
love.mouse.setVisible(true)
love.audio.stop() love.audio.stop()
local err={"Error:"..msg} local err={"Error:"..msg}
local trace=debug.traceback("",2) local trace=debug.traceback("",2)
local c=2 local c=2
@@ -379,9 +384,9 @@ function love.errorhandler(msg)
end end
DBP(table.concat(err,"\n"),1,c-2) DBP(table.concat(err,"\n"),1,c-2)
gc.reset() gc.reset()
local CAP
local function _(_)CAP=gc.newImage(_)end local errScrShot
gc.captureScreenshot(_) gc.captureScreenshot(function (_)errScrShot=gc.newImage(_)end)
gc.present() gc.present()
SFX.fplay("error",SETTING.voc*.8) SFX.fplay("error",SETTING.voc*.8)
@@ -390,8 +395,8 @@ function love.errorhandler(msg)
local needDraw=true local needDraw=true
local count=0 local count=0
return function() return function()
PUMP() love.event.pump()
for E,a,b in POLL()do for E,a,b in love.event.poll()do
if E=="quit"or a=="escape"then if E=="quit"or a=="escape"then
destroyPlayers() destroyPlayers()
return 1 return 1
@@ -422,7 +427,7 @@ function love.errorhandler(msg)
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.push("transform") gc.push("transform")
gc.replaceTransform(xOy) 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(120)gc.print(":(",100,40)
setFont(38)gc.printf(text.errorMsg,100,200,1280-100) setFont(38)gc.printf(text.errorMsg,100,200,1280-100)
setFont(20) setFont(20)
@@ -437,14 +442,14 @@ function love.errorhandler(msg)
gc.present() gc.present()
needDraw=false needDraw=false
end end
love.timer.sleep(.2) love.timer.sleep(.26)
end end
end end
local devColor={ local devColor={
color.white, COLOR.white,
color.lMagenta, COLOR.lMagenta,
color.lGreen, COLOR.lGreen,
color.lBlue, COLOR.lBlue,
} }
local FPS=love.timer.getFPS local FPS=love.timer.getFPS
love.draw,love.update=nil--remove default draw/update love.draw,love.update=nil--remove default draw/update
@@ -473,6 +478,7 @@ function love.run()
else else
SCN.init("load") SCN.init("load")
end end
BG.set("none")
return function() return function()
local _ local _
@@ -526,7 +532,7 @@ function love.run()
local R=int(r)%7+1 local R=int(r)%7+1
_=SKIN.libColor[SETTING.skin[R]] _=SKIN.libColor[SETTING.skin[R]]
gc.setColor(_[1],_[2],_[3],min(1-abs(1-r%1*2),.3)) 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,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3) gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end end
@@ -549,7 +555,7 @@ function love.run()
--Draw network working --Draw network working
if TASK.netTaskCount>0 then if TASK.netTaskCount>0 then
setFont(30) 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)) gc.print("E",1250,0,.26+.355*math.sin(Timer()*6.26))
end end
@@ -563,7 +569,7 @@ function love.run()
if devMode then if devMode then
gc.setColor(devColor[devMode]) gc.setColor(devColor[devMode])
gc.print("Memory:"..gcinfo(),5,_-40) 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("Cursor:"..int(mx+.5).." "..int(my+.5),5,_-80)
gc.print("Voices:"..VOC.getCount(),5,_-100) gc.print("Voices:"..VOC.getCount(),5,_-100)
gc.print("Tasks:"..TASK.getCount(),5,_-120) gc.print("Tasks:"..TASK.getCount(),5,_-120)
@@ -590,7 +596,7 @@ function love.run()
end end
if gc.getWidth()~=SCR.w then if gc.getWidth()~=SCR.w then
love.resize(gc.getWidth(),gc.getHeight()) love.resize(gc.getWidth(),gc.getHeight())
LOG.print("Screen Resized",color.yellow) LOG.print("Screen Resized",COLOR.yellow)
end end
end end

View File

@@ -41,23 +41,23 @@ function LOG.print(text,T,C)--text,type/time,color
local time local time
local his local his
if T=="warn"then if T=="warn"then
C=C or color.yellow C=C or COLOR.yellow
his=true his=true
time=180 time=180
elseif T=="error"then elseif T=="error"then
C=C or color.red C=C or COLOR.red
his=true his=true
time=210 time=210
elseif T=="message"then elseif T=="message"then
C=C or color.sky C=C or COLOR.sky
his=true his=true
elseif type(T)=="number"then elseif type(T)=="number"then
C=C or color.white C=C or COLOR.white
time=T time=T
elseif type(T)=="table"then elseif type(T)=="table"then
C,T=T C,T=T
elseif not C then elseif not C then
C=color.white C=COLOR.white
end end
if his then if his then
ins(debugMesHistory,SCN.cur..": "..tostring(text)) ins(debugMesHistory,SCN.cur..": "..tostring(text))
@@ -67,6 +67,6 @@ end
function LOG.copy() function LOG.copy()
local str=table.concat(debugMesHistory,"\n") local str=table.concat(debugMesHistory,"\n")
love.system.setClipboardText(str) love.system.setClipboardText(str)
LOG.print("Log copied",color.blue) LOG.print("Log copied",COLOR.blue)
end end
return LOG return LOG

View File

@@ -30,7 +30,7 @@ function SFX.loadOne(_)
if love.filesystem.getInfo(N)then if love.filesystem.getInfo(N)then
SFX.list[_]={love.audio.newSource(N,"static")} SFX.list[_]={love.audio.newSource(N,"static")}
else else
LOG.print("No SFX file: "..N,5,color.orange) LOG.print("No SFX file: "..N,5,COLOR.orange)
end end
end end
function SFX.loadAll() function SFX.loadAll()

View File

@@ -1,8 +1,7 @@
local gc=love.graphics local gc=love.graphics
local setColor=gc.setColor local setColor,setWidth=gc.setColor,gc.setLineWidth
local setWidth=gc.setLineWidth
local rem=table.remove
local max,min=math.max,math.min local max,min=math.max,math.min
local rem=table.remove
local fx={} local fx={}

View File

@@ -15,7 +15,7 @@ function TASK.update()
TASK.netTaskCount=TASK.netTaskCount-1 TASK.netTaskCount=TASK.netTaskCount-1
end end
rem(tasks,i) rem(tasks,i)
end end
end end
end end
function TASK.new(code,data) function TASK.new(code,data)

View File

@@ -1,7 +1,7 @@
local gc=love.graphics local gc=love.graphics
local rnd=math.random local rnd=math.random
local rem=table.remove local rem=table.remove
local mStr=mStr local setFont,mStr=setFont,mStr
local texts={} local texts={}

View File

@@ -24,7 +24,7 @@ do--LOADLIB
if success then if success then
return success return success
else else
LOG.print("Cannot load "..name..": "..message,"warn",color.red) LOG.print("Cannot load "..name..": "..message,"warn",COLOR.red)
end end
elseif SYSTEM=="Android"then elseif SYSTEM=="Android"then
local fs=love.filesystem local fs=love.filesystem
@@ -37,25 +37,25 @@ do--LOADLIB
if success then if success then
libFunc,message=package.loadlib(table.concat({fs.getSaveDirectory(),libName.Android},"/"),libName.libFunc) libFunc,message=package.loadlib(table.concat({fs.getSaveDirectory(),libName.Android},"/"),libName.libFunc)
if libFunc then if libFunc then
LOG.print(name.." lib loaded","warn",color.green) LOG.print(name.." lib loaded","warn",COLOR.green)
break break
else else
LOG.print("Cannot load "..name..": "..message,"warn",color.red) LOG.print("Cannot load "..name..": "..message,"warn",COLOR.red)
end end
else 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 end
else else
LOG.print("Read "..name.."-"..platform[i].." failed","warn",color.red) LOG.print("Read "..name.."-"..platform[i].." failed","warn",COLOR.red)
end end
end end
if not libFunc then if not libFunc then
LOG.print("failed to load "..name,"warn",color.red) LOG.print("failed to load "..name,"warn",COLOR.red)
return return
end end
return libFunc() return libFunc()
else else
LOG.print("No "..name.." for "..SYSTEM,"warn",color.red) LOG.print("No "..name.." for "..SYSTEM,"warn",COLOR.red)
return return
end end
return true return true
@@ -180,7 +180,7 @@ do--httpRequest
TASK.netTaskCount=TASK.netTaskCount+1 TASK.netTaskCount=TASK.netTaskCount+1
end or end or
function() function()
LOG.print("[NO NETlib]",5,color.yellow) LOG.print("[NO NETlib]",5,COLOR.yellow)
end end
end end
do--json do--json

View File

@@ -1,8 +1,8 @@
local level={0,0,.015,.02,.03,.04,.05,.06,.07,.08} local level={0,0,.015,.02,.03,.04,.05,.06,.07,.08}
local _=love.system.vibrate local VIB=love.system.vibrate
return function(t) return function(t)
local L=SETTING.vib local L=SETTING.vib
if L>0 then if L>0 then
_(level[L+t]) VIB(level[L+t])
end end
end end

View File

@@ -31,7 +31,7 @@ function VOC.loadOne(name)
if i==1 then if i==1 then
if not loadVoiceFile(N,N)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
end end
if not VOC.list[N][1]then VOC.list[N]=nil end if not VOC.list[N][1]then VOC.list[N]=nil end

View File

@@ -5,10 +5,8 @@ local max,min=math.max,math.min
local sub,format=string.sub,string.format local sub,format=string.sub,string.format
local ins=table.insert local ins=table.insert
local color=color
local setFont=setFont
local Timer=love.timer.getTime local Timer=love.timer.getTime
local mStr=mStr local setFont,mStr=setFont,mStr
local Empty={} local Empty={}
local widgetList={} local widgetList={}
@@ -42,7 +40,7 @@ function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,hide]
name= D.name, name= D.name,
x= D.x, x= D.x,
y= D.y, 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, font= D.font or 30,
align= D.align or"M", align= D.align or"M",
hide= D.hide, 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, 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, font= D.font or 30,
code= D.code, code= D.code,
hide= D.hide, 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, 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, font= D.font or 30,
code= D.code, code= D.code,
hide= D.hide, 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, 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, list= D.list,
disp= D.disp, disp= D.disp,
code= D.code, code= D.code,
@@ -870,7 +868,6 @@ function WIDGET.keyPressed(key)
local dist=(x-WX)*dir local dist=(x-WX)*dir
if dist>10 then if dist>10 then
dist=dist+abs(y-WY)*6.26 dist=dist+abs(y-WY)*6.26
print(W1.name,dist)
if dist<minDist then if dist<minDist then
minDist=dist minDist=dist
tar=W1 tar=W1

View File

@@ -8,11 +8,15 @@
optimization is welcomed if you also love tetromino game optimization is welcomed if you also love tetromino game
]]-- ]]--
local fs=love.filesystem
--? --?
NULL=function()end NULL=function()end
DBP=print--use this if need debugging print DBP=print--use this if need debugging print
SYSTEM=love.system.getOS() SYSTEM=love.system.getOS()
MOBILE=SYSTEM=="Android"or SYSTEM=="iOS" MOBILE=SYSTEM=="Android"or SYSTEM=="iOS"
SAVEDIR=fs.getSaveDirectory()
MARKING=true MARKING=true
LOADED=false LOADED=false
NOGAME=false NOGAME=false
@@ -103,10 +107,10 @@ GAME={
}--Global game data }--Global game data
PLAYERS={alive={}}--Players data PLAYERS={alive={}}--Players data
CURMODE=nil--Current mode object CURMODE=nil--Current mode object
--blockSkin,blockSkinMini={},{}--Redefined in SKIN.change
--Load modules --Load modules
require("Zframework")--Load Zframework require("Zframework")--Load Zframework
require("parts/list") require("parts/list")
@@ -115,30 +119,38 @@ require("parts/gametoolfunc")
FIELD[1]=newBoard()--Initialize field[1] FIELD[1]=newBoard()--Initialize field[1]
blocks= require("parts/mino") BLOCKS= require("parts/mino")
AITemplate= require("parts/AITemplate") AIBUILDER= require("parts/AITemplate")
freeRow= require("parts/freeRow") FREEROW= require("parts/freeRow")
TEXTURE=require("parts/texture") TEXTURE=require("parts/texture")
SKIN= require("parts/skin") SKIN= require("parts/skin")
PLY= require("parts/player") PLY= require("parts/player")
AIfunc= require("parts/ai") AIFUNC= require("parts/ai")
Modes= require("parts/modes") MODES= require("parts/modes")
TICK= require("parts/tick") TICK= require("parts/tick")
--Load Scenes files from SOURCE ONLY --Load Scene files from SOURCE ONLY
local fs=love.filesystem
local saveDir=fs.getSaveDirectory()
for _,v in next,fs.getDirectoryItems("parts/scenes")do for _,v in next,fs.getDirectoryItems("parts/scenes")do
if fs.getRealDirectory("parts/scenes/"..v)~=saveDir then if fs.getRealDirectory("parts/scenes/"..v)~=SAVEDIR then
require("parts/scenes/"..v:sub(1,-5)) require("parts/scenes/"..v:sub(1,-5))
else else
LOG.print("Dangerous file : %SAVE%/parts/scenes/"..v) LOG.print("Dangerous file : %SAVE%/parts/scenes/"..v)
end end
end end
--Load Background files from SOURCE ONLY
for _,v in next,love.filesystem.getDirectoryItems("parts/backgrounds")do
if love.filesystem.getRealDirectory("parts/backgrounds/"..v)~=SAVEDIR then
local name=v:sub(1,-5)
BG.list[name]=require("parts/backgrounds/"..name)
else
LOG.print("Dangerous file : %SAVE%/parts/backgrounds/"..v)
end
end
--Load files & settings --Load files & settings
modeRanks={sprint_10=0} RANKS={sprint_10=0}
if fs.getInfo("keymap.dat")then fs.remove("keymap.dat")end if fs.getInfo("keymap.dat")then fs.remove("keymap.dat")end
if fs.getInfo("setting.dat")then fs.remove("setting.dat")end if fs.getInfo("setting.dat")then fs.remove("setting.dat")end
@@ -170,7 +182,7 @@ if fs.getInfo("tech_ultimate+.dat")then fs.remove("tech_ultimate+.dat")end
--Update data --Update data
do do
local R=modeRanks local R=RANKS
R.sprint_10=R.sprint_10 or 0 R.sprint_10=R.sprint_10 or 0
for k,_ in next,R do for k,_ in next,R do
if type(k)=="number"then if type(k)=="number"then
@@ -213,13 +225,13 @@ do
if S.version~=gameVersion then if S.version~=gameVersion then
S.version=gameVersion S.version=gameVersion
newVersionLaunch=true newVersionLaunch=true
for name,rank in next,modeRanks do for name,rank in next,RANKS do
if rank and rank>0 then if rank and rank>0 then
for i=1,#Modes do for i=1,#MODES do
if Modes[i].name==name and Modes[i].unlock then if MODES[i].name==name and MODES[i].unlock then
for _,unlockName in next,Modes[i].unlock do for _,unlockName in next,MODES[i].unlock do
if not modeRanks[unlockName]then if not RANKS[unlockName]then
modeRanks[unlockName]=0 RANKS[unlockName]=0
end end
end end
end end
@@ -230,7 +242,7 @@ do
FILE.saveSetting() FILE.saveSetting()
end end
if MOBILE and not SETTING.fullscreen then if MOBILE and not SETTING.fullscreen then
LOG.print("如果手机上方状态栏不消失,请到设置界面开启全屏",300,color.yellow) LOG.print("如果手机上方状态栏不消失,请到设置界面开启全屏",300,COLOR.yellow)
LOG.print("Switch fullscreen on if titleBar don't disappear",300,color.yellow) LOG.print("Switch fullscreen on if titleBar don't disappear",300,COLOR.yellow)
end end
end end

View File

@@ -12,7 +12,7 @@ local function score(P)
end end
return{ return{
color=color.lBlue, color=COLOR.lBlue,
env={ env={
noTele=true, noTele=true,
minarr=1, minarr=1,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=30,lock=60, drop=30,lock=60,
fall=12, fall=12,

View File

@@ -1,6 +1,6 @@
local min=math.min local min=math.min
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
drop=5,lock=60, drop=5,lock=60,
fall=8, fall=8,

View File

@@ -1,6 +1,6 @@
local format=string.format local format=string.format
return{ return{
color=color.lGrey, color=COLOR.lGrey,
env={ env={
drop=1e99,lock=1e99, drop=1e99,lock=1e99,
hold=false, hold=false,

View File

@@ -1,6 +1,6 @@
local min=math.min local min=math.min
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
drop=30,lock=45, drop=30,lock=45,
visible="time", visible="time",

View File

@@ -1,7 +1,7 @@
local gc=love.graphics local gc=love.graphics
local min=math.min local min=math.min
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=15,lock=45, drop=15,lock=45,
fall=10, fall=10,

View File

@@ -1,7 +1,7 @@
local gc=love.graphics local gc=love.graphics
local min=math.min local min=math.min
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=10,lock=60, drop=10,lock=60,
fall=5, fall=5,

View File

@@ -1,7 +1,7 @@
local gc=love.graphics local gc=love.graphics
local min=math.min local min=math.min
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=15,lock=45, drop=15,lock=45,
freshLimit=10, freshLimit=10,

View File

@@ -1,7 +1,7 @@
local gc=love.graphics local gc=love.graphics
local min=math.min local min=math.min
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=30,lock=60, drop=30,lock=60,
block=false,center=0,ghost=0, block=false,center=0,ghost=0,

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local sin,min=math.sin,math.min local sin,min=math.sin,math.min
local Timer=love.timer.getTime local Timer=love.timer.getTime
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=30,lock=60, drop=30,lock=60,
next=1, next=1,
@@ -18,7 +18,7 @@ return{
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
if SETTING.spawn==0 then if SETTING.spawn==0 then
LOG.print(text.switchSpawnSFX,color.yellow) LOG.print(text.switchSpawnSFX,COLOR.yellow)
end end
end, end,
mesDisp=function(P) mesDisp=function(P)

View File

@@ -4,8 +4,8 @@ local function check_c4w(P)
P:lose() P:lose()
else else
for _=1,#P.clearedRow do for _=1,#P.clearedRow do
P.field[#P.field+1]=freeRow.get(13) P.field[#P.field+1]=FREEROW.get(13)
P.visTime[#P.visTime+1]=freeRow.get(20) P.visTime[#P.visTime+1]=FREEROW.get(20)
for i=4,7 do P.field[#P.field][i]=0 end for i=4,7 do P.field[#P.field][i]=0 end
end end
if P.combo>P.modeData.point then if P.combo>P.modeData.point then
@@ -18,7 +18,7 @@ local function check_c4w(P)
end end
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=5,lock=30, drop=5,lock=30,
dropPiece=check_c4w, dropPiece=check_c4w,
@@ -31,8 +31,8 @@ return{
local P=PLAYERS[1] local P=PLAYERS[1]
local F=P.field local F=P.field
for i=1,24 do for i=1,24 do
F[i]=freeRow.get(13) F[i]=FREEROW.get(13)
P.visTime[i]=freeRow.get(20) P.visTime[i]=FREEROW.get(20)
for x=4,7 do F[i][x]=0 end for x=4,7 do F[i][x]=0 end
end end
local r=P:RND(6) local r=P:RND(6)

View File

@@ -2,8 +2,8 @@ local min=math.min
local function check_c4w(P) local function check_c4w(P)
if #P.clearedRow>0 then if #P.clearedRow>0 then
for _=1,#P.clearedRow do for _=1,#P.clearedRow do
P.field[#P.field+1]=freeRow.get(13) P.field[#P.field+1]=FREEROW.get(13)
P.visTime[#P.visTime+1]=freeRow.get(20) P.visTime[#P.visTime+1]=FREEROW.get(20)
for i=4,7 do P.field[#P.field][i]=0 end for i=4,7 do P.field[#P.field][i]=0 end
end end
if P.combo>P.modeData.point then if P.combo>P.modeData.point then
@@ -16,7 +16,7 @@ local function check_c4w(P)
end end
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=30,lock=60,oncehold=false, drop=30,lock=60,oncehold=false,
dropPiece=check_c4w, dropPiece=check_c4w,
@@ -29,8 +29,8 @@ return{
local P=PLAYERS[1] local P=PLAYERS[1]
local F=P.field local F=P.field
for i=1,24 do for i=1,24 do
F[i]=freeRow.get(13) F[i]=FREEROW.get(13)
P.visTime[i]=freeRow.get(20) P.visTime[i]=FREEROW.get(20)
for x=4,7 do F[i][x]=0 end for x=4,7 do F[i][x]=0 end
end end
local r=P:RND(6) local r=P:RND(6)

View File

@@ -15,7 +15,7 @@ local function check_LVup(P)
end end
return{ return{
color=color.lBlue, color=COLOR.lBlue,
env={ env={
noTele=true, noTele=true,
das=16,arr=6,sddas=2,sdarr=2, das=16,arr=6,sddas=2,sdarr=2,

View File

@@ -17,8 +17,8 @@ local function setField(P,page)
local t=P.showTime*3 local t=P.showTime*3
for y=1,height do for y=1,height do
local solid=notAir(F[y]) local solid=notAir(F[y])
P.field[y]=freeRow.get(0,solid) P.field[y]=FREEROW.get(0,solid)
P.visTime[y]=freeRow.get(t) P.visTime[y]=FREEROW.get(t)
if solid then if solid then
for x=1,10 do for x=1,10 do
P.field[y][x]=F[y][x] P.field[y][x]=F[y][x]
@@ -33,8 +33,8 @@ local function checkClear(P)
if FIELD[P.modeData.point+1]then if FIELD[P.modeData.point+1]then
P.waiting=26 P.waiting=26
for _=#P.field,1,-1 do for _=#P.field,1,-1 do
freeRow.discard(P.field[_]) FREEROW.discard(P.field[_])
freeRow.discard(P.visTime[_]) FREEROW.discard(P.visTime[_])
P.field[_],P.visTime[_]=nil P.field[_],P.visTime[_]=nil
end end
setField(P,P.modeData.point+1) setField(P,P.modeData.point+1)
@@ -46,7 +46,7 @@ local function checkClear(P)
end end
end end
return{ return{
color=color.white, color=COLOR.white,
env={}, env={},
load=function() load=function()
for k,v in next,customEnv do for k,v in next,customEnv do
@@ -80,9 +80,9 @@ return{
if L~=0 then if L~=0 then
modeEnv.target=nil modeEnv.target=nil
if L<6 then 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 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
end end
for _,P in next,PLAYERS.alive do for _,P in next,PLAYERS.alive do

View File

@@ -18,8 +18,8 @@ local function puzzleCheck(P)
if FIELD[P.modeData.point+1]then if FIELD[P.modeData.point+1]then
P.waiting=26 P.waiting=26
for _=#P.field,1,-1 do for _=#P.field,1,-1 do
freeRow.discard(P.field[_]) FREEROW.discard(P.field[_])
freeRow.discard(P.visTime[_]) FREEROW.discard(P.visTime[_])
P.field[_],P.visTime[_]=nil P.field[_],P.visTime[_]=nil
end end
sysFX.newShade(.7,.3,1,.3,P.x+150*P.size,P.y+60*P.size,300*P.size,610*P.size) 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 end
return{ return{
color=color.white, color=COLOR.white,
env={ env={
Fkey=function(P)P.modeData.event=1-P.modeData.event end, Fkey=function(P)P.modeData.event=1-P.modeData.event end,
dropPiece=puzzleCheck, dropPiece=puzzleCheck,
@@ -56,9 +56,9 @@ return{
if L~=0 then if L~=0 then
modeEnv.target=nil modeEnv.target=nil
if L<6 then 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 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
end end
modeEnv.bg=customEnv.bg modeEnv.bg=customEnv.bg

View File

@@ -1,6 +1,6 @@
local int=math.floor local int=math.floor
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=5,lock=60, drop=5,lock=60,
fall=6, fall=6,

View File

@@ -1,6 +1,6 @@
local int=math.floor local int=math.floor
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=30,lock=60, drop=30,lock=60,
fall=10, fall=10,

View File

@@ -5,7 +5,7 @@ local function check_rise(P)
end end
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
pushSpeed=6, pushSpeed=6,
dropPiece=check_rise, dropPiece=check_rise,

View File

@@ -8,7 +8,7 @@ local function check_rise(P)
end end
return{ return{
color=color.green, color=COLOR.green,
env={ env={
pushSpeed=6, pushSpeed=6,
dropPiece=check_rise, dropPiece=check_rise,

View File

@@ -8,7 +8,7 @@ local function check_rise(P)
end end
return{ return{
color=color.lBlue, color=COLOR.lBlue,
env={ env={
pushSpeed=6, pushSpeed=6,
dropPiece=check_rise, dropPiece=check_rise,

View File

@@ -8,7 +8,7 @@ local function check_rise(P)
end end
return{ return{
color=color.orange, color=COLOR.orange,
env={ env={
pushSpeed=6, pushSpeed=6,
dropPiece=check_rise, dropPiece=check_rise,

View File

@@ -1,6 +1,6 @@
local max=math.max local max=math.max
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=60,lock=120, drop=60,lock=120,
fall=20, fall=20,

View File

@@ -1,6 +1,6 @@
local max=math.max local max=math.max
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
drop=10,lock=30, drop=10,lock=30,
freshLimit=15, freshLimit=15,

View File

@@ -1,6 +1,6 @@
local min=math.min local min=math.min
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=20,lock=60, drop=20,lock=60,
sequence=function(P) sequence=function(P)
@@ -8,7 +8,7 @@ return{
end, end,
freshMethod=function(P) freshMethod=function(P)
if not P.next[1] then if not P.next[1] then
local height=freeRow.get(0) local height=FREEROW.get(0)
local max=#P.field local max=#P.field
if max>0 then if max>0 then
--Get heights --Get heights
@@ -87,7 +87,7 @@ return{
end end
::END:: ::END::
freeRow.discard(height) FREEROW.discard(height)
P:getNext(res[P:RND(#res)]) P:getNext(res[P:RND(#res)])
end end
end, end,

View File

@@ -1,6 +1,6 @@
local min=math.min local min=math.min
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=20,lock=60, drop=20,lock=60,
sequence="bag", sequence="bag",

View File

@@ -1,6 +1,6 @@
local format=string.format local format=string.format
return{ return{
color=color.lGrey, color=COLOR.lGrey,
env={ env={
drop=1e99,lock=1e99, drop=1e99,lock=1e99,
oncehold=false, oncehold=false,

View File

@@ -27,7 +27,7 @@ local function check_rise(P)
end end
return{ return{
color=color.white, color=COLOR.white,
env={ env={
drop=1e99,lock=1e99, drop=1e99,lock=1e99,
oncehold=false, oncehold=false,

View File

@@ -17,7 +17,7 @@ local function check(P)
end end
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
noTele=true, noTele=true,
mindas=7,minarr=1,minsdarr=1, mindas=7,minarr=1,minsdarr=1,

View File

@@ -14,7 +14,7 @@ local function check_LVup(P)
end end
return{ return{
color=color.green, color=COLOR.green,
env={ env={
noTele=true, noTele=true,
wait=8,fall=20, wait=8,fall=20,

View File

@@ -21,7 +21,7 @@ local function check_LVup(P)
end end
return{ return{
color=color.yellow, color=COLOR.yellow,
env={ env={
noTele=true, noTele=true,
wait=8,fall=20, wait=8,fall=20,

View File

@@ -40,7 +40,7 @@ local function score(P)
end end
return{ return{
color=color.red, color=COLOR.red,
env={ env={
noTele=true, noTele=true,
das=6,arr=1, das=6,arr=1,

View File

@@ -42,7 +42,7 @@ local function score(P)
end end
return{ return{
color=color.red, color=COLOR.red,
env={ env={
noTele=true, noTele=true,
das=9,arr=3, das=9,arr=3,

View File

@@ -40,7 +40,7 @@ local function score(P)
end end
return{ return{
color=color.lGrey, color=COLOR.lGrey,
env={ env={
noTele=true, noTele=true,
das=5,arr=1, das=5,arr=1,

View File

@@ -38,8 +38,8 @@ local function check_LVup(P)
P.field[i][P:RND(10)]=0 P.field[i][P:RND(10)]=0
end end
else else
P.field[i]=freeRow.get(0) P.field[i]=FREEROW.get(0)
P.visTime[i]=freeRow.get(30) P.visTime[i]=FREEROW.get(30)
for j=1,10 do for j=1,10 do
if P:RND()>.9 then if P:RND()>.9 then
P.field[i][j]=math.random(16) P.field[i][j]=math.random(16)
@@ -132,7 +132,7 @@ local function check_LVup(P)
end end
return{ return{
color=color.black, color=COLOR.black,
env={ env={
noTele=true, noTele=true,
das=5,arr=1, das=5,arr=1,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=60,lock=120, drop=60,lock=120,
fall=10, fall=10,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=20,lock=60, drop=20,lock=60,
fall=20, fall=20,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.green, color=COLOR.green,
env={ env={
oncehold=false, oncehold=false,
drop=300,lock=1e99, drop=300,lock=1e99,

View File

@@ -47,7 +47,7 @@ local function newPC(P)
end end
return{ return{
color=color.red, color=COLOR.red,
env={ env={
next=4, next=4,
hold=false, hold=false,

View File

@@ -40,7 +40,7 @@ local function newPC(P)
end end
end end
return{ return{
color=color.green, color=COLOR.green,
env={ env={
next=4, next=4,
hold=false, hold=false,

View File

@@ -11,7 +11,7 @@ local function update_round(P)
end end
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
drop=300,lock=300, drop=300,lock=300,
oncehold=false, oncehold=false,
@@ -20,7 +20,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) 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 GAME.garbageSpeed=1e99
end, end,
score=function(P)return{P.stat.piece,P.stat.time}end, score=function(P)return{P.stat.piece,P.stat.time}end,

View File

@@ -11,7 +11,7 @@ local function update_round(P)
end end
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=300,lock=300, drop=300,lock=300,
oncehold=false, oncehold=false,
@@ -20,7 +20,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) 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 GAME.garbageSpeed=1e99
end, end,
score=function(P)return{P.stat.piece,P.stat.time}end, score=function(P)return{P.stat.piece,P.stat.time}end,

View File

@@ -11,7 +11,7 @@ local function update_round(P)
end end
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=300,lock=300, drop=300,lock=300,
oncehold=false, oncehold=false,
@@ -20,7 +20,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) 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 GAME.garbageSpeed=1e99
end, end,
score=function(P)return{P.stat.piece,P.stat.time}end, score=function(P)return{P.stat.piece,P.stat.time}end,

View File

@@ -11,7 +11,7 @@ local function update_round(P)
end end
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=300,lock=300, drop=300,lock=300,
oncehold=false, oncehold=false,
@@ -20,7 +20,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) 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 GAME.garbageSpeed=1e99
end, end,
score=function(P)return{P.stat.piece,P.stat.time}end, score=function(P)return{P.stat.piece,P.stat.time}end,

View File

@@ -11,7 +11,7 @@ local function update_round(P)
end end
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
drop=300,lock=300, drop=300,lock=300,
oncehold=false, oncehold=false,
@@ -20,7 +20,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) 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 GAME.garbageSpeed=1e99
end, end,
score=function(P)return{P.stat.piece,P.stat.time}end, score=function(P)return{P.stat.piece,P.stat.time}end,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
life=2, life=2,
drop=60,lock=60, drop=60,lock=60,
@@ -9,7 +9,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",4)) PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",4))
end, end,
score=function(P)return{P.stat.time}end, score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end, scoreDisp=function(D)return toTime(D[1])end,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.green, color=COLOR.green,
env={ env={
life=2, life=2,
drop=60,lock=60, drop=60,lock=60,
@@ -9,7 +9,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",5)) PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",5))
end, end,
score=function(P)return{P.stat.time}end, score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end, scoreDisp=function(D)return toTime(D[1])end,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
life=2, life=2,
drop=60,lock=60, drop=60,lock=60,
@@ -9,7 +9,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",6)) PLY.newAIPlayer(2,965,360,.5,AIBUILDER("9S",6))
end, end,
score=function(P)return{P.stat.time}end, score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end, scoreDisp=function(D)return toTime(D[1])end,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.red, color=COLOR.red,
env={ env={
life=2, life=2,
drop=60,lock=60, drop=60,lock=60,
@@ -9,7 +9,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) 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, end,
score=function(P)return{P.stat.time}end, score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end, scoreDisp=function(D)return toTime(D[1])end,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
life=2, life=2,
drop=60,lock=60, drop=60,lock=60,
@@ -9,7 +9,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) 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, end,
score=function(P)return{P.stat.time}end, score=function(P)return{P.stat.time}end,
scoreDisp=function(D)return toTime(D[1])end, scoreDisp=function(D)return toTime(D[1])end,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=60,lock=180, drop=60,lock=180,
noTele=true, noTele=true,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=60,lock=180, drop=60,lock=180,
keyCancel={3,4,5}, keyCancel={3,4,5},

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=60,lock=60, drop=60,lock=60,
next=0,hold=false, next=0,hold=false,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=60,lock=60, 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}, sequence="bag",bag={8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25},

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
drop=60,lock=60, drop=60,lock=60,
target=10,dropPiece=PLY.check_lineReach, target=10,dropPiece=PLY.check_lineReach,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=60,lock=60, drop=60,lock=60,
target=100,dropPiece=PLY.check_lineReach, target=100,dropPiece=PLY.check_lineReach,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.lGrey, color=COLOR.lGrey,
env={ env={
drop=60,lock=60, drop=60,lock=60,
target=1000,dropPiece=PLY.check_lineReach, target=1000,dropPiece=PLY.check_lineReach,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.lBlue, color=COLOR.lBlue,
env={ env={
drop=60,lock=60, drop=60,lock=60,
target=20,dropPiece=PLY.check_lineReach, target=20,dropPiece=PLY.check_lineReach,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=60,lock=60, drop=60,lock=60,
target=40,dropPiece=PLY.check_lineReach, target=40,dropPiece=PLY.check_lineReach,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.dRed, color=COLOR.dRed,
env={ env={
drop=60,lock=60, drop=60,lock=60,
target=400,dropPiece=PLY.check_lineReach, target=400,dropPiece=PLY.check_lineReach,

View File

@@ -1,6 +1,6 @@
local max=math.max local max=math.max
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
drop=30,lock=45, drop=30,lock=45,
freshLimit=10, freshLimit=10,

View File

@@ -1,6 +1,6 @@
local max=math.max local max=math.max
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=30,lock=45, drop=30,lock=45,
freshLimit=10, freshLimit=10,

View File

@@ -1,6 +1,6 @@
local max=math.max local max=math.max
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=30,lock=45, drop=30,lock=45,
freshLimit=10, freshLimit=10,

View File

@@ -1,6 +1,6 @@
local max=math.max local max=math.max
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=30,lock=45, drop=30,lock=45,
freshLimit=10, freshLimit=10,

View File

@@ -1,6 +1,6 @@
local max=math.max local max=math.max
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
drop=5,lock=60, drop=5,lock=60,
fall=10, fall=10,

View File

@@ -1,7 +1,7 @@
local format=string.format local format=string.format
local int=math.floor local int=math.floor
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
arr=0, arr=0,
drop=1e99,lock=60, drop=1e99,lock=60,

View File

@@ -13,7 +13,7 @@ local function tech_check_hard(P)
end end
return{ return{
color=color.grey, color=COLOR.grey,
env={ env={
arr=0, arr=0,
drop=1e99,lock=60, drop=1e99,lock=60,

View File

@@ -9,7 +9,7 @@ local function tech_check_easy(P)
end end
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=20,lock=60, drop=20,lock=60,
freshLimit=15, freshLimit=15,

View File

@@ -13,7 +13,7 @@ local function tech_check_hard(P)
end end
return{ return{
color=color.dMagenta, color=COLOR.dMagenta,
env={ env={
drop=30,lock=60, drop=30,lock=60,
freshLimit=15, freshLimit=15,

View File

@@ -9,7 +9,7 @@ local function tech_check_easy(P)
end end
return{ return{
color=color.red, color=COLOR.red,
env={ env={
drop=0,lock=60, drop=0,lock=60,
freshLimit=15, freshLimit=15,

View File

@@ -13,7 +13,7 @@ local function tech_check_hard(P)
end end
return{ return{
color=color.dRed, color=COLOR.dRed,
env={ env={
drop=0,lock=60, drop=0,lock=60,
freshLimit=15, freshLimit=15,

View File

@@ -9,7 +9,7 @@ local function tech_check_easy(P)
end end
return{ return{
color=color.green, color=COLOR.green,
env={ env={
oncehold=false, oncehold=false,
drop=1e99,lock=1e99, drop=1e99,lock=1e99,

View File

@@ -13,7 +13,7 @@ local function tech_check_hard(P)
end end
return{ return{
color=color.dGreen, color=COLOR.dGreen,
env={ env={
oncehold=false, oncehold=false,
drop=1e99,lock=1e99, drop=1e99,lock=1e99,

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end end
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
drop=60,lock=60, drop=60,lock=60,
fall=20, fall=20,
@@ -41,17 +41,17 @@ return{
local n=2 local n=2
for i=1,4 do for j=1,6 do for i=1,4 do for j=1,6 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end
for i=9,12 do for j=1,6 do for i=9,12 do for j=1,6 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end end
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=60,lock=60, drop=60,lock=60,
fall=20, fall=20,
@@ -41,17 +41,17 @@ return{
local n=2 local n=2
for i=1,4 do for j=1,6 do for i=1,4 do for j=1,6 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end
for i=9,12 do for j=1,6 do for i=9,12 do for j=1,6 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end end
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
drop=15,lock=60, drop=15,lock=60,
fall=20, fall=20,
@@ -41,17 +41,17 @@ return{
local n=2 local n=2
for i=1,4 do for j=1,6 do for i=1,4 do for j=1,6 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end
for i=9,12 do for j=1,6 do for i=9,12 do for j=1,6 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end end
return{ return{
color=color.cyan, color=COLOR.cyan,
env={ env={
drop=60,lock=60, drop=60,lock=60,
fall=20, fall=20,
@@ -41,17 +41,17 @@ return{
local n=2 local n=2
for i=1,7 do for j=1,7 do for i=1,7 do for j=1,7 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end
for i=15,21 do for j=1,7 do for i=15,21 do for j=1,7 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end end
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=60,lock=60, drop=60,lock=60,
fall=20, fall=20,
@@ -41,17 +41,17 @@ return{
local n=2 local n=2
for i=1,7 do for j=1,7 do for i=1,7 do for j=1,7 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end
for i=15,21 do for j=1,7 do for i=15,21 do for j=1,7 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end end
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
drop=15,lock=60, drop=15,lock=60,
fall=20, fall=20,
@@ -41,17 +41,17 @@ return{
local n=2 local n=2
for i=1,7 do for j=1,7 do for i=1,7 do for j=1,7 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end
for i=15,21 do for j=1,7 do for i=15,21 do for j=1,7 do
if L[n]then 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 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 end
n=n+1 n=n+1
end end end end

View File

@@ -10,7 +10,7 @@ local function check_tsd(P)
end end
return{ return{
color=color.green, color=COLOR.green,
env={ env={
drop=1e99,lock=1e99, drop=1e99,lock=1e99,
oncehold=false, oncehold=false,

View File

@@ -10,7 +10,7 @@ local function check_tsd(P)
end end
return{ return{
color=color.magenta, color=COLOR.magenta,
env={ env={
drop=60,lock=60, drop=60,lock=60,
freshLimit=15, freshLimit=15,

View File

@@ -10,7 +10,7 @@ local function check_tsd(P)
end end
return{ return{
color=color.lYellow, color=COLOR.lYellow,
env={ env={
drop=60,lock=60, drop=60,lock=60,
freshLimit=15, freshLimit=15,

View File

@@ -1,7 +1,7 @@
local gc=love.graphics local gc=love.graphics
local warnTime={60,90,105,115,116,117,118,119,120} local warnTime={60,90,105,115,116,117,118,119,120}
return{ return{
color=color.lGrey, color=COLOR.lGrey,
env={ env={
noTele=true, noTele=true,
minarr=1,minsdarr=1, minarr=1,minsdarr=1,

View File

@@ -1,5 +1,5 @@
return{ return{
color=color.lGrey, color=COLOR.lGrey,
env={ env={
drop=120,lock=120, drop=120,lock=120,
oncehold=false, oncehold=false,

View File

@@ -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) return function(type,speedLV,next,hold,node)
if type=="CC"then if type=="CC"then
return{ return{

View File

@@ -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 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 end
end end
local discardRow=freeRow.discard local discardRow=FREEROW.discard
local getRow=freeRow.get local getRow=FREEROW.get
local function resetField(f0,f,start) local function resetField(f0,f,start)
for _=#f,start,-1 do for _=#f,start,-1 do
discardRow(f[_]) discardRow(f[_])
@@ -215,7 +215,7 @@ return{
if not bn then goto CTN end if not bn then goto CTN end
for dir=0,dirCount[bn]do--Each dir 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 for cx=1,11-#cb[1]do--Each pos
local cy=#Tfield+1 local cy=#Tfield+1

Some files were not shown because too many files have changed in this diff Show More