很多全局变量名改为大写

This commit is contained in:
MrZ626
2020-10-19 01:42:27 +08:00
parent 016efe011f
commit 60c656fd38
45 changed files with 595 additions and 596 deletions

View File

@@ -4,7 +4,7 @@ local max,min,sin,cos=math.max,math.min,math.sin,math.cos
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local BG local BG
local scr=scr local SCR=SCR
local BGvars={_G=_G,SHADER=SHADER} local BGvars={_G=_G,SHADER=SHADER}
local back={} local back={}
@@ -88,7 +88,7 @@ back.wing={
end, end,
resize=function() resize=function()
crystal={} crystal={}
W,H=scr.w,scr.h W,H=SCR.w,SCR.h
for i=1,16 do for i=1,16 do
crystal[i]={ crystal[i]={
x=i<9 and W*.05*i or W*.05*(28-i), x=i<9 and W*.05*i or W*.05*(28-i),
@@ -138,14 +138,14 @@ back.fan={
BG.resize() BG.resize()
end, end,
resize=function() resize=function()
CX,CY=scr.w/2,scr.h/2 CX,CY=SCR.w/2,SCR.h/2
W,H=scr.w,scr.h W,H=SCR.w,SCR.h
end, end,
update=function() update=function()
t=t+1 t=t+1
if t%10==0 then if t%10==0 then
ins(petal,{ ins(petal,{
x=scr.w*rnd(), x=SCR.w*rnd(),
y=0, y=0,
vy=2+rnd()*2, vy=2+rnd()*2,
vx=rnd()*2-.5, vx=rnd()*2-.5,
@@ -169,7 +169,7 @@ back.fan={
draw=function() draw=function()
gc.push("transform") gc.push("transform")
gc.translate(CX,CY+20*sin(t*.02)) gc.translate(CX,CY+20*sin(t*.02))
gc.scale(scr.k) gc.scale(SCR.k)
gc.clear(.1,.1,.1) gc.clear(.1,.1,.1)
gc.setLineWidth(320) gc.setLineWidth(320)
gc.setColor(.3,.2,.3) gc.setColor(.3,.2,.3)
@@ -206,11 +206,11 @@ back.fan={
back.aura={ back.aura={
init=function() init=function()
t=rnd()*3600 t=rnd()*3600
BG.resize(scr.w,scr.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function(w,h)
SHADER.aura:send("w",scr.W) SHADER.aura:send("w",SCR.W)
SHADER.aura:send("h",h*scr.dpi) SHADER.aura:send("h",h*SCR.dpi)
end, end,
update=function(dt) update=function(dt)
t=t+dt t=t+dt
@@ -218,17 +218,17 @@ back.aura={
draw=function() draw=function()
SHADER.aura:send("t",t) SHADER.aura:send("t",t)
gc.setShader(SHADER.aura) gc.setShader(SHADER.aura)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.setShader() gc.setShader()
end, end,
}--Cool liquid background }--Cool liquid background
back.bg1={ back.bg1={
init=function() init=function()
t=0 t=0
BG.resize(scr.w) BG.resize(SCR.w)
end, end,
resize=function(w) resize=function(w)
SHADER.gradient1:send("w",scr.W) SHADER.gradient1:send("w",SCR.W)
end, end,
update=function(dt) update=function(dt)
t=t+dt t=t+dt
@@ -236,17 +236,17 @@ back.bg1={
draw=function() draw=function()
SHADER.gradient1:send("t",t) SHADER.gradient1:send("t",t)
gc.setShader(SHADER.gradient1) gc.setShader(SHADER.gradient1)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.setShader() gc.setShader()
end, end,
}--Horizonal red-blue gradient }--Horizonal red-blue gradient
back.bg2={ back.bg2={
init=function() init=function()
t=0 t=0
BG.resize(nil,scr.h) BG.resize(nil,SCR.h)
end, end,
resize=function(w,h) resize=function(w,h)
SHADER.gradient2:send("h",h*scr.dpi) SHADER.gradient2:send("h",h*SCR.dpi)
end, end,
update=function(dt) update=function(dt)
t=t+dt t=t+dt
@@ -254,18 +254,18 @@ back.bg2={
draw=function() draw=function()
SHADER.gradient2:send("t",t) SHADER.gradient2:send("t",t)
gc.setShader(SHADER.gradient2) gc.setShader(SHADER.gradient2)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.setShader() gc.setShader()
end, end,
}--Vertical red-green gradient }--Vertical red-green gradient
back.rainbow={ back.rainbow={
init=function() init=function()
t=0 t=0
BG.resize(scr.w,scr.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function(w,h)
SHADER.rgb1:send("w",scr.W) SHADER.rgb1:send("w",SCR.W)
SHADER.rgb1:send("h",h*scr.dpi) SHADER.rgb1:send("h",h*SCR.dpi)
end, end,
update=function(dt) update=function(dt)
t=t+dt t=t+dt
@@ -273,18 +273,18 @@ back.rainbow={
draw=function() draw=function()
SHADER.rgb1:send("t",t) SHADER.rgb1:send("t",t)
gc.setShader(SHADER.rgb1) gc.setShader(SHADER.rgb1)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.setShader() gc.setShader()
end, end,
}--Colorful RGB }--Colorful RGB
back.rainbow2={ back.rainbow2={
init=function() init=function()
t=0 t=0
BG.resize(scr.w,scr.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function(w,h)
SHADER.rgb2:send("w",scr.W) SHADER.rgb2:send("w",SCR.W)
SHADER.rgb2:send("h",h*scr.dpi) SHADER.rgb2:send("h",h*SCR.dpi)
end, end,
update=function(dt) update=function(dt)
t=t+dt t=t+dt
@@ -292,7 +292,7 @@ back.rainbow2={
draw=function() draw=function()
SHADER.rgb2:send("t",t) SHADER.rgb2:send("t",t)
gc.setShader(SHADER.rgb2) gc.setShader(SHADER.rgb2)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.setShader() gc.setShader()
end, end,
}--Blue RGB }--Blue RGB
@@ -317,7 +317,7 @@ back.lightning2={
init=function() init=function()
t=0 t=0
colorLib=_G.SKIN.libColor colorLib=_G.SKIN.libColor
colorSet=_G.setting.skin colorSet=_G.SETTING.skin
blockImg=_G.TEXTURE.miniBlock blockImg=_G.TEXTURE.miniBlock
end, end,
update=function(dt) update=function(dt)
@@ -346,10 +346,10 @@ back.matrix={
draw=function() draw=function()
gc.clear(.15,.15,.15) gc.clear(.15,.15,.15)
gc.push("transform") gc.push("transform")
local k=scr.k local k=SCR.k
gc.scale(k) gc.scale(k)
local Y=ceil(scr.h/80/k) local Y=ceil(SCR.h/80/k)
for x=1,ceil(scr.w/80/k)do for x=1,ceil(SCR.w/80/k)do
for y=1,Y do for y=1,Y do
gc.setColor(1,1,1,sin(x+matrixT[x][y]*t)*.1+.1) gc.setColor(1,1,1,sin(x+matrixT[x][y]*t)*.1+.1)
gc.rectangle("fill",80*x,80*y,-80,-80) gc.rectangle("fill",80*x,80*y,-80,-80)
@@ -362,14 +362,14 @@ back.matrix={
back.space={ back.space={
init=function() init=function()
stars={} stars={}
W,H=scr.w+20,scr.h+20 W,H=SCR.w+20,SCR.h+20
BG.resize(scr.w,scr.h) BG.resize(SCR.w,SCR.h)
end, end,
resize=function(w,h) resize=function(w,h)
local S=stars local S=stars
for i=1,1260,5 do for i=1,1260,5 do
local s=rnd(26,40)*.1 local s=rnd(26,40)*.1
S[i]=s*scr.k --Size S[i]=s*SCR.k --Size
S[i+1]=rnd(W)-10 --X S[i+1]=rnd(W)-10 --X
S[i+2]=rnd(H)-10 --Y S[i+2]=rnd(H)-10 --Y
S[i+3]=(rnd()-.5)*.01*s --Vx S[i+3]=(rnd()-.5)*.01*s --Vx
@@ -424,7 +424,7 @@ function BG.send(data)
end end
end end
function BG.set(bg,data) function BG.set(bg,data)
if bg==BG.cur or not setting.bg then return end if bg==BG.cur or not SETTING.bg then return end
if BG.discard then if BG.discard then
BG.discard() BG.discard()
collectgarbage() collectgarbage()

View File

@@ -3,7 +3,7 @@ local rem=table.remove
local function fadeOut(id) local function fadeOut(id)
local src=BGM.list[id] local src=BGM.list[id]
local v=src:getVolume()-.025*setting.bgm local v=src:getVolume()-.025*SETTING.bgm
src:setVolume(v>0 and v or 0) src:setVolume(v>0 and v or 0)
if v<=0 then if v<=0 then
src:stop() src:stop()
@@ -12,10 +12,10 @@ local function fadeOut(id)
end end
local function fadeIn(id) local function fadeIn(id)
local src=BGM.list[id] local src=BGM.list[id]
local v=setting.bgm local v=SETTING.bgm
v=min(v,src:getVolume()+.025*v) v=min(v,src:getVolume()+.025*v)
src:setVolume(v) src:setVolume(v)
if v>=setting.bgm then return true end if v>=SETTING.bgm then return true end
end end
local BGM={ local BGM={
@@ -64,7 +64,7 @@ function BGM.loadAll()
end end
end end
function BGM.play(s) function BGM.play(s)
if setting.bgm==0 then if SETTING.bgm==0 then
BGM.playing=BGM.list[s] BGM.playing=BGM.list[s]
BGM.suspend,BGM.nowPlay=s BGM.suspend,BGM.nowPlay=s
return return
@@ -84,7 +84,7 @@ function BGM.play(s)
end end
function BGM.freshVolume() function BGM.freshVolume()
if BGM.playing then if BGM.playing then
local v=setting.bgm local v=SETTING.bgm
if v>0 then if v>0 then
BGM.playing:setVolume(v) BGM.playing:setVolume(v)
if BGM.suspend then if BGM.suspend then

View File

@@ -71,14 +71,14 @@ function FILE.loadData()
if s then if s then
setfenv(s,{}) setfenv(s,{})
local S=s() local S=s()
addToTable(S,stat) addToTable(S,STAT)
end end
end end
end end
function FILE.saveData() function FILE.saveData()
local F=files.data local F=files.data
F:open("w") F:open("w")
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)
@@ -96,14 +96,14 @@ function FILE.loadSetting()
F:close() F:close()
if s then if s then
setfenv(s,{}) setfenv(s,{})
addToTable(s(),setting) addToTable(s(),SETTING)
end end
end end
end end
function FILE.saveSetting() function FILE.saveSetting()
local F=files.setting local F=files.setting
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)

View File

@@ -23,7 +23,7 @@ local gc=love.graphics
local int,rnd,abs=math.floor,math.random,math.abs local int,rnd,abs=math.floor,math.random,math.abs
local max,min=math.max,math.min local max,min=math.max,math.min
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local scr=scr local SCR=SCR
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)
@@ -107,7 +107,7 @@ function love.mousemoved(x,y,dx,dy,t)
mouseShow=true mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
if SCN.swapping then return end if SCN.swapping then return end
dx,dy=dx/scr.k,dy/scr.k dx,dy=dx/SCR.k,dy/SCR.k
if mouseMove[SCN.cur]then if mouseMove[SCN.cur]then
mouseMove[SCN.cur](mx,my,dx,dy) mouseMove[SCN.cur](mx,my,dx,dy)
end end
@@ -151,7 +151,7 @@ function love.touchmoved(id,x,y,dx,dy)
if SCN.swapping then return end if SCN.swapping then return end
x,y=xOy:inverseTransformPoint(x,y) x,y=xOy:inverseTransformPoint(x,y)
if touchMove[SCN.cur]then if touchMove[SCN.cur]then
touchMove[SCN.cur](id,x,y,dx/scr.k,dy/scr.k) touchMove[SCN.cur](id,x,y,dx/SCR.k,dy/SCR.k)
end end
if WIDGET.sel then if WIDGET.sel then
if touching then if touching then
@@ -194,15 +194,15 @@ function love.keypressed(i)
love._setGammaCorrect(r) love._setGammaCorrect(r)
LOG.print("GammaCorrect: "..(r and"on"or"off"),"warn") LOG.print("GammaCorrect: "..(r and"on"or"off"),"warn")
elseif i=="f2"then elseif i=="f2"then
LOG.print("System:"..system.."["..jit.arch.."]") LOG.print("System:"..SYSTEM.."["..jit.arch.."]")
LOG.print("luaVer:".._VERSION) LOG.print("luaVer:".._VERSION)
LOG.print("jitVer:"..jit.version) LOG.print("jitVer:"..jit.version)
LOG.print("jitVerNum:"..jit.version_num) LOG.print("jitVerNum:"..jit.version_num)
elseif i=="f3"then elseif i=="f3"then
for _=1,8 do for _=1,8 do
local P=players.alive[rnd(#players.alive)] local P=PLAYERS.alive[rnd(#PLAYERS.alive)]
if P~=players[1]then if P~=PLAYERS[1]then
P.lastRecv=players[1] P.lastRecv=PLAYERS[1]
P:lose() P:lose()
end end
end end
@@ -323,28 +323,28 @@ function love.lowmemory()
collectgarbage() collectgarbage()
end end
function love.resize(w,h) function love.resize(w,h)
scr.w,scr.h,scr.dpi=w,h,gc.getDPIScale() SCR.w,SCR.h,SCR.dpi=w,h,gc.getDPIScale()
scr.W,scr.H=scr.w*scr.dpi,scr.h*scr.dpi SCR.W,SCR.H=SCR.w*SCR.dpi,SCR.h*SCR.dpi
scr.r=h/w SCR.r=h/w
scr.rad=(w^2+h^2)^.5 SCR.rad=(w^2+h^2)^.5
if scr.r>=.5625 then if SCR.r>=.5625 then
scr.k=w/1280 SCR.k=w/1280
scr.x,scr.y=0,(h-w*9/16)*.5 SCR.x,SCR.y=0,(h-w*9/16)*.5
else else
scr.k=h/720 SCR.k=h/720
scr.x,scr.y=(w-h*16/9)*.5,0 SCR.x,SCR.y=(w-h*16/9)*.5,0
end end
xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360) xOy=xOy:setTransformation(w*.5,h*.5,nil,SCR.k,nil,640,360)
BG.resize(w,h) BG.resize(w,h)
SHADER.warning:send("w",w*scr.dpi) SHADER.warning:send("w",w*SCR.dpi)
SHADER.warning:send("h",h*scr.dpi) SHADER.warning:send("h",h*SCR.dpi)
end end
function love.focus(f) function love.focus(f)
if f then if f then
love.timer.step() love.timer.step()
elseif SCN.cur=="play"and setting.autoPause then elseif SCN.cur=="play"and SETTING.autoPause then
pauseGame() pauseGame()
end end
end end
@@ -373,7 +373,7 @@ function love.errorhandler(msg)
gc.captureScreenshot(_) gc.captureScreenshot(_)
gc.present() gc.present()
SFX.fplay("error",setting.voc*.8) SFX.fplay("error",SETTING.voc*.8)
local BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926} local BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
local needDraw=true local needDraw=true
@@ -415,7 +415,7 @@ function love.errorhandler(msg)
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)
gc.print(system.."-"..gameVersion,100,660) gc.print(SYSTEM.."-"..gameVersion,100,660)
gc.print("scene:"..SCN.cur,400,660) gc.print("scene:"..SCN.cur,400,660)
gc.printf(err[1],626,360,1260-626) gc.printf(err[1],626,360,1260-626)
gc.print("TRACEBACK",626,426) gc.print("TRACEBACK",626,426)
@@ -455,7 +455,7 @@ function love.run()
love.resize(gc.getWidth(),gc.getHeight()) love.resize(gc.getWidth(),gc.getHeight())
--Scene Launch --Scene Launch
if setting.appLock then if SETTING.appLock then
SCN.init("calculator") SCN.init("calculator")
else else
SCN.init("load") SCN.init("load")
@@ -492,7 +492,7 @@ function love.run()
--DRAW --DRAW
if not mini()then if not mini()then
FCT=FCT+setting.frameMul FCT=FCT+SETTING.frameMul
if FCT>=100 then if FCT>=100 then
FCT=FCT-100 FCT=FCT-100
gc.discard()--SPEED UPUPUP! gc.discard()--SPEED UPUPUP!
@@ -511,7 +511,7 @@ function love.run()
if mouseShow then if mouseShow then
local r=Timer()*.5 local r=Timer()*.5
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,scs[2*R],#blocks[R][0]-scs[2*R-1]) gc.draw(TEXTURE.miniBlock[R],mx,my,Timer()%3.1416*4,20,20,scs[2*R],#blocks[R][0]-scs[2*R-1])
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5) gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
@@ -523,8 +523,8 @@ function love.run()
--Draw power info. --Draw power info.
gc.setColor(1,1,1) gc.setColor(1,1,1)
if setting.powerInfo then if SETTING.powerInfo then
gc.draw(infoCanvas,0,0,0,scr.k) gc.draw(infoCanvas,0,0,0,SCR.k)
end end
--Draw scene swapping animation --Draw scene swapping animation
@@ -536,7 +536,7 @@ function love.run()
--Draw FPS --Draw FPS
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(15) setFont(15)
_=scr.h-20 _=SCR.h-20
gc.print(FPS(),5,_) gc.print(FPS(),5,_)
--Debug info. --Debug info.
@@ -564,11 +564,11 @@ function love.run()
--Fresh power info. --Fresh power info.
if Timer()-lastFreshPow>2 then if Timer()-lastFreshPow>2 then
if setting.powerInfo and loadingFinished then if SETTING.powerInfo and loadingFinished then
updatePowerInfo() updatePowerInfo()
lastFreshPow=Timer() lastFreshPow=Timer()
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

View File

@@ -26,7 +26,7 @@ end
function LOG.draw() function LOG.draw()
if debugMesList[1]then if debugMesList[1]then
gc.push("transform") gc.push("transform")
local k=scr.w/1280 local k=SCR.w/1280
setFont(int(20*k)) setFont(int(20*k))
for i=1,#debugMesList do for i=1,#debugMesList do
local M=debugMesList[i] local M=debugMesList[i]

View File

@@ -1,6 +1,6 @@
local gc=love.graphics local gc=love.graphics
local abs=math.abs local abs=math.abs
local scr=scr local SCR=SCR
sceneInit,sceneBack={},{} sceneInit,sceneBack={},{}
local sceneInit,sceneBack=sceneInit,sceneBack local sceneInit,sceneBack=sceneInit,sceneBack
@@ -54,35 +54,35 @@ local swap={
fade={30,15,function(t) fade={30,15,function(t)
local t=t>15 and 2-t/15 or t/15 local t=t>15 and 2-t/15 or t/15
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
end}, end},
fade_togame={120,20,function(t) fade_togame={120,20,function(t)
local t=t>20 and(120-t)/100 or t/20 local t=t>20 and(120-t)/100 or t/20
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
end}, end},
slowFade={180,90,function(t) slowFade={180,90,function(t)
local t=t>90 and 2-t/90 or t/90 local t=t>90 and 2-t/90 or t/90
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
end}, end},
swipeL={30,15,function(t) swipeL={30,15,function(t)
t=t/30 t=t/30
gc.setColor(.1,.1,.1,1-abs(t-.5)) gc.setColor(.1,.1,.1,1-abs(t-.5))
t=t*t*(3-2*t)*2-1 t=t*t*(3-2*t)*2-1
gc.rectangle("fill",t*scr.w,0,scr.w,scr.h) gc.rectangle("fill",t*SCR.w,0,SCR.w,SCR.h)
end}, end},
swipeR={30,15,function(t) swipeR={30,15,function(t)
t=t/30 t=t/30
gc.setColor(.1,.1,.1,1-abs(t-.5)) gc.setColor(.1,.1,.1,1-abs(t-.5))
t=t*t*(2*t-3)*2+1 t=t*t*(2*t-3)*2+1
gc.rectangle("fill",t*scr.w,0,scr.w,scr.h) gc.rectangle("fill",t*SCR.w,0,SCR.w,SCR.h)
end}, end},
swipeD={30,15,function(t) swipeD={30,15,function(t)
t=t/30 t=t/30
gc.setColor(.1,.1,.1,1-abs(t-.5)) gc.setColor(.1,.1,.1,1-abs(t-.5))
t=t*t*(2*t-3)*2+1 t=t*t*(2*t-3)*2+1
gc.rectangle("fill",0,t*scr.h,scr.w,scr.h) gc.rectangle("fill",0,t*SCR.h,SCR.w,SCR.h)
end}, end},
}--Scene swapping animations }--Scene swapping animations
function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back

View File

@@ -42,7 +42,7 @@ function SFX.fieldPlay(s,v,P)
SFX.play(s,v,(P.curX+P.sc[2]-5.5)*.15) SFX.play(s,v,(P.curX+P.sc[2]-5.5)*.15)
end end
function SFX.play(s,vol,pos) function SFX.play(s,vol,pos)
if setting.sfx==0 then return end if SETTING.sfx==0 then return end
local S=SFX.list[s]--Source list local S=SFX.list[s]--Source list
if not S then return end if not S then return end
local n=1 local n=1
@@ -57,13 +57,13 @@ function SFX.play(s,vol,pos)
S=S[n]--AU_SRC S=S[n]--AU_SRC
if S:getChannelCount()==1 then if S:getChannelCount()==1 then
if pos then if pos then
pos=pos*setting.stereo pos=pos*SETTING.stereo
S:setPosition(pos,1-pos^2,0) S:setPosition(pos,1-pos^2,0)
else else
S:setPosition(0,0,0) S:setPosition(0,0,0)
end end
end end
S:setVolume(((vol or 1)*setting.sfx)^1.626) S:setVolume(((vol or 1)*SETTING.sfx)^1.626)
S:play() S:play()
end end
function SFX.fplay(s,vol,pos) function SFX.fplay(s,vol,pos)
@@ -81,7 +81,7 @@ function SFX.fplay(s,vol,pos)
S=S[n]--AU_SRC S=S[n]--AU_SRC
if S:getChannelCount()==1 then if S:getChannelCount()==1 then
if pos then if pos then
pos=pos*setting.stereo pos=pos*SETTING.stereo
S:setPosition(pos,1-pos^2,0) S:setPosition(pos,1-pos^2,0)
else else
S:setPosition(0,0,0) S:setPosition(0,0,0)

View File

@@ -32,7 +32,7 @@ function FXupdate.attack(S,dt)
ins(L,S.x)ins(L,S.y) ins(L,S.x)ins(L,S.y)
end end
if #L==4+4*setting.atkFX then if #L==4+4*SETTING.atkFX then
rem(L,1)rem(L,1) rem(L,1)rem(L,1)
end end
return S.t>1 return S.t>1

View File

@@ -19,14 +19,14 @@ do--LOADLIB
} }
function LOADLIB(name) function LOADLIB(name)
local libName=libName[name] local libName=libName[name]
if system=="Windows"or system=="Linux"then if SYSTEM=="Windows"or SYSTEM=="Linux"then
local success,message=require(libName[system]) local success,message=require(libName[SYSTEM])
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
local platform={"arm64-v8a","armeabi-v7a"} local platform={"arm64-v8a","armeabi-v7a"}
local libFunc local libFunc
@@ -55,7 +55,7 @@ do--LOADLIB
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

View File

@@ -1,7 +1,7 @@
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 _=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]) _(level[L+t])
end end

View File

@@ -80,13 +80,13 @@ function VOC.update()
end end
elseif Q.s==1 then--Waiting load source elseif Q.s==1 then--Waiting load source
Q[1]=getVoice(Q[1]) Q[1]=getVoice(Q[1])
Q[1]:setVolume(setting.voc) Q[1]:setVolume(SETTING.voc)
Q[1]:play() Q[1]:play()
Q.s=Q[2]and 2 or 4 Q.s=Q[2]and 2 or 4
elseif Q.s==2 then--Playing 1,ready 2 elseif Q.s==2 then--Playing 1,ready 2
if Q[1]:getDuration()-Q[1]:tell()<.08 then if Q[1]:getDuration()-Q[1]:tell()<.08 then
Q[2]=getVoice(Q[2]) Q[2]=getVoice(Q[2])
Q[2]:setVolume(setting.voc) Q[2]:setVolume(SETTING.voc)
Q[2]:play() Q[2]:play()
Q.s=3 Q.s=3
end end
@@ -106,7 +106,7 @@ function VOC.update()
end end
end end
function VOC.play(s,chn) function VOC.play(s,chn)
if setting.voc>0 then if SETTING.voc>0 then
local _=VOC.list[s] local _=VOC.list[s]
if not _ then return end if not _ then return end
if chn then if chn then

View File

@@ -729,7 +729,7 @@ function WIDGET.press(x,y)
end end
end end
elseif W.type=="textBox"then elseif W.type=="textBox"then
if system=="Android"then if SYSTEM=="Android"then
local _,y=xOy:transformPoint(0,W.y+W.h) local _,y=xOy:transformPoint(0,W.y+W.h)
kb.setTextInput(true,0,y,1,1) kb.setTextInput(true,0,y,1,1)
end end

View File

@@ -1,6 +1,6 @@
local rnd=math.random local rnd=math.random
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local mobileHide=(system=="Android"or system=="iOS")and function()return true end local mobileHide=(SYSTEM=="Android"or SYSTEM=="iOS")and function()return true end
local function BACK()SCN.back()end local function BACK()SCN.back()end
local virtualkeySet={ local virtualkeySet={
{ {
@@ -95,9 +95,9 @@ local function CUSval(k) return function() return customEnv[k] end end
local function CUSrev(k) return function() customEnv[k]=not customEnv[k] end end local function CUSrev(k) return function() customEnv[k]=not customEnv[k] end end
local function CUSsto(k) return function(i) customEnv[k]=i end end local function CUSsto(k) return function(i) customEnv[k]=i end end
local function SETval(k) return function() return setting[k] end end local function SETval(k) return function() return SETTING[k] end end
local function SETrev(k) return function() setting[k]=not setting[k] end end local function SETrev(k) return function() SETTING[k]=not SETTING[k] end end
local function SETsto(k) return function(i) setting[k]=i end end local function SETsto(k) return function(i) SETTING[k]=i end end
local function STPval(k) return function() return sceneTemp[k] end end local function STPval(k) return function() return sceneTemp[k] end end
local function STPrev(k) return function() sceneTemp[k]=not sceneTemp[k] end end local function STPrev(k) return function() sceneTemp[k]=not sceneTemp[k] end end
@@ -113,7 +113,7 @@ local function VKAcode(n) return function() VK_org[n].ava=not VK_org[n].ava end
local function pressKey(k) return function() love.keypressed(k) end end local function pressKey(k) return function() love.keypressed(k) end end
local function setPen(i) return function() sceneTemp.pen=i end end local function setPen(i) return function() sceneTemp.pen=i end end
local function setLang(n) return function() LANG.set(n)setting.lang=n end end local function setLang(n) return function() LANG.set(n)SETTING.lang=n end end
local function goScene(t,s) return function() SCN.go(t,s) end end local function goScene(t,s) return function() SCN.go(t,s) end end
local function swapScene(t,s)return function() SCN.swapTo(t,s) end end local function swapScene(t,s)return function() SCN.swapTo(t,s) end end
@@ -157,7 +157,7 @@ local Widgets={
newButton({name="custom", x=590,y=270,w=200,h=160,color="lOrange",font=45,code=goScene("customGame"),hide=function()return not modeRanks.marathon_normal end}), newButton({name="custom", x=590,y=270,w=200,h=160,color="lOrange",font=45,code=goScene("customGame"),hide=function()return not modeRanks.marathon_normal end}),
newButton({name="help", x=150,y=450,w=200,h=160,color="lYellow",font=50,code=goScene("help")}), newButton({name="help", x=150,y=450,w=200,h=160,color="lYellow",font=50,code=goScene("help")}),
newButton({name="stat", x=370,y=450,w=200,h=160,color="lCyan", font=40,code=goScene("stat")}), newButton({name="stat", x=370,y=450,w=200,h=160,color="lCyan", font=40,code=goScene("stat")}),
newButton({name="qplay", x=590,y=450,w=200,h=160,color="lGreen", font=45,code=function()SCN.push()loadGame(stat.lastPlay,true)end}), newButton({name="qplay", x=590,y=450,w=200,h=160,color="lGreen", font=45,code=function()SCN.push()loadGame(STAT.lastPlay,true)end}),
newButton({name="lang", x=150,y=590,w=200,h=80,color="lGreen", font=45,code=goScene("setting_lang")}), newButton({name="lang", x=150,y=590,w=200,h=80,color="lGreen", font=45,code=goScene("setting_lang")}),
newButton({name="music", x=370,y=590,w=200,h=80,color="lPurple", font=30,code=goScene("music")}), newButton({name="music", x=370,y=590,w=200,h=80,color="lPurple", font=30,code=goScene("music")}),
newButton({name="quit", x=590,y=590,w=200,h=80,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}), newButton({name="quit", x=590,y=590,w=200,h=80,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}),
@@ -172,17 +172,17 @@ local Widgets={
newText({name="title", x=30, y=30,font=80,align="L"}), newText({name="title", x=30, y=30,font=80,align="L"}),
newText({name="arrow", x=270, y=360,font=45,align="L"}), newText({name="arrow", x=270, y=360,font=45,align="L"}),
newText({name="now", x=700, y=500,font=50,align="R",hide=function()return not BGM.nowPlay end}), newText({name="now", x=700, y=500,font=50,align="R",hide=function()return not BGM.nowPlay end}),
newSlider({name="bgm", x=760, y=80,w=400, font=35,disp=SETval("bgm"),code=function(v)setting.bgm=v BGM.freshVolume()end}), newSlider({name="bgm", x=760, y=80,w=400, font=35,disp=SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end}),
newButton({name="up", x=200, y=250,w=120, font=55,code=pressKey("up"),hide=function()return sceneTemp==1 end}), newButton({name="up", x=200, y=250,w=120, font=55,code=pressKey("up"),hide=function()return sceneTemp==1 end}),
newButton({name="play", x=200, y=390,w=120, font=35,code=pressKey("space"),hide=function()return setting.bgm==0 end}), newButton({name="play", x=200, y=390,w=120, font=35,code=pressKey("space"),hide=function()return SETTING.bgm==0 end}),
newButton({name="down", x=200, y=530,w=120, font=55,code=pressKey("down"),hide=function()return sceneTemp==BGM.len end}), newButton({name="down", x=200, y=530,w=120, font=55,code=pressKey("down"),hide=function()return sceneTemp==BGM.len end}),
newButton({name="back", x=1140, y=640,w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140, y=640,w=170,h=80, font=40,code=BACK}),
}, },
customGame={ customGame={
newText({name="title", x=600,y=5,font=80,align="R"}), newText({name="title", x=600,y=5,font=80,align="R"}),
newText({name="subTitle", x=610,y=50,font=35,align="L",color="grey"}), newText({name="subTitle", x=610,y=50,font=35,align="L",color="grey"}),
newText({name="defSeq", x=330,y=550,align="L",color="grey",hide=function()return preBag[1]end}), newText({name="defSeq", x=330,y=550,align="L",color="grey",hide=function()return BAG[1]end}),
newText({name="noMsn", x=610,y=550,align="L",color="grey",hide=function()return preMission[1]end}), newText({name="noMsn", x=610,y=550,align="L",color="grey",hide=function()return MISSION[1]end}),
--Basic --Basic
newSelector({name="drop", x=170, y=150,w=220,color="orange", list=CUSlist.drop, disp=CUSval("drop"),code=CUSsto("drop")}), newSelector({name="drop", x=170, y=150,w=220,color="orange", list=CUSlist.drop, disp=CUSval("drop"),code=CUSsto("drop")}),
@@ -317,7 +317,7 @@ local Widgets={
newKey({name="ten", x=1000, y=440, w=90, color="lGreen", font=40,code=pressKey("ten")}), newKey({name="ten", x=1000, y=440, w=90, color="lGreen", font=40,code=pressKey("ten")}),
newKey({name="backsp", x=1000, y=540, w=90, color="lYellow",font=50,code=pressKey("backspace")}), newKey({name="backsp", x=1000, y=540, w=90, color="lYellow",font=50,code=pressKey("backspace")}),
newKey({name="reset", x=1000, y=640, w=90, color="lYellow",font=50,code=pressKey("delete")}), newKey({name="reset", x=1000, y=640, w=90, color="lYellow",font=50,code=pressKey("delete")}),
newButton({name="copy", x=1140, y=440, w=170,h=80, color="lRed", font=40,code=pressKey("cC"),hide=function()return #preBag==0 end}), newButton({name="copy", x=1140, y=440, w=170,h=80, color="lRed", font=40,code=pressKey("cC"),hide=function()return #BAG==0 end}),
newButton({name="paste", x=1140, y=540, w=170,h=80, color="lBlue", font=40,code=pressKey("cV")}), newButton({name="paste", x=1140, y=540, w=170,h=80, color="lBlue", font=40,code=pressKey("cV")}),
newButton({name="back", x=1140, y=640, w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140, y=640, w=170,h=80, font=40,code=BACK}),
@@ -368,7 +368,7 @@ local Widgets={
newKey({name="ten", x=1000, y=440, w=90, color="lGreen", font=40,code=pressKey("ten")}), newKey({name="ten", x=1000, y=440, w=90, color="lGreen", font=40,code=pressKey("ten")}),
newKey({name="backsp", x=1000, y=540, w=90, color="lYellow",font=50,code=pressKey("backspace")}), newKey({name="backsp", x=1000, y=540, w=90, color="lYellow",font=50,code=pressKey("backspace")}),
newKey({name="reset", x=1000, y=640, w=90, color="lYellow",font=50,code=pressKey("delete")}), newKey({name="reset", x=1000, y=640, w=90, color="lYellow",font=50,code=pressKey("delete")}),
newButton({name="copy", x=1140, y=440, w=170,h=80, color="lRed", font=40,code=pressKey("cC"),hide=function()return #preMission==0 end}), newButton({name="copy", x=1140, y=440, w=170,h=80, color="lRed", font=40,code=pressKey("cC"),hide=function()return #MISSION==0 end}),
newButton({name="paste", x=1140, y=540, w=170,h=80, color="lBlue", font=40,code=pressKey("cV")}), newButton({name="paste", x=1140, y=540, w=170,h=80, color="lBlue", font=40,code=pressKey("cV")}),
newSwitch({name="mission", x=1150, y=350, disp=CUSval("missionKill"), code=CUSrev("missionKill")}), newSwitch({name="mission", x=1150, y=350, disp=CUSval("missionKill"), code=CUSrev("missionKill")}),
@@ -379,7 +379,7 @@ local Widgets={
}, },
pause={ pause={
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue", font=35,code=pressKey("s")}), newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue", font=35,code=pressKey("s")}),
newButton({name="replay", x=640, y=250, w=240,h=100,color="lYellow",font=30,code=pressKey("p"),hide=function()return not(game.result or game.replaying)or #players>1 end}), newButton({name="replay", x=640, y=250, w=240,h=100,color="lYellow",font=30,code=pressKey("p"),hide=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end}),
newButton({name="resume", x=640, y=367, w=240,h=100,color="lGreen", font=30,code=pressKey("escape")}), newButton({name="resume", x=640, y=367, w=240,h=100,color="lGreen", font=30,code=pressKey("escape")}),
newButton({name="restart", x=640, y=483, w=240,h=100,color="lRed", font=35,code=pressKey("r")}), newButton({name="restart", x=640, y=483, w=240,h=100,color="lRed", font=35,code=pressKey("r")}),
newButton({name="quit", x=640, y=600, w=240,h=100,font=35,code=BACK}), newButton({name="quit", x=640, y=600, w=240,h=100,font=35,code=BACK}),
@@ -398,9 +398,9 @@ local Widgets={
newButton({name="layout", x=460, y=540, w=140,h=70, font=35,code=goScene("setting_skin")}), newButton({name="layout", x=460, y=540, w=140,h=70, font=35,code=goScene("setting_skin")}),
newSwitch({name="autoPause",x=1080, y=320, font=20,disp=SETval("autoPause"), code=SETrev("autoPause")}), newSwitch({name="autoPause",x=1080, y=320, font=20,disp=SETval("autoPause"), code=SETrev("autoPause")}),
newSwitch({name="swap", x=1080, y=380, font=20,disp=SETval("swap"), code=SETrev("swap")}), newSwitch({name="swap", x=1080, y=380, font=20,disp=SETval("swap"), code=SETrev("swap")}),
newSwitch({name="fine", x=1080, y=440, font=20,disp=SETval("fine"), code=function()setting.fine=not setting.fine if setting.fine then SFX.play("finesseError",.6) end end}), newSwitch({name="fine", x=1080, y=440, font=20,disp=SETval("fine"), code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play("finesseError",.6) end end}),
newSwitch({name="appLock", x=1080, y=500, font=20,disp=SETval("appLock"), code=SETrev("appLock")}), newSwitch({name="appLock", x=1080, y=500, font=20,disp=SETval("appLock"), code=SETrev("appLock")}),
newButton({name="calc", x=970, y=550, w=150,h=60,color="dGrey", font=25,code=goScene("calculator"),hide=function()return not setting.appLock end}), newButton({name="calc", x=970, y=550, w=150,h=60,color="dGrey", font=25,code=goScene("calculator"),hide=function()return not SETTING.appLock end}),
newButton({name="back", x=1140, y=640, w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140, y=640, w=170,h=80, font=40,code=BACK}),
}, },
setting_video={ setting_video={
@@ -425,10 +425,10 @@ local Widgets={
newSlider({name="atkFX", x=350, y=600,w=373,unit=5, disp=SETval("atkFX"), code=SETsto("atkFX")}), newSlider({name="atkFX", x=350, y=600,w=373,unit=5, disp=SETval("atkFX"), code=SETsto("atkFX")}),
newSlider({name="frame", x=350, y=650,w=373,unit=10, newSlider({name="frame", x=350, y=650,w=373,unit=10,
disp=function() disp=function()
return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 return SETTING.frameMul>35 and SETTING.frameMul/10 or SETTING.frameMul/5-4
end, end,
code=function(i) code=function(i)
setting.frameMul=i<5 and 5*i+20 or 10*i SETTING.frameMul=i<5 and 5*i+20 or 10*i
end}), end}),
newSwitch({name="text", x=1100, y=180,font=35,disp=SETval("text"),code=SETrev("text")}), newSwitch({name="text", x=1100, y=180,font=35,disp=SETval("text"),code=SETrev("text")}),
@@ -438,19 +438,19 @@ local Widgets={
newSwitch({name="nextPos", x=1100, y=420,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")}), newSwitch({name="nextPos", x=1100, y=420,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")}),
newSwitch({name="fullscreen",x=1100,y=480,disp=SETval("fullscreen"), newSwitch({name="fullscreen",x=1100,y=480,disp=SETval("fullscreen"),
code=function() code=function()
setting.fullscreen=not setting.fullscreen SETTING.fullscreen=not SETTING.fullscreen
love.window.setFullscreen(setting.fullscreen) love.window.setFullscreen(SETTING.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight()) love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end}), end}),
newSwitch({name="bg", x=1100, y=540,font=35,disp=SETval("bg"), newSwitch({name="bg", x=1100, y=540,font=35,disp=SETval("bg"),
code=function() code=function()
BG.set("none") BG.set("none")
setting.bg=not setting.bg SETTING.bg=not SETTING.bg
BG.set("space") BG.set("space")
end}), end}),
newSwitch({name="power", x=990, y=640,font=35,disp=SETval("powerInfo"), newSwitch({name="power", x=990, y=640,font=35,disp=SETval("powerInfo"),
code=function() code=function()
setting.powerInfo=not setting.powerInfo SETTING.powerInfo=not SETTING.powerInfo
end}), end}),
newButton({name="back", x=1140, y=640,w=170,h=80, font=40,code=BACK}), newButton({name="back", x=1140, y=640,w=170,h=80, font=40,code=BACK}),
}, },
@@ -461,8 +461,8 @@ local Widgets={
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan", font=35,code=swapScene("setting_video","swipeL")}), newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan", font=35,code=swapScene("setting_video","swipeL")}),
newSlider({name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}), newSlider({name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
newSlider({name="stereo", x=180, y=500,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=SETval("stereo"),code=SETsto("stereo"),hide=function()return setting.sfx==0 end}), newSlider({name="stereo", x=180, y=500,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=SETval("stereo"),code=SETsto("stereo"),hide=function()return SETTING.sfx==0 end}),
newSlider({name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..rnd(7),setting.spawn)end,disp=SETval("spawn"), code=SETsto("spawn")}), newSlider({name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..rnd(7),SETTING.spawn)end,disp=SETval("spawn"), code=SETsto("spawn")}),
newSlider({name="bgm", x=180, y=400,w=400, font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}), newSlider({name="bgm", x=180, y=400,w=400, font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
newSlider({name="vib", x=750, y=200,w=400, unit=5, font=25,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}), newSlider({name="vib", x=750, y=200,w=400, unit=5, font=25,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
newSlider({name="voc", x=750, y=300,w=400, font=35,change=function()VOC.play("test")end, disp=SETval("voc"), code=SETsto("voc")}), newSlider({name="voc", x=750, y=300,w=400, font=35,change=function()VOC.play("test")end, disp=SETval("voc"), code=SETsto("voc")}),
@@ -481,7 +481,7 @@ local Widgets={
newSwitch({name="ims", x=1100, y=470, disp=SETval("ims"), code=SETrev("ims")}), newSwitch({name="ims", x=1100, y=470, disp=SETval("ims"), code=SETrev("ims")}),
newButton({name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40, newButton({name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40,
code=function() code=function()
local _=setting local _=SETTING
_.das,_.arr=10,2 _.das,_.arr=10,2
_.sddas,_.sdarr=0,2 _.sddas,_.sdarr=0,2
_.ihs,_.irs,_.ims=false,false,false _.ihs,_.irs,_.ims=false,false,false
@@ -527,13 +527,13 @@ local Widgets={
newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35, newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35,
code=function() code=function()
setting.skin={1,5,8,2,10,3,7,1,5,5,1,8,2,10,3,7,10,7,8,2,8,2,1,5,3} SETTING.skin={1,5,8,2,10,3,7,1,5,5,1,8,2,10,3,7,10,7,8,2,8,2,1,5,3}
SFX.play("rotate") SFX.play("rotate")
end}), end}),
newButton({name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35, newButton({name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35,
code=function() code=function()
for i=1,25 do for i=1,25 do
setting.face[i]=0 SETTING.face[i]=0
end end
SFX.play("hold") SFX.play("hold")
end}), end}),
@@ -606,23 +606,23 @@ local Widgets={
newButton({name="pro", x=1120, y=100, w=240,h=80, font=35,code=function()for i=1,20 do VK_org[i].ava=true end end}), newButton({name="pro", x=1120, y=100, w=240,h=80, font=35,code=function()for i=1,20 do VK_org[i].ava=true end end}),
newSwitch({name="hide", x=1170, y=200, font=40,disp=SETval("VKSwitch"),code=SETrev("VKSwitch")}), newSwitch({name="hide", x=1170, y=200, font=40,disp=SETval("VKSwitch"),code=SETrev("VKSwitch")}),
newSwitch({name="track", x=1170, y=300, font=35,disp=SETval("VKTrack"),code=SETrev("VKTrack")}), newSwitch({name="track", x=1170, y=300, font=35,disp=SETval("VKTrack"),code=SETrev("VKTrack")}),
newSlider({name="sfx", x=800, y=380, w=180, font=35,change=function()SFX.play("virtualKey",setting.VKSFX)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}), newSlider({name="sfx", x=800, y=380, w=180, font=35,change=function()SFX.play("virtualKey",SETTING.VKSFX)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}),
newSlider({name="vib", x=800, y=460, w=180,unit=2, font=35,change=function()VIB(setting.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}), newSlider({name="vib", x=800, y=460, w=180,unit=2, font=35,change=function()VIB(SETTING.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}),
newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}), newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}),
newButton({name="tkset", x=1120, y=420, w=240,h=80, newButton({name="tkset", x=1120, y=420, w=240,h=80,
code=function() code=function()
SCN.go("setting_trackSetting") SCN.go("setting_trackSetting")
end, end,
hide=function() hide=function()
return not setting.VKTrack return not SETTING.VKTrack
end}), end}),
newSlider({name="alpha", x=840, y=540, w=400,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}), newSlider({name="alpha", x=840, y=540, w=400,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}),
newButton({name="back", x=1140, y=640, w=170,h=80,font=40,code=BACK}), newButton({name="back", x=1140, y=640, w=170,h=80,font=40,code=BACK}),
}, },
setting_trackSetting={ setting_trackSetting={
newSwitch({name="VKDodge", x=400, y=200, font=35, disp=SETval("VKDodge"),code=SETrev("VKDodge")}), newSwitch({name="VKDodge", x=400, y=200, font=35, disp=SETval("VKDodge"),code=SETrev("VKDodge")}),
newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i setting.VKCurW=math.max(setting.VKCurW,i)end}), newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)SETTING.VKTchW=i SETTING.VKCurW=math.max(SETTING.VKCurW,i)end}),
newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i setting.VKTchW=math.min(setting.VKTchW,i)end}), newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)SETTING.VKCurW=i SETTING.VKTchW=math.min(SETTING.VKTchW,i)end}),
newButton({name="back", x=1140, y=640, w=170,h=80,font=40,code=BACK}), newButton({name="back", x=1140, y=640, w=170,h=80,font=40,code=BACK}),
}, },
setting_lang={ setting_lang={
@@ -696,12 +696,12 @@ local Widgets={
debug={ debug={
newButton({name="scrInfo", x=300,y=120,w=300,h=100,color="green",code=function() newButton({name="scrInfo", x=300,y=120,w=300,h=100,color="green",code=function()
LOG.print("Screen Info:") LOG.print("Screen Info:")
LOG.print("x y: "..scr.x.." "..scr.y) LOG.print("x y: "..SCR.x.." "..SCR.y)
LOG.print("w h: "..scr.w.." "..scr.h) LOG.print("w h: "..SCR.w.." "..SCR.h)
LOG.print("W H: "..scr.W.." "..scr.H) LOG.print("W H: "..SCR.W.." "..SCR.H)
LOG.print("k: "..math.floor(scr.k*100)*.01) LOG.print("k: "..math.floor(SCR.k*100)*.01)
LOG.print("rad: "..math.floor(scr.rad*100)*.01) LOG.print("rad: "..math.floor(SCR.rad*100)*.01)
LOG.print("dpi: "..scr.dpi) LOG.print("dpi: "..SCR.dpi)
end}), end}),
newButton({name="reset", x=640,y=380,w=240,h=100,color="orange", font=40, newButton({name="reset", x=640,y=380,w=240,h=100,color="orange", font=40,
code=function()sceneTemp.reset=true end, code=function()sceneTemp.reset=true end,

View File

@@ -11,6 +11,7 @@
--? --?
function NULL()end function NULL()end
DBP=print--use this if need debugging print DBP=print--use this if need debugging print
SYSTEM=love.system.getOS()
MARKING=true MARKING=true
LOADED=false LOADED=false
NOGAME=false NOGAME=false
@@ -21,8 +22,7 @@ math.randomseed(os.time()*626)
love.keyboard.setKeyRepeat(true) love.keyboard.setKeyRepeat(true)
love.mouse.setVisible(false) love.mouse.setVisible(false)
system=love.system.getOS() SCR={
scr={
x=0,y=0,--Up-left Coord on screen x=0,y=0,--Up-left Coord on screen
w=0,h=0,--Fullscreen w/h in gc w=0,h=0,--Fullscreen w/h in gc
W=0,H=0,--Fullscreen w/h in shader W=0,H=0,--Fullscreen w/h in shader
@@ -72,11 +72,11 @@ customEnv={
bg="none", bg="none",
bgm="race" bgm="race"
} }
preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end--Field for custom game FIELD={h=20}for i=1,20 do FIELD[i]={0,0,0,0,0,0,0,0,0,0}end--Field for custom game
preBag={}--Sequence for custom game BAG={}--Sequence for custom game
preMission={}--Clearing target for custom game MISSION={}--Clearing mission for custom game
game={ GAME={
frame=0, --Frame count frame=0, --Frame count
result=false, --Game result (string) result=false, --Game result (string)
pauseTime=0, --Time paused pauseTime=0, --Time paused
@@ -97,13 +97,13 @@ game={
mostDangerous=nil, --Most dangerous player mostDangerous=nil, --Most dangerous player
secDangerous=nil, --Second dangerous player secDangerous=nil, --Second dangerous player
}--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 --blockSkin,blockSkinMini={},{}--Redefined in SKIN.change
require("Zframework")--Load Zframework
--Load modules --Load modules
require("Zframework")--Load Zframework
blocks= require("parts/mino") blocks= require("parts/mino")
AITemplate= require("parts/AITemplate") AITemplate= require("parts/AITemplate")
freeRow= require("parts/freeRow") freeRow= require("parts/freeRow")
@@ -132,18 +132,18 @@ if fs.getInfo("settings.dat")then
FILE.loadSetting() FILE.loadSetting()
else else
-- firstRun=true -- firstRun=true
if system=="Android"or system=="iOS" then if SYSTEM=="Android"or SYSTEM=="iOS" then
setting.VKSwitch=true SETTING.VKSwitch=true
setting.swap=false SETTING.swap=false
setting.vib=2 SETTING.vib=2
setting.powerInfo=true SETTING.powerInfo=true
setting.fullscreen=true SETTING.fullscreen=true
love.window.setFullscreen(true) love.window.setFullscreen(true)
love.resize(love.graphics.getWidth(),love.graphics.getHeight()) love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end end
end end
LANG.set(setting.lang) LANG.set(SETTING.lang)
if setting.fullscreen then love.window.setFullscreen(true)end if SETTING.fullscreen then love.window.setFullscreen(true)end
if fs.getInfo("unlock.dat")then FILE.loadUnlock()end if fs.getInfo("unlock.dat")then FILE.loadUnlock()end
if fs.getInfo("data.dat")then FILE.loadData()end if fs.getInfo("data.dat")then FILE.loadData()end
@@ -172,12 +172,12 @@ do
R.tech_finesse2=R["tech_finesse+"] R.tech_finesse2=R["tech_finesse+"]
R["tech_normal+"],R["tech_hard+"],R["tech_lunatic+"],R["tech_finesse+"]=nil R["tech_normal+"],R["tech_hard+"],R["tech_lunatic+"],R["tech_finesse+"]=nil
end end
if not text.modes[stat.lastPlay]then if not text.modes[STAT.lastPlay]then
stat.lastPlay="sprint_10" STAT.lastPlay="sprint_10"
end end
--Check setting file --Check setting file
local S=setting local S=SETTING
if if
type(S.block)~="boolean"or type(S.block)~="boolean"or
type(S.spawn)~="number"or type(S.spawn)~="number"or
@@ -191,7 +191,7 @@ do
end end
--Update data file --Update data file
S=stat S=STAT
if not S.spin[1][6]then if not S.spin[1][6]then
for i=1,25 do for i=1,25 do
S.spin[i][6]=0 S.spin[i][6]=0
@@ -210,7 +210,7 @@ do
FILE.saveData() FILE.saveData()
FILE.saveSetting() FILE.saveSetting()
end end
if system=="Android"and not setting.fullscreen then if SYSTEM=="Android"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

View File

@@ -36,7 +36,7 @@ return{
slowMark=true, slowMark=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
players[1].modeData.event="M7" PLAYERS[1].modeData.event="M7"
end, end,
mesDisp=function(P) mesDisp=function(P)
mText(drawableText.line,69,370) mText(drawableText.line,69,370)

View File

@@ -17,17 +17,17 @@ return{
pauseLimit=true, pauseLimit=true,
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)
if not game.result then if not GAME.result then
if game.replaying then if GAME.replaying then
gc.setColor(.3,.3,.3,.7) gc.setColor(.3,.3,.3,.7)
gc.push("transform") gc.push("transform")
gc.origin() gc.origin()
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.pop() gc.pop()
else else
gc.clear(.26,.26,.26) gc.clear(.26,.26,.26)

View File

@@ -28,7 +28,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
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)

View File

@@ -26,7 +26,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
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)

View File

@@ -9,13 +9,13 @@ return{
for k,v in next,customEnv do for k,v in next,customEnv do
modeEnv[k]=v modeEnv[k]=v
end end
if preBag[1]then if BAG[1]then
modeEnv.bag=preBag modeEnv.bag=BAG
else else
modeEnv.bag=nil modeEnv.bag=nil
end end
if preMission[1]then if MISSION[1]then
modeEnv.mission=preMission modeEnv.mission=MISSION
else else
modeEnv.mission=nil modeEnv.mission=nil
end end
@@ -29,24 +29,24 @@ return{
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,AITemplate("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L))
end end
end end
preField.h=20 FIELD.h=20
repeat repeat
for i=1,10 do for i=1,10 do
if preField[preField.h][i]>0 then if FIELD[FIELD.h][i]>0 then
goto L goto L
end end
end end
preField.h=preField.h-1 FIELD.h=FIELD.h-1
until preField.h==0 until FIELD.h==0
::L:: ::L::
for _,P in next,players.alive do for _,P in next,PLAYERS.alive do
local t=P.showTime*3 local t=P.showTime*3
for y=1,preField.h do for y=1,FIELD.h do
P.field[y]=freeRow.get(0) P.field[y]=freeRow.get(0)
P.visTime[y]=freeRow.get(t) P.visTime[y]=freeRow.get(t)
for x=1,10 do P.field[y][x]=preField[y][x]end for x=1,10 do P.field[y][x]=FIELD[y][x]end
end end
P.garbageBeneath=preField.h P.garbageBeneath=FIELD.h
end end
modeEnv.bg=customEnv.bg modeEnv.bg=customEnv.bg
modeEnv.bgm=customEnv.bgm modeEnv.bgm=customEnv.bgm

View File

@@ -4,7 +4,7 @@ local function puzzleCheck(P)
for y=1,20 do for y=1,20 do
local L=P.field[y] local L=P.field[y]
for x=1,10 do for x=1,10 do
local a,b=preField[y][x],L and L[x]or 0 local a,b=FIELD[y][x],L and L[x]or 0
if a~=0 then if a~=0 then
if a==-1 then if b>0 then return end if a==-1 then if b>0 then return end
elseif a<12 then if a~=b then return end elseif a<12 then if a~=b then return end
@@ -27,13 +27,13 @@ return{
for k,v in next,customEnv do for k,v in next,customEnv do
modeEnv[k]=v modeEnv[k]=v
end end
if preBag[1]then if BAG[1]then
modeEnv.bag=preBag modeEnv.bag=BAG
else else
modeEnv.bag=nil modeEnv.bag=nil
end end
if preMission[1]then if MISSION[1]then
modeEnv.mission=preMission modeEnv.mission=MISSION
else else
modeEnv.mission=nil modeEnv.mission=nil
end end
@@ -47,15 +47,15 @@ return{
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,AITemplate("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L))
end end
end end
preField.h=20 FIELD.h=20
repeat repeat
for i=1,10 do for i=1,10 do
if preField[preField.h][i]~=0 then if FIELD[FIELD.h][i]~=0 then
goto L goto L
end end
end end
preField.h=preField.h-1 FIELD.h=FIELD.h-1
until preField.h==0 until FIELD.h==0
::L:: ::L::
modeEnv.bg=customEnv.bg modeEnv.bg=customEnv.bg
modeEnv.bgm=customEnv.bgm modeEnv.bgm=customEnv.bgm
@@ -67,8 +67,8 @@ return{
mText(drawableText.line,69,360) mText(drawableText.line,69,360)
if P.modeData.event==0 then if P.modeData.event==0 then
local m=puzzleMark local m=puzzleMark
for y=1,preField.h do for x=1,10 do for y=1,FIELD.h do for x=1,10 do
local T=preField[y][x] local T=FIELD[y][x]
if T~=0 then if T~=0 then
gc.draw(m[T],150+30*x-30+dx,70+600-30*y+dy) gc.draw(m[T],150+30*x-30+dx,70+600-30*y+dy)
end end

View File

@@ -13,7 +13,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
local P=players[1] local P=PLAYERS[1]
for _=1,10 do for _=1,10 do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end

View File

@@ -16,7 +16,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
local P=players[1] local P=PLAYERS[1]
for _=1,10 do for _=1,10 do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end

View File

@@ -16,7 +16,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
local P=players[1] local P=PLAYERS[1]
for _=1,10 do for _=1,10 do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end

View File

@@ -16,7 +16,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
local P=players[1] local P=PLAYERS[1]
for _=1,10 do for _=1,10 do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end

View File

@@ -37,7 +37,7 @@ return{
}, },
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
local P=players[1] local P=PLAYERS[1]
for _=1,8 do for _=1,8 do
P:garbageRise(13,1,P:RND(10)) P:garbageRise(13,1,P:RND(10))
end end

View File

@@ -63,7 +63,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
newPC(players[1]) newPC(PLAYERS[1])
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(75) setFont(75)

View File

@@ -54,7 +54,7 @@ return{
pauseLimit=true, pauseLimit=true,
load=function() load=function()
PLY.newPlayer(1,340,15) PLY.newPlayer(1,340,15)
newPC(players[1]) newPC(PLAYERS[1])
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(75) setFont(75)

View File

@@ -1,12 +1,12 @@
local function update_round(P) local function update_round(P)
if #players.alive>1 then if #PLAYERS.alive>1 then
P.control=false P.control=false
local ID=P.id local ID=P.id
repeat repeat
ID=ID+1 ID=ID+1
if not players[ID]then ID=1 end if not PLAYERS[ID]then ID=1 end
until players[ID].alive or ID==P.id until PLAYERS[ID].alive or ID==P.id
players[ID].control=true PLAYERS[ID].control=true
end end
end end
@@ -21,7 +21,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,AITemplate("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,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,

View File

@@ -1,12 +1,12 @@
local function update_round(P) local function update_round(P)
if #players.alive>1 then if #PLAYERS.alive>1 then
P.control=false P.control=false
local ID=P.id local ID=P.id
repeat repeat
ID=ID+1 ID=ID+1
if not players[ID]then ID=1 end if not PLAYERS[ID]then ID=1 end
until players[ID].alive or ID==P.id until PLAYERS[ID].alive or ID==P.id
players[ID].control=true PLAYERS[ID].control=true
end end
end end
@@ -21,7 +21,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,AITemplate("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,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,

View File

@@ -1,12 +1,12 @@
local function update_round(P) local function update_round(P)
if #players.alive>1 then if #PLAYERS.alive>1 then
P.control=false P.control=false
local ID=P.id local ID=P.id
repeat repeat
ID=ID+1 ID=ID+1
if not players[ID]then ID=1 end if not PLAYERS[ID]then ID=1 end
until players[ID].alive or ID==P.id until PLAYERS[ID].alive or ID==P.id
players[ID].control=true PLAYERS[ID].control=true
end end
end end
@@ -21,7 +21,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,AITemplate("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,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,

View File

@@ -1,12 +1,12 @@
local function update_round(P) local function update_round(P)
if #players.alive>1 then if #PLAYERS.alive>1 then
P.control=false P.control=false
local ID=P.id local ID=P.id
repeat repeat
ID=ID+1 ID=ID+1
if not players[ID]then ID=1 end if not PLAYERS[ID]then ID=1 end
until players[ID].alive or ID==P.id until PLAYERS[ID].alive or ID==P.id
players[ID].control=true PLAYERS[ID].control=true
end end
end end
@@ -21,7 +21,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,AITemplate("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,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,

View File

@@ -1,12 +1,12 @@
local function update_round(P) local function update_round(P)
if #players.alive>1 then if #PLAYERS.alive>1 then
P.control=false P.control=false
local ID=P.id local ID=P.id
repeat repeat
ID=ID+1 ID=ID+1
if not players[ID]then ID=1 end if not PLAYERS[ID]then ID=1 end
until players[ID].alive or ID==P.id until PLAYERS[ID].alive or ID==P.id
players[ID].control=true PLAYERS[ID].control=true
end end
end end
@@ -21,7 +21,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,AITemplate("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,
scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end,

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if setting.swap then if SETTING.swap then
for i=1,#P.keyPressing do for i=1,#P.keyPressing do
if P.keyPressing[i]then if P.keyPressing[i]then
P.keyPressing[i]=false P.keyPressing[i]=false
@@ -58,7 +58,7 @@ return{
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(35) setFont(35)
mStr(#players.alive.."/49",69,245) mStr(#PLAYERS.alive.."/49",69,245)
mStr(P.modeData.point,80,285) mStr(P.modeData.point,80,285)
gc.draw(drawableText.ko,23,295) gc.draw(drawableText.ko,23,295)
setFont(20) setFont(20)

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if setting.swap then if SETTING.swap then
for i=1,#P.keyPressing do for i=1,#P.keyPressing do
if P.keyPressing[i]then if P.keyPressing[i]then
P.keyPressing[i]=false P.keyPressing[i]=false
@@ -58,7 +58,7 @@ return{
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(35) setFont(35)
mStr(#players.alive.."/49",69,245) mStr(#PLAYERS.alive.."/49",69,245)
mStr(P.modeData.point,80,285) mStr(P.modeData.point,80,285)
gc.draw(drawableText.ko,23,295) gc.draw(drawableText.ko,23,295)
setFont(20) setFont(20)

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if setting.swap then if SETTING.swap then
for i=1,#P.keyPressing do for i=1,#P.keyPressing do
if P.keyPressing[i]then if P.keyPressing[i]then
P.keyPressing[i]=false P.keyPressing[i]=false
@@ -58,7 +58,7 @@ return{
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(35) setFont(35)
mStr(#players.alive.."/49",69,245) mStr(#PLAYERS.alive.."/49",69,245)
mStr(P.modeData.point,80,285) mStr(P.modeData.point,80,285)
gc.draw(drawableText.ko,23,295) gc.draw(drawableText.ko,23,295)
setFont(20) setFont(20)

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if setting.swap then if SETTING.swap then
for i=1,#P.keyPressing do for i=1,#P.keyPressing do
if P.keyPressing[i]then if P.keyPressing[i]then
P.keyPressing[i]=false P.keyPressing[i]=false
@@ -58,7 +58,7 @@ return{
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(35) setFont(35)
mStr(#players.alive.."/99",69,245) mStr(#PLAYERS.alive.."/99",69,245)
mStr(P.modeData.point,80,285) mStr(P.modeData.point,80,285)
gc.draw(drawableText.ko,23,295) gc.draw(drawableText.ko,23,295)
setFont(20) setFont(20)

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if setting.swap then if SETTING.swap then
for i=1,#P.keyPressing do for i=1,#P.keyPressing do
if P.keyPressing[i]then if P.keyPressing[i]then
P.keyPressing[i]=false P.keyPressing[i]=false
@@ -58,7 +58,7 @@ return{
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(35) setFont(35)
mStr(#players.alive.."/99",69,245) mStr(#PLAYERS.alive.."/99",69,245)
mStr(P.modeData.point,80,285) mStr(P.modeData.point,80,285)
gc.draw(drawableText.ko,23,295) gc.draw(drawableText.ko,23,295)
setFont(20) setFont(20)

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local int,rnd=math.floor,math.random local int,rnd=math.floor,math.random
local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",}
local function selectTarget(P) local function selectTarget(P)
if setting.swap then if SETTING.swap then
for i=1,#P.keyPressing do for i=1,#P.keyPressing do
if P.keyPressing[i]then if P.keyPressing[i]then
P.keyPressing[i]=false P.keyPressing[i]=false
@@ -58,7 +58,7 @@ return{
end, end,
mesDisp=function(P) mesDisp=function(P)
setFont(35) setFont(35)
mStr(#players.alive.."/99",69,245) mStr(#PLAYERS.alive.."/99",69,245)
mStr(P.modeData.point,80,285) mStr(P.modeData.point,80,285)
gc.draw(drawableText.ko,23,295) gc.draw(drawableText.ko,23,295)
setFont(20) setFont(20)

View File

@@ -1,4 +1,4 @@
setting={ SETTING={
--Game --Game
das=10,arr=2, das=10,arr=2,
sddas=0,sdarr=2, sddas=0,sdarr=2,
@@ -57,10 +57,10 @@ setting={
VKAlpha=.3, VKAlpha=.3,
} }
for i=1,25 do for i=1,25 do
setting.face[i]=0 SETTING.face[i]=0
end end
stat={ STAT={
version=gameVersion, version=gameVersion,
run=0,game=0,time=0, run=0,game=0,time=0,
key=0,rotate=0,hold=0, key=0,rotate=0,hold=0,
@@ -73,8 +73,8 @@ stat={
lastPlay="sprint_10",--Last played mode ID lastPlay="sprint_10",--Last played mode ID
} }
for i=1,25 do for i=1,25 do
stat.clear[i]={0,0,0,0,0} STAT.clear[i]={0,0,0,0,0}
stat.spin[i]={0,0,0,0,0,0} STAT.spin[i]={0,0,0,0,0,0}
end end
keyMap={ keyMap={

View File

@@ -17,17 +17,17 @@ local default_setting={
local function copyGameSetting() local function copyGameSetting()
local S={face={}} local S={face={}}
for _,v in next,default_setting do for _,v in next,default_setting do
S[v]=setting[v] S[v]=SETTING[v]
end end
for i=1,25 do for i=1,25 do
S.face[i]=setting.face[i] S.face[i]=SETTING.face[i]
end end
return S return S
end end
function destroyPlayers() function destroyPlayers()
for i=#players,1,-1 do for i=#PLAYERS,1,-1 do
local P=players[i] local P=PLAYERS[i]
if P.canvas then P.canvas:release()end if P.canvas then P.canvas:release()end
while P.field[1]do while P.field[1]do
freeRow.discard(rem(P.field)) freeRow.discard(rem(P.field))
@@ -39,10 +39,10 @@ function destroyPlayers()
CC.destroy(P.AI_bot) CC.destroy(P.AI_bot)
P.AI_mode=nil P.AI_mode=nil
end end
players[i]=nil PLAYERS[i]=nil
end end
for i=#players.alive,1,-1 do for i=#PLAYERS.alive,1,-1 do
players.alive[i]=nil PLAYERS.alive[i]=nil
end end
collectgarbage() collectgarbage()
end end
@@ -89,13 +89,13 @@ end
Example: "abcdefg" is [SZJLTOI], "a^aDb)" is [Z*63,Z*37,S*10] Example: "abcdefg" is [SZJLTOI], "a^aDb)" is [Z*63,Z*37,S*10]
]] ]]
function copySequence() function copySequence()
local preBag=preBag local BAG=BAG
local str="" local str=""
local count=1 local count=1
for i=1,#preBag+1 do for i=1,#BAG+1 do
if preBag[i+1]~=preBag[i]or count==64 then if BAG[i+1]~=BAG[i]or count==64 then
str=str..char(96+preBag[i]) str=str..char(96+BAG[i])
if count>1 then if count>1 then
str=str..char(32+count) str=str..char(32+count)
count=1 count=1
@@ -136,7 +136,7 @@ function pasteSequence(str)
ins(bag,reg) ins(bag,reg)
end end
preBag=bag BAG=bag
sceneTemp.cur=#bag sceneTemp.cur=#bag
return true return true
end end
@@ -147,7 +147,7 @@ function copyBoard()
for y=20,1,-1 do for y=20,1,-1 do
for x=1,10 do for x=1,10 do
if preField[y][x]~=0 then if FIELD[y][x]~=0 then
H=y H=y
goto topFound goto topFound
end end
@@ -158,7 +158,7 @@ function copyBoard()
--Encode field --Encode field
for y=1,H do for y=1,H do
local S="" local S=""
local L=preField[y] local L=FIELD[y]
for x=1,10 do for x=1,10 do
S=S..char(L[x]+1) S=S..char(L[x]+1)
end end
@@ -193,7 +193,7 @@ function pasteBoard(str)
if __>17 then return end--Illegal blockid if __>17 then return end--Illegal blockid
_=int(_/32)--Mode id _=int(_/32)--Mode id
preField[fY][fX]=__ FIELD[fY][fX]=__
if fX<10 then if fX<10 then
fX=fX+1 fX=fX+1
else else
@@ -206,7 +206,7 @@ function pasteBoard(str)
for y=fY,20 do for y=fY,20 do
for x=1,10 do for x=1,10 do
preField[y][x]=0 FIELD[y][x]=0
end end
end end
@@ -231,13 +231,13 @@ end
]] ]]
function copyMission() function copyMission()
local _ local _
local preMission=preMission local MISSION=MISSION
local str="" local str=""
local count=1 local count=1
for i=1,#preMission+1 do for i=1,#MISSION+1 do
if preMission[i+1]~=preMission[i]or count==13 then if MISSION[i+1]~=MISSION[i]or count==13 then
_=33+preMission[i] _=33+MISSION[i]
str=str..char(_) str=str..char(_)
if count>1 then if count>1 then
str=str..char(113+count) str=str..char(113+count)
@@ -282,7 +282,7 @@ function pasteMission(str)
ins(mission,reg) ins(mission,reg)
end end
preMission=mission MISSION=mission
sceneTemp.cur=#mission sceneTemp.cur=#mission
return true return true
end end
@@ -302,84 +302,84 @@ function mergeStat(stat,delta)
end end
function randomTarget(P)--Return a random opponent for P function randomTarget(P)--Return a random opponent for P
if #players.alive>1 then if #PLAYERS.alive>1 then
local R local R
repeat repeat
R=players.alive[rnd(#players.alive)] R=PLAYERS.alive[rnd(#PLAYERS.alive)]
until R~=P until R~=P
return R return R
end end
end end
function freshMostDangerous() function freshMostDangerous()
game.mostDangerous,game.secDangerous=nil GAME.mostDangerous,GAME.secDangerous=nil
local m,m2=0,0 local m,m2=0,0
for i=1,#players.alive do for i=1,#PLAYERS.alive do
local h=#players.alive[i].field local h=#PLAYERS.alive[i].field
if h>=m then if h>=m then
game.mostDangerous,game.secDangerous=players.alive[i],game.mostDangerous GAME.mostDangerous,GAME.secDangerous=PLAYERS.alive[i],GAME.mostDangerous
m,m2=h,m m,m2=h,m
elseif h>=m2 then elseif h>=m2 then
game.secDangerous=players.alive[i] GAME.secDangerous=PLAYERS.alive[i]
m2=h m2=h
end end
end end
for i=1,#players.alive do for i=1,#PLAYERS.alive do
if players.alive[i].atkMode==3 then if PLAYERS.alive[i].atkMode==3 then
players.alive[i]:freshTarget() PLAYERS.alive[i]:freshTarget()
end end
end end
end end
function freshMostBadge() function freshMostBadge()
game.mostBadge,game.secBadge=nil GAME.mostBadge,GAME.secBadge=nil
local m,m2=0,0 local m,m2=0,0
for i=1,#players.alive do for i=1,#PLAYERS.alive do
local P=players.alive[i] local P=PLAYERS.alive[i]
local b=P.badge local b=P.badge
if b>=m then if b>=m then
game.mostBadge,game.secBadge=P,game.mostBadge GAME.mostBadge,GAME.secBadge=P,GAME.mostBadge
m,m2=b,m m,m2=b,m
elseif b>=m2 then elseif b>=m2 then
game.secBadge=P GAME.secBadge=P
m2=b m2=b
end end
end end
for i=1,#players.alive do for i=1,#PLAYERS.alive do
if players.alive[i].atkMode==4 then if PLAYERS.alive[i].atkMode==4 then
players.alive[i]:freshTarget() PLAYERS.alive[i]:freshTarget()
end end
end end
end end
function royaleLevelup() function royaleLevelup()
game.stage=game.stage+1 GAME.stage=GAME.stage+1
local spd local spd
TEXT.show(text.royale_remain(#players.alive),640,200,40,"beat",.3) TEXT.show(text.royale_remain(#PLAYERS.alive),640,200,40,"beat",.3)
if game.stage==2 then if GAME.stage==2 then
spd=30 spd=30
elseif game.stage==3 then elseif GAME.stage==3 then
spd=15 spd=15
game.garbageSpeed=.6 GAME.garbageSpeed=.6
if players[1].alive then BGM.play("cruelty")end if PLAYERS[1].alive then BGM.play("cruelty")end
elseif game.stage==4 then elseif GAME.stage==4 then
spd=10 spd=10
local _=players.alive local _=PLAYERS.alive
for i=1,#_ do for i=1,#_ do
_[i].gameEnv.pushSpeed=3 _[i].gameEnv.pushSpeed=3
end end
elseif game.stage==5 then elseif GAME.stage==5 then
spd=5 spd=5
game.garbageSpeed=1 GAME.garbageSpeed=1
elseif game.stage==6 then elseif GAME.stage==6 then
spd=3 spd=3
if players[1].alive then BGM.play("final")end if PLAYERS[1].alive then BGM.play("final")end
end end
for i=1,#players.alive do for i=1,#PLAYERS.alive do
players.alive[i].gameEnv.drop=spd PLAYERS.alive[i].gameEnv.drop=spd
end end
if curMode.lv==3 then if CURMODE.lv==3 then
for i=1,#players.alive do for i=1,#PLAYERS.alive do
local P=players.alive[i] local P=PLAYERS.alive[i]
P.gameEnv.drop=int(P.gameEnv.drop*.3) P.gameEnv.drop=int(P.gameEnv.drop*.3)
if P.gameEnv.drop==0 then if P.gameEnv.drop==0 then
P.curY=P.imgY P.curY=P.imgY
@@ -393,15 +393,15 @@ end
function pauseGame() function pauseGame()
if not SCN.swapping then if not SCN.swapping then
restartCount=0--Avoid strange darkness restartCount=0--Avoid strange darkness
if not game.result then if not GAME.result then
game.pauseCount=game.pauseCount+1 GAME.pauseCount=GAME.pauseCount+1
end end
if not game.replaying then if not GAME.replaying then
for i=1,#players do for i=1,#PLAYERS do
local l=players[i].keyPressing local l=PLAYERS[i].keyPressing
for j=1,#l do for j=1,#l do
if l[j]then if l[j]then
players[i]:releaseKey(j) PLAYERS[i]:releaseKey(j)
end end
end end
end end
@@ -413,9 +413,8 @@ function resumeGame()
SCN.swapTo("play","none") SCN.swapTo("play","none")
end end
function loadGame(M,ifQuickPlay) function loadGame(M,ifQuickPlay)
stat.lastPlay=M STAT.lastPlay=M
curMode=Modes[M] CURMODE=Modes[M]
local lang=setting.lang
drawableText.modeName:set(text.modes[M][1]) drawableText.modeName:set(text.modes[M][1])
drawableText.levelName:set(text.modes[M][2]) drawableText.levelName:set(text.modes[M][2])
needResetGameData=true needResetGameData=true
@@ -423,31 +422,31 @@ function loadGame(M,ifQuickPlay)
SFX.play("enter") SFX.play("enter")
end end
function resetGameData() function resetGameData()
if players[1]and not game.replaying then if PLAYERS[1]and not GAME.replaying then
mergeStat(stat,players[1].stat) mergeStat(STAT,PLAYERS[1].stat)
end end
game.frame=150-setting.reTime*15 GAME.frame=150-SETTING.reTime*15
game.result=false GAME.result=false
game.pauseTime=0 GAME.pauseTime=0
game.pauseCount=0 GAME.pauseCount=0
game.garbageSpeed=1 GAME.garbageSpeed=1
game.warnLVL0=0 GAME.warnLVL0=0
game.warnLVL=0 GAME.warnLVL=0
game.recording=true GAME.recording=true
game.replaying=false GAME.replaying=false
game.setting=copyGameSetting() GAME.setting=copyGameSetting()
game.rec={} GAME.rec={}
math.randomseed(tm.getTime()) math.randomseed(tm.getTime())
game.seed=rnd(261046101471026) GAME.seed=rnd(261046101471026)
destroyPlayers() destroyPlayers()
modeEnv=curMode.env modeEnv=CURMODE.env
restoreVirtualKey() restoreVirtualKey()
curMode.load() CURMODE.load()
if modeEnv.task then if modeEnv.task then
for i=1,#players do for i=1,#PLAYERS do
players[i]:newTask(modeEnv.task) PLAYERS[i]:newTask(modeEnv.task)
end end
end end
BG.set(modeEnv.bg) BG.set(modeEnv.bg)
@@ -455,55 +454,55 @@ function resetGameData()
TEXT.clear() TEXT.clear()
if modeEnv.royaleMode then if modeEnv.royaleMode then
for i=1,#players do for i=1,#PLAYERS do
players[i]:changeAtk(randomTarget(players[i])) PLAYERS[i]:changeAtk(randomTarget(PLAYERS[i]))
end end
game.stage=nil GAME.stage=nil
game.mostBadge=nil GAME.mostBadge=nil
game.secBadge=nil GAME.secBadge=nil
game.mostDangerous=nil GAME.mostDangerous=nil
game.secDangerous=nil GAME.secDangerous=nil
game.stage=1 GAME.stage=1
game.garbageSpeed=.3 GAME.garbageSpeed=.3
end end
stat.game=stat.game+1 STAT.game=STAT.game+1
freeRow.reset(30*#players) freeRow.reset(30*#PLAYERS)
SFX.play("ready") SFX.play("ready")
collectgarbage() collectgarbage()
end end
function resetPartGameData(replaying) function resetPartGameData(replaying)
TASK.removeTask_code(TICK.autoPause) TASK.removeTask_code(TICK.autoPause)
if players[1]and not game.replaying then if PLAYERS[1]and not GAME.replaying then
mergeStat(stat,players[1].stat) mergeStat(STAT,PLAYERS[1].stat)
end end
game.result=false GAME.result=false
game.garbageSpeed=1 GAME.garbageSpeed=1
game.warnLVL0=0 GAME.warnLVL0=0
game.warnLVL=0 GAME.warnLVL=0
if replaying then if replaying then
game.frame=0 GAME.frame=0
game.recording=false GAME.recording=false
game.replaying=1 GAME.replaying=1
else else
game.frame=150-setting.reTime*15 GAME.frame=150-SETTING.reTime*15
game.pauseTime=0 GAME.pauseTime=0
game.pauseCount=0 GAME.pauseCount=0
game.recording=true GAME.recording=true
game.replaying=false GAME.replaying=false
game.setting=copyGameSetting() GAME.setting=copyGameSetting()
game.rec={} GAME.rec={}
math.randomseed(tm.getTime()) math.randomseed(tm.getTime())
game.seed=rnd(1046101471,2662622626) GAME.seed=rnd(1046101471,2662622626)
end end
destroyPlayers() destroyPlayers()
modeEnv=curMode.env modeEnv=CURMODE.env
restoreVirtualKey() restoreVirtualKey()
curMode.load() CURMODE.load()
if modeEnv.task then if modeEnv.task then
for i=1,#players do for i=1,#PLAYERS do
players[i]:newTask(modeEnv.task) PLAYERS[i]:newTask(modeEnv.task)
end end
end end
BG.set(modeEnv.bg) BG.set(modeEnv.bg)
@@ -511,23 +510,23 @@ function resetPartGameData(replaying)
TEXT.clear() TEXT.clear()
if modeEnv.royaleMode then if modeEnv.royaleMode then
for i=1,#players do for i=1,#PLAYERS do
players[i]:changeAtk(randomTarget(players[i])) PLAYERS[i]:changeAtk(randomTarget(PLAYERS[i]))
end end
game.stage=nil GAME.stage=nil
game.mostBadge=nil GAME.mostBadge=nil
game.secBadge=nil GAME.secBadge=nil
game.mostDangerous=nil GAME.mostDangerous=nil
game.secDangerous=nil GAME.secDangerous=nil
game.stage=1 GAME.stage=1
game.garbageSpeed=.3 GAME.garbageSpeed=.3
end end
collectgarbage() collectgarbage()
end end
function gameStart() function gameStart()
SFX.play("start") SFX.play("start")
for P=1,#players do for P=1,#PLAYERS do
P=players[P] P=PLAYERS[P]
P.control=true P.control=true
P.timing=true P.timing=true
P:popNext() P:popNext()

View File

@@ -1,5 +1,5 @@
local L local L
if setting.lang==1 or setting.lang==2 then if SETTING.lang==1 or SETTING.lang==2 then
L={ L={
'注意到"旋转"到底对方块做了些什么吗?', '注意到"旋转"到底对方块做了些什么吗?',
"(RUR'U')R'FR2U'R'U'(RUR'F')", "(RUR'U')R'FR2U'R'U'(RUR'F')",
@@ -159,7 +159,7 @@ if setting.lang==1 or setting.lang==2 then
"ZS JL T O I", "ZS JL T O I",
-- "Z酱 可爱!", -- "Z酱 可爱!",
} }
elseif setting.lang==3 then elseif SETTING.lang==3 then
L={ L={
'Free block game with Battle Royale mode!', 'Free block game with Battle Royale mode!',
'Have you noticed what "rotating" does do to the block?', 'Have you noticed what "rotating" does do to the block?',
@@ -228,14 +228,14 @@ elseif setting.lang==3 then
"You can set orientation for each block", "You can set orientation for each block",
"ZS JL T O I", "ZS JL T O I",
} }
elseif setting.lang==4 then elseif SETTING.lang==4 then
L={'!','@','#','$','%','^','&','*','(',')','-','=','_','+','[',']','{','}','\\','|',';',':','\'','"',',','<','.','>','/','?'} L={'!','@','#','$','%','^','&','*','(',')','-','=','_','+','[',']','{','}','\\','|',';',':','\'','"',',','<','.','>','/','?'}
local s="" local s=""
for i=1,math.random(16,26)do for i=1,math.random(16,26)do
s=s..L[math.random(#L)] s=s..L[math.random(#L)]
end end
return s return s
elseif setting.lang==5 then elseif SETTING.lang==5 then
local R=math.random() local R=math.random()
if R<.05 then if R<.05 then
local time={ local time={
@@ -268,14 +268,14 @@ elseif setting.lang==5 then
elseif R<.1 then elseif R<.1 then
local int=math.floor local int=math.floor
L={ L={
"平均"..int(stat.row/stat.time*60).."LPM,那可真强呢", "平均"..int(STAT.row/STAT.time*60).."LPM,那可真强呢",
"平均"..int(stat.atk/stat.time*60).."APM,好厉害哦", "平均"..int(STAT.atk/STAT.time*60).."APM,好厉害哦",
"平均"..(int(stat.atk/stat.row*10)*.1).."效,你看这数据能看么", "平均"..(int(STAT.atk/STAT.row*10)*.1).."效,你看这数据能看么",
"平均"..(int(stat.atk/stat.row*10)*.1).."效,我就不说你多菜了", "平均"..(int(STAT.atk/STAT.row*10)*.1).."效,我就不说你多菜了",
"才玩了"..stat.game.."把,跟几十万局的没法比", "才玩了"..STAT.game.."把,跟几十万局的没法比",
"才玩了"..stat.game.."把,玩了不下几万局的人可不在少数", "才玩了"..STAT.game.."把,玩了不下几万局的人可不在少数",
"才玩了"..int(stat.time/3600).."小时,人家总时长是你不知道多少倍", "才玩了"..int(STAT.time/3600).."小时,人家总时长是你不知道多少倍",
"才玩了"..int(stat.time/3600).."小时,别人总时长跟你都不在一个数量级", "才玩了"..int(STAT.time/3600).."小时,别人总时长跟你都不在一个数量级",
} }
else else
L={ L={

View File

@@ -5,7 +5,7 @@ local int,ceil,rnd=math.floor,math.ceil,math.random
local max,min,abs,sin,cos,log=math.max,math.min,math.abs,math.sin,math.cos,math.log local max,min,abs,sin,cos,log=math.max,math.min,math.abs,math.sin,math.cos,math.log
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local format=string.format local format=string.format
local scr=scr local SCR=SCR
local setFont=setFont local setFont=setFont
--------------------------<Data>-------------------------- --------------------------<Data>--------------------------
@@ -74,7 +74,7 @@ local function updateLine(P,dt)--Attacks, line pushing, cam moving
A.time=A.time+1 A.time=A.time+1
if not A.sent then if not A.sent then
if A.countdown>0 then if A.countdown>0 then
A.countdown=max(A.countdown-game.garbageSpeed,0) A.countdown=max(A.countdown-GAME.garbageSpeed,0)
end end
else else
if A.time>20 then if A.time>20 then
@@ -167,7 +167,7 @@ end
local function Pupdate_alive(P,dt) local function Pupdate_alive(P,dt)
if P.timing then P.stat.time=P.stat.time+dt end if P.timing then P.stat.time=P.stat.time+dt end
if P.keyRec then--Update speeds if P.keyRec then--Update speeds
local _=game.frame local _=GAME.frame
local v=0 local v=0
for i=2,10 do v=v+i*(i-1)*7.2/(_-P.keyTime[i]+1)end for i=2,10 do v=v+i*(i-1)*7.2/(_-P.keyTime[i]+1)end
@@ -428,7 +428,7 @@ end
local function drawField(P) local function drawField(P)
local V,F=P.visTime,P.field local V,F=P.visTime,P.field
local start=int((P.fieldBeneath+P.fieldUp)/30+1) local start=int((P.fieldBeneath+P.fieldUp)/30+1)
local rep=game.replaying local rep=GAME.replaying
if P.falling==-1 then--Blocks only if P.falling==-1 then--Blocks only
for j=start,min(start+21,#F)do for j=start,min(start+21,#F)do
for i=1,10 do for i=1,10 do
@@ -608,7 +608,7 @@ local Pdraw_norm do
--In-field things --In-field things
gc.push("transform") gc.push("transform")
gc.translate(0,600+FBN+FUP) gc.translate(0,600+FBN+FUP)
gc.setScissor(scr.x+(P.absFieldX+P.fieldOff.x)*scr.k,scr.y+(P.absFieldY+P.fieldOff.y)*scr.k,300*P.size*scr.k,610*P.size*scr.k) gc.setScissor(SCR.x+(P.absFieldX+P.fieldOff.x)*SCR.k,SCR.y+(P.absFieldY+P.fieldOff.y)*SCR.k,300*P.size*SCR.k,610*P.size*SCR.k)
--Draw dangerous area --Draw dangerous area
gc.setColor(1,0,0,.3) gc.setColor(1,0,0,.3)
@@ -848,8 +848,8 @@ local Pdraw_norm do
--Other messages --Other messages
gc.setColor(1,1,1) gc.setColor(1,1,1)
if curMode.mesDisp then if CURMODE.mesDisp then
curMode.mesDisp(P) CURMODE.mesDisp(P)
end end
--Missions --Missions
@@ -882,8 +882,8 @@ local Pdraw_norm do
--Draw starting counter --Draw starting counter
gc.setColor(1,1,1) gc.setColor(1,1,1)
if game.frame<180 then if GAME.frame<180 then
local count=179-game.frame local count=179-GAME.frame
gc.push("transform") gc.push("transform")
gc.translate(305,290) gc.translate(305,290)
setFont(95) setFont(95)
@@ -1092,7 +1092,7 @@ local function pressKey(P,i)
P.act[i](P) P.act[i](P)
if P.control then if P.control then
if P.keyRec then if P.keyRec then
ins(P.keyTime,1,game.frame) ins(P.keyTime,1,GAME.frame)
P.keyTime[11]=nil P.keyTime[11]=nil
end end
end end
@@ -1104,15 +1104,15 @@ local function releaseKey(P,i)
end end
local function pressKey_Rec(P,i) local function pressKey_Rec(P,i)
if P.keyAvailable[i]then if P.keyAvailable[i]then
if game.recording then if GAME.recording then
ins(game.rec,game.frame+1) ins(GAME.rec,GAME.frame+1)
ins(game.rec,i) ins(GAME.rec,i)
end end
P.keyPressing[i]=true P.keyPressing[i]=true
P.act[i](P) P.act[i](P)
if P.control then if P.control then
if P.keyRec then if P.keyRec then
ins(P.keyTime,1,game.frame) ins(P.keyTime,1,GAME.frame)
P.keyTime[11]=nil P.keyTime[11]=nil
end end
end end
@@ -1120,9 +1120,9 @@ local function pressKey_Rec(P,i)
end end
end end
local function releaseKey_Rec(P,i) local function releaseKey_Rec(P,i)
if game.recording then if GAME.recording then
ins(game.rec,game.frame+1) ins(GAME.rec,GAME.frame+1)
ins(game.rec,-i) ins(GAME.rec,-i)
end end
P.keyPressing[i]=false P.keyPressing[i]=false
end end
@@ -1135,11 +1135,11 @@ local function loadGameEnv(P)--Load gameEnv
if modeEnv[k]~=nil then if modeEnv[k]~=nil then
v=modeEnv[k] --Mode setting v=modeEnv[k] --Mode setting
-- DBP("mode-"..k..":"..tostring(v)) -- DBP("mode-"..k..":"..tostring(v))
elseif game.setting[k]~=nil then elseif GAME.setting[k]~=nil then
v=game.setting[k] --Game setting v=GAME.setting[k] --Game setting
-- DBP("game-"..k..":"..tostring(v)) -- DBP("game-"..k..":"..tostring(v))
elseif setting[k]~=nil then elseif SETTING[k]~=nil then
v=setting[k] --Global setting v=SETTING[k] --Global setting
-- DBP("global-"..k..":"..tostring(v)) -- DBP("global-"..k..":"..tostring(v))
-- else -- else
-- DBP("default-"..k..":"..tostring(v)) -- DBP("default-"..k..":"..tostring(v))
@@ -1189,7 +1189,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
ENV.das=max(ENV.das,ENV.mindas) ENV.das=max(ENV.das,ENV.mindas)
ENV.arr=max(ENV.arr,ENV.minarr) ENV.arr=max(ENV.arr,ENV.minarr)
ENV.sdarr=max(ENV.sdarr,ENV.minsdarr) ENV.sdarr=max(ENV.sdarr,ENV.minsdarr)
ENV.next=min(ENV.next,setting.maxNext) ENV.next=min(ENV.next,SETTING.maxNext)
if ENV.sequence~="bag"and ENV.sequence~="loop"then if ENV.sequence~="bag"and ENV.sequence~="loop"then
ENV.bagLine=false ENV.bagLine=false
@@ -1355,12 +1355,12 @@ local function loadAI(P,AIdata)--Load AI params
end end
local function newEmptyPlayer(id,x,y,size) local function newEmptyPlayer(id,x,y,size)
local P={id=id} local P={id=id}
players[id]=P PLAYERS[id]=P
players.alive[id]=P PLAYERS.alive[id]=P
--Inherit functions of player class --Inherit functions of player class
for k,v in next,player do P[k]=v end for k,v in next,player do P[k]=v end
if P.id==1 and game.recording then if P.id==1 and GAME.recording then
P.pressKey=pressKey_Rec P.pressKey=pressKey_Rec
P.releaseKey=releaseKey_Rec P.releaseKey=releaseKey_Rec
else else
@@ -1387,7 +1387,7 @@ local function newEmptyPlayer(id,x,y,size)
P.draw=Pdraw_norm P.draw=Pdraw_norm
P.bonus={}--Text objects P.bonus={}--Text objects
end end
P.randGen=mt.newRandomGenerator(game.seed) P.randGen=mt.newRandomGenerator(GAME.seed)
P.small=false P.small=false
P.alive=true P.alive=true
@@ -1581,7 +1581,7 @@ function player.createBeam(P,R,send,time,target,color,clear,combo)
radius=radius*.4 radius=radius*.4
a=.35 a=.35
end end
sysFX.newAttack(x1,y1,x2,y2,radius*(setting.atkFX+3)*.12,corner,type==1 and"fill"or"line",r,g,b,a*(setting.atkFX+5)*.1) sysFX.newAttack(x1,y1,x2,y2,radius*(SETTING.atkFX+3)*.12,corner,type==1 and"fill"or"line",r,g,b,a*(SETTING.atkFX+5)*.1)
end end
function player.newTask(P,code,data) function player.newTask(P,code,data)
local L=P.tasks local L=P.tasks
@@ -1621,7 +1621,7 @@ function player.ckfull(P,i)
return true return true
end end
function player.attack(P,R,send,time,...) function player.attack(P,R,send,time,...)
if setting.atkFX>0 then if SETTING.atkFX>0 then
P:createBeam(R,send,time,...) P:createBeam(R,send,time,...)
end end
R.lastRecv=P R.lastRecv=P
@@ -1730,9 +1730,9 @@ function player.freshTarget(P)
P:changeAtk(randomTarget(P)) P:changeAtk(randomTarget(P))
end end
elseif P.atkMode==2 then elseif P.atkMode==2 then
P:changeAtk(P~=game.mostBadge and game.mostBadge or game.secBadge or randomTarget(P)) P:changeAtk(P~=GAME.mostBadge and GAME.mostBadge or GAME.secBadge or randomTarget(P))
elseif P.atkMode==3 then elseif P.atkMode==3 then
P:changeAtk(P~=game.mostDangerous and game.mostDangerous or game.secDangerous or randomTarget(P)) P:changeAtk(P~=GAME.mostDangerous and GAME.mostDangerous or GAME.secDangerous or randomTarget(P))
elseif P.atkMode==4 then elseif P.atkMode==4 then
for i=1,#P.atker do for i=1,#P.atker do
if not P.atker[i].alive then if not P.atker[i].alive then
@@ -1754,7 +1754,7 @@ function player.changeAtkMode(P,m)
end end
end end
function player.changeAtk(P,R) function player.changeAtk(P,R)
-- if not P.human then R=players[1]end--1vALL mode? -- if not P.human then R=PLAYERS[1]end--1vALL mode?
if P.atking then if P.atking then
local K=P.atking.atker local K=P.atking.atker
for i=1,#K do for i=1,#K do
@@ -1905,7 +1905,7 @@ function player.resetBlock(P)
--Spawn SFX --Spawn SFX
if P.sound and id<8 then if P.sound and id<8 then
SFX.fplay(spawnSFX_name[id],setting.spawn) SFX.fplay(spawnSFX_name[id],SETTING.spawn)
end end
end end
@@ -2133,7 +2133,7 @@ do--player.drop(P)--Place piece
function player.drop(P) function player.drop(P)
local _ local _
local CHN=VOC.getFreeChannel() local CHN=VOC.getFreeChannel()
P.dropTime[11]=ins(P.dropTime,1,game.frame)--Update speed dial P.dropTime[11]=ins(P.dropTime,1,GAME.frame)--Update speed dial
local ENV=P.gameEnv local ENV=P.gameEnv
local STAT=P.stat local STAT=P.stat
P.waiting=ENV.wait P.waiting=ENV.wait
@@ -2491,7 +2491,7 @@ do--player.drop(P)--Place piece
P:freshTarget() P:freshTarget()
T=P.atking T=P.atking
end end
elseif #players.alive>1 then elseif #PLAYERS.alive>1 then
T=randomTarget(P) T=randomTarget(P)
end end
if T then if T then
@@ -2622,12 +2622,12 @@ end
--------------------------<Events>-------------------------- --------------------------<Events>--------------------------
local function gameOver()--Save record local function gameOver()--Save record
if game.replaying then return end if GAME.replaying then return end
FILE.saveData() FILE.saveData()
local M=curMode local M=CURMODE
local R=M.getRank local R=M.getRank
if R then if R then
local P=players[1] local P=PLAYERS[1]
R=R(P)--New rank R=R(P)--New rank
if R then if R then
local r=modeRanks[M.name]--Old rank local r=modeRanks[M.name]--Old rank
@@ -2700,14 +2700,14 @@ function player.win(P,result)
P:changeAtk() P:changeAtk()
end end
if P.human then if P.human then
game.result=result or"win" GAME.result=result or"win"
SFX.play("win") SFX.play("win")
VOC.play("win") VOC.play("win")
if modeEnv.royaleMode then if modeEnv.royaleMode then
BGM.play("8-bit happiness") BGM.play("8-bit happiness")
end end
end end
if curMode.id=="custom_puzzle"then if CURMODE.id=="custom_puzzle"then
P:showTextF(text.win,0,0,90,"beat",.4) P:showTextF(text.win,0,0,90,"beat",.4)
else else
P:showTextF(text.win,0,0,90,"beat",.5,.2) P:showTextF(text.win,0,0,90,"beat",.5,.2)
@@ -2761,16 +2761,16 @@ function player.lose(P)
return return
end end
P:die() P:die()
for i=1,#players.alive do for i=1,#PLAYERS.alive do
if players.alive[i]==P then if PLAYERS.alive[i]==P then
rem(players.alive,i) rem(PLAYERS.alive,i)
break break
end end
end end
P.result="K.O." P.result="K.O."
if modeEnv.royaleMode then if modeEnv.royaleMode then
P:changeAtk() P:changeAtk()
P.modeData.event=#players.alive+1 P.modeData.event=#PLAYERS.alive+1
P.strength=0 P.strength=0
if P.lastRecv then if P.lastRecv then
local A,i=P,0 local A,i=P,0
@@ -2799,7 +2799,7 @@ function player.lose(P)
freshMostBadge() freshMostBadge()
freshMostDangerous() freshMostDangerous()
if #players.alive==royaleData.stage[game.stage]then if #PLAYERS.alive==royaleData.stage[GAME.stage]then
royaleLevelup() royaleLevelup()
end end
P:showTextF(P.modeData.event,0,120,60,"appear",.26,.9) P:showTextF(P.modeData.event,0,120,60,"appear",.26,.9)
@@ -2807,7 +2807,7 @@ function player.lose(P)
P.gameEnv.keepVisible=P.gameEnv.visible~="show" P.gameEnv.keepVisible=P.gameEnv.visible~="show"
P:showTextF(text.gameover,0,0,60,"appear",.26,.9) P:showTextF(text.gameover,0,0,60,"appear",.26,.9)
if P.human then if P.human then
game.result="gameover" GAME.result="gameover"
SFX.play("fail") SFX.play("fail")
VOC.play("lose") VOC.play("lose")
if modeEnv.royaleMode then if modeEnv.royaleMode then
@@ -2818,7 +2818,7 @@ function player.lose(P)
end end
end end
gameOver() gameOver()
P:newTask(#players>1 and TICK.lose or TICK.finish) P:newTask(#PLAYERS>1 and TICK.lose or TICK.finish)
TASK.new(TICK.autoPause,{0}) TASK.new(TICK.autoPause,{0})
if MARKING then if MARKING then
P:showTextF(text.marking,0,-226,25,"appear",.4,.0626) P:showTextF(text.marking,0,-226,25,"appear",.4,.0626)
@@ -2826,8 +2826,8 @@ function player.lose(P)
else else
P:newTask(TICK.lose) P:newTask(TICK.lose)
end end
if #players.alive==1 then if #PLAYERS.alive==1 then
players.alive[1]:win() PLAYERS.alive[1]:win()
end end
end end
@@ -2971,7 +2971,7 @@ function player.act.func(P)
P.gameEnv.Fkey(P) P.gameEnv.Fkey(P)
end end
function player.act.restart(P) function player.act.restart(P)
if game.frame<240 or game.result then if GAME.frame<240 or GAME.result then
resetPartGameData() resetPartGameData()
else else
LOG.print(text.holdR,20,color.orange) LOG.print(text.holdR,20,color.orange)
@@ -3119,17 +3119,17 @@ function PLY.newDemoPlayer(id,x,y,size)
das=10,arr=2,sddas=2,sdarr=2, das=10,arr=2,sddas=2,sdarr=2,
swap=true, swap=true,
ghost=setting.ghost, ghost=SETTING.ghost,
center=setting.center, center=SETTING.center,
smooth=setting.smooth, smooth=SETTING.smooth,
grid=setting.grid, grid=SETTING.grid,
text=setting.text, text=SETTING.text,
score=setting.score, score=SETTING.score,
lockFX=setting.lockFX, lockFX=SETTING.lockFX,
dropFX=setting.dropFX, dropFX=SETTING.dropFX,
moveFX=setting.moveFX, moveFX=SETTING.moveFX,
clearFX=setting.clearFX, clearFX=SETTING.clearFX,
shakeFX=setting.shakeFX, shakeFX=SETTING.shakeFX,
drop=1e99,lock=1e99, drop=1e99,lock=1e99,
wait=10,fall=20, wait=10,fall=20,
@@ -3140,7 +3140,7 @@ function PLY.newDemoPlayer(id,x,y,size)
sequence="bag", sequence="bag",
bag={1,2,3,4,5,6,7}, bag={1,2,3,4,5,6,7},
face={0,0,0,0,0,0,0}, face={0,0,0,0,0,0,0},
skin=setting.skin, skin=SETTING.skin,
mission=false, mission=false,
life=1e99, life=1e99,

View File

@@ -12,7 +12,7 @@ local format=string.format
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local find,sub,char,byte=string.find,string.sub,string.char,string.byte local find,sub,char,byte=string.find,string.sub,string.char,string.byte
local scr=scr local SCR=SCR
local floatWheel=0 local floatWheel=0
local function wheelScroll(y) local function wheelScroll(y)
@@ -227,7 +227,7 @@ do--load
elseif S.phase==7 then elseif S.phase==7 then
--------------------------Loading other little things here --------------------------Loading other little things here
SKIN.load() SKIN.load()
stat.run=stat.run+1 STAT.run=STAT.run+1
LOADED=true LOADED=true
-------------------------- --------------------------
SFX.play("welcome_sfx") SFX.play("welcome_sfx")
@@ -389,13 +389,13 @@ do--main
modeEnv={} modeEnv={}
--Create demo player --Create demo player
destroyPlayers() destroyPlayers()
game.frame=0 GAME.frame=0
PLY.newDemoPlayer(1,900,35,1.1) PLY.newDemoPlayer(1,900,35,1.1)
end end
function Tmr.main(dt) function Tmr.main(dt)
game.frame=game.frame+1 GAME.frame=GAME.frame+1
players[1]:update(dt) PLAYERS[1]:update(dt)
end end
function Pnt.main() function Pnt.main()
@@ -403,12 +403,12 @@ do--main
gc.draw(IMG.title_color,60,30,nil,1.3) gc.draw(IMG.title_color,60,30,nil,1.3)
setFont(30) setFont(30)
gc.print(gameVersion,70,125) gc.print(gameVersion,70,125)
gc.print(system,610,100) gc.print(SYSTEM,610,100)
local L=text.modes[stat.lastPlay] local L=text.modes[STAT.lastPlay]
setFont(25) setFont(25)
gc.print(L[1],700,470) gc.print(L[1],700,470)
gc.print(L[2],700,500) gc.print(L[2],700,500)
players[1]:draw() PLAYERS[1]:draw()
end end
end end
do--mode do--mode
@@ -708,7 +708,7 @@ do--mode
gc.pop() gc.pop()
if sel then if sel then
local M=Modes[sel] local M=Modes[sel]
local lang=setting.lang local lang=SETTING.lang
gc.setColor(.7,.7,.7,.5) gc.setColor(.7,.7,.7,.5)
gc.rectangle("fill",920,0,360,720)--Info board gc.rectangle("fill",920,0,360,720)--Info board
gc.setColor(M.color) gc.setColor(M.color)
@@ -765,10 +765,10 @@ do--customGame
if customEnv.opponent>5 and customEnv.sequence=="fixed"then if customEnv.opponent>5 and customEnv.sequence=="fixed"then
LOG.print(text.ai_fixed,"warn") LOG.print(text.ai_fixed,"warn")
return return
elseif customEnv.opponent>0 and #preBag>0 then elseif customEnv.opponent>0 and #BAG>0 then
LOG.print(text.ai_prebag,"warn") LOG.print(text.ai_prebag,"warn")
return return
elseif customEnv.opponent>0 and #preMission>0 then elseif customEnv.opponent>0 and #MISSION>0 then
LOG.print(text.ai_mission,"warn") LOG.print(text.ai_mission,"warn")
return return
end end
@@ -785,9 +785,9 @@ do--customGame
SCN.go("custom_advance","swipeD") SCN.go("custom_advance","swipeD")
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
local str="Techmino Quest:"..copyQuestArgs().."!" local str="Techmino Quest:"..copyQuestArgs().."!"
if #preBag>0 then str=str..copySequence()end if #BAG>0 then str=str..copySequence()end
str=str.."!"..copyBoard().."!" str=str.."!"..copyBoard().."!"
if #preMission>0 then str=str..copyMission()end if #MISSION>0 then str=str..copyMission()end
sys.setClipboardText(str.."!") 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 elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
@@ -828,7 +828,7 @@ do--customGame
end end
end end
local preField=preField local FIELD=FIELD
function Pnt.customGame() function Pnt.customGame()
--Field --Field
gc.push("transform") gc.push("transform")
@@ -839,7 +839,7 @@ do--customGame
gc.rectangle("line",-2,-2,304,604) gc.rectangle("line",-2,-2,304,604)
local cross=puzzleMark[-1] local cross=puzzleMark[-1]
for y=1,20 do for x=1,10 do for y=1,20 do for x=1,10 do
local B=preField[y][x] local B=FIELD[y][x]
if B>0 then if B>0 then
gc.draw(blockSkin[B],30*x-30,600-30*y) gc.draw(blockSkin[B],30*x-30,600-30*y)
elseif B==-1 then elseif B==-1 then
@@ -852,17 +852,17 @@ do--customGame
setFont(30) setFont(30)
gc.printf(customEnv.sequence,330,550,240,"right") gc.printf(customEnv.sequence,330,550,240,"right")
setFont(40) setFont(40)
if #preBag>0 then if #BAG>0 then
gc.setColor(1,1,int(Timer()*6.26)%2) gc.setColor(1,1,int(Timer()*6.26)%2)
gc.print("#",330,545) gc.print("#",330,545)
gc.print(#preBag,360,545) gc.print(#BAG,360,545)
end end
--Sequence --Sequence
if #preMission>0 then if #MISSION>0 then
gc.setColor(1,customEnv.missionKill and 0 or 1,int(Timer()*6.26)%2) gc.setColor(1,customEnv.missionKill and 0 or 1,int(Timer()*6.26)%2)
gc.print("#",610,545) gc.print("#",610,545)
gc.print(#preMission,640,545) gc.print(#MISSION,640,545)
end end
end end
end end
@@ -873,7 +873,7 @@ do--custom_advance
end end
do--custom_sequence do--custom_sequence
function sceneInit.custom_sequence() function sceneInit.custom_sequence()
sceneTemp={cur=#preBag,sure=0} sceneTemp={cur=#BAG,sure=0}
end end
local minoKey={ local minoKey={
@@ -888,48 +888,48 @@ do--custom_sequence
} }
function keyDown.custom_sequence(key) function keyDown.custom_sequence(key)
local S=sceneTemp local S=sceneTemp
local preBag=preBag local BAG=BAG
if key=="left"then if key=="left"then
local p=S.cur local p=S.cur
if p==0 then if p==0 then
S.cur=#preBag S.cur=#BAG
else else
repeat repeat
p=p-1 p=p-1
until preBag[p]~=preBag[S.cur] until BAG[p]~=BAG[S.cur]
S.cur=p S.cur=p
end end
elseif key=="right"then elseif key=="right"then
local p=S.cur local p=S.cur
if p==#preBag then if p==#BAG then
S.cur=0 S.cur=0
else else
repeat repeat
p=p+1 p=p+1
until preBag[p+1]~=preBag[S.cur+1] until BAG[p+1]~=BAG[S.cur+1]
S.cur=p S.cur=p
end end
elseif key=="ten"then elseif key=="ten"then
for i=1,10 do for i=1,10 do
local p=S.cur local p=S.cur
if p==#preBag then break end if p==#BAG then break end
repeat repeat
p=p+1 p=p+1
until preBag[p+1]~=preBag[S.cur+1] until BAG[p+1]~=BAG[S.cur+1]
S.cur=p S.cur=p
end end
elseif key=="backspace"then elseif key=="backspace"then
if S.cur>0 then if S.cur>0 then
rem(preBag,S.cur) rem(BAG,S.cur)
S.cur=S.cur-1 S.cur=S.cur-1
if S.cur>0 and preBag[S.cur]==preBag[S.cur+1]then if S.cur>0 and BAG[S.cur]==BAG[S.cur+1]then
keyDown.custom_mission("right") keyDown.custom_mission("right")
end end
end end
elseif key=="delete"then elseif key=="delete"then
if S.sure>20 then if S.sure>20 then
for i=1,#preBag do for i=1,#BAG do
rem(preBag) rem(BAG)
end end
S.cur=0 S.cur=0
S.sure=0 S.sure=0
@@ -938,7 +938,7 @@ do--custom_sequence
S.sure=50 S.sure=50
end end
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
if #preBag>0 then if #BAG>0 then
sys.setClipboardText("Techmino SEQ:"..copySequence()) sys.setClipboardText("Techmino SEQ:"..copySequence())
LOG.print(text.copySuccess,color.green) LOG.print(text.copySuccess,color.green)
end end
@@ -955,13 +955,13 @@ do--custom_sequence
SCN.back() SCN.back()
elseif type(key)=="number"then elseif type(key)=="number"then
S.cur=S.cur+1 S.cur=S.cur+1
ins(preBag,S.cur,key) ins(BAG,S.cur,key)
elseif #key==1 then elseif #key==1 then
key=(kb.isDown("lshift","lalt","rshift","ralt")and minoKey2 or minoKey)[key] key=(kb.isDown("lshift","lalt","rshift","ralt")and minoKey2 or minoKey)[key]
if key then if key then
local p=S.cur+1 local p=S.cur+1
while preBag[p]==key do p=p+1 end while BAG[p]==key do p=p+1 end
ins(preBag,p,key) ins(BAG,p,key)
S.cur=p S.cur=p
end end
end end
@@ -982,8 +982,8 @@ do--custom_sequence
--Draw sequence --Draw sequence
local miniBlock=TEXTURE.miniBlock local miniBlock=TEXTURE.miniBlock
local libColor=SKIN.libColor local libColor=SKIN.libColor
local set=setting.skin local set=SETTING.skin
local L=preBag local L=BAG
local x,y=120,136--Next block pos local x,y=120,136--Next block pos
local cx,cy=120,136--Cursor-center pos local cx,cy=120,136--Cursor-center pos
local i,j=1,#L local i,j=1,#L
@@ -1051,7 +1051,7 @@ do--custom_field
a=12,s=13,d=14,f=15,g=16,h=17, a=12,s=13,d=14,f=15,g=16,h=17,
z=0,x=-1, z=0,x=-1,
} }
local preField=preField local FIELD=FIELD
function mouseDown.custom_field(x,y,k) function mouseDown.custom_field(x,y,k)
mouseMove.custom_field(x,y) mouseMove.custom_field(x,y)
end end
@@ -1061,7 +1061,7 @@ do--custom_field
if sy<1 or sy>20 then sy=nil end if sy<1 or sy>20 then sy=nil end
sceneTemp.x,sceneTemp.y=sx,sy sceneTemp.x,sceneTemp.y=sx,sy
if sx and sy and ms.isDown(1,2,3)then if sx and sy and ms.isDown(1,2,3)then
preField[sy][sx]=ms.isDown(1)and sceneTemp.pen or ms.isDown(2)and -1 or 0 FIELD[sy][sx]=ms.isDown(1)and sceneTemp.pen or ms.isDown(2)and -1 or 0
end end
end end
function wheelMoved.custom_field(x,y) function wheelMoved.custom_field(x,y)
@@ -1084,7 +1084,7 @@ do--custom_field
if sy<1 or sy>20 then sy=nil end if sy<1 or sy>20 then sy=nil end
sceneTemp.x,sceneTemp.y=sx,sy sceneTemp.x,sceneTemp.y=sx,sy
if sx and sy then if sx and sy then
preField[sy][sx]=sceneTemp.pen FIELD[sy][sx]=sceneTemp.pen
end end
end end
function keyDown.custom_field(key) function keyDown.custom_field(key)
@@ -1098,11 +1098,11 @@ do--custom_field
elseif key=="right"and sx<10 then sx=sx+1 elseif key=="right"and sx<10 then sx=sx+1
end end
if kb.isDown("space")then if kb.isDown("space")then
preField[sy][sx]=pen FIELD[sy][sx]=pen
end end
elseif key=="delete"then elseif key=="delete"then
if sceneTemp.sure>20 then if sceneTemp.sure>20 then
for y=1,20 do for x=1,10 do preField[y][x]=0 end end for y=1,20 do for x=1,10 do FIELD[y][x]=0 end end
sceneTemp.sure=0 sceneTemp.sure=0
SFX.play("finesseError",.7) SFX.play("finesseError",.7)
else else
@@ -1110,16 +1110,16 @@ do--custom_field
end end
elseif key=="space"then elseif key=="space"then
if sx and sy then if sx and sy then
preField[sy][sx]=pen FIELD[sy][sx]=pen
end end
elseif key=="escape"then elseif key=="escape"then
SCN.back() SCN.back()
elseif key=="k"then elseif key=="k"then
ins(preField,1,{14,14,14,14,14,14,14,14,14,14}) ins(FIELD,1,{14,14,14,14,14,14,14,14,14,14})
preField[21]=nil FIELD[21]=nil
SFX.play("blip") SFX.play("blip")
elseif key=="l"then elseif key=="l"then
local F=preField local F=FIELD
for i=20,1,-1 do for i=20,1,-1 do
for j=1,10 do for j=1,10 do
if F[i][j]<=0 then goto L end if F[i][j]<=0 then goto L end
@@ -1174,7 +1174,7 @@ do--custom_field
gc.setLineWidth(2) gc.setLineWidth(2)
local cross=puzzleMark[-1] local cross=puzzleMark[-1]
for y=1,20 do for x=1,10 do for y=1,20 do for x=1,10 do
local B=preField[y][x] local B=FIELD[y][x]
if B>0 then if B>0 then
gc.draw(blockSkin[B],30*x-30,600-30*y) gc.draw(blockSkin[B],30*x-30,600-30*y)
elseif B==-1 and not S.demo then elseif B==-1 and not S.demo then
@@ -1210,7 +1210,7 @@ do--custom_field
setFont(40) setFont(40)
local _ local _
for i=1,7 do for i=1,7 do
_=setting.skin[i] _=SETTING.skin[i]
gc.setColor(SKIN.libColor[_]) gc.setColor(SKIN.libColor[_])
mStr(text.block[i],500+65*_,115) mStr(text.block[i],500+65*_,115)
end end
@@ -1220,7 +1220,7 @@ do--custom_mission
function sceneInit.custom_mission() function sceneInit.custom_mission()
sceneTemp={ sceneTemp={
input="", input="",
cur=#preMission, cur=#MISSION,
sure=0, sure=0,
} }
end end
@@ -1229,48 +1229,48 @@ do--custom_mission
local legalInput={Z=true,S=true,J=true,L=true,T=true,O=true,I=true,A=true,_=true,P=true} local legalInput={Z=true,S=true,J=true,L=true,T=true,O=true,I=true,A=true,_=true,P=true}
function keyDown.custom_mission(key) function keyDown.custom_mission(key)
local S=sceneTemp local S=sceneTemp
local preMission=preMission local MISSION=MISSION
if key=="left"then if key=="left"then
local p=S.cur local p=S.cur
if p==0 then if p==0 then
S.cur=#preMission S.cur=#MISSION
else else
repeat repeat
p=p-1 p=p-1
until preMission[p]~=preMission[S.cur] until MISSION[p]~=MISSION[S.cur]
S.cur=p S.cur=p
end end
elseif key=="right"then elseif key=="right"then
local p=S.cur local p=S.cur
if p==#preMission then if p==#MISSION then
S.cur=0 S.cur=0
else else
repeat repeat
p=p+1 p=p+1
until preMission[p+1]~=preMission[S.cur+1] until MISSION[p+1]~=MISSION[S.cur+1]
S.cur=p S.cur=p
end end
elseif key=="ten"then elseif key=="ten"then
for i=1,10 do for i=1,10 do
local p=S.cur local p=S.cur
if p==#preMission then break end if p==#MISSION then break end
repeat repeat
p=p+1 p=p+1
until preMission[p+1]~=preMission[S.cur+1] until MISSION[p+1]~=MISSION[S.cur+1]
S.cur=p S.cur=p
end end
elseif key=="backspace"then elseif key=="backspace"then
if S.cur>0 then if S.cur>0 then
rem(preMission,S.cur) rem(MISSION,S.cur)
S.cur=S.cur-1 S.cur=S.cur-1
if S.cur>0 and preMission[S.cur]==preMission[S.cur+1]then if S.cur>0 and MISSION[S.cur]==MISSION[S.cur+1]then
keyDown.custom_mission("right") keyDown.custom_mission("right")
end end
end end
elseif key=="delete"then elseif key=="delete"then
if S.sure>20 then if S.sure>20 then
for i=1,#preMission do for i=1,#MISSION do
rem(preMission) rem(MISSION)
end end
S.cur=0 S.cur=0
S.sure=0 S.sure=0
@@ -1279,7 +1279,7 @@ do--custom_mission
S.sure=50 S.sure=50
end end
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
if #preMission>0 then if #MISSION>0 then
sys.setClipboardText("Techmino Target:"..copyMission()) sys.setClipboardText("Techmino Target:"..copyMission())
LOG.print(text.copySuccess,color.green) LOG.print(text.copySuccess,color.green)
end end
@@ -1296,8 +1296,8 @@ do--custom_mission
SCN.back() SCN.back()
elseif type(key)=="number"then elseif type(key)=="number"then
local p=S.cur+1 local p=S.cur+1
while preMission[p]==key do p=p+1 end while MISSION[p]==key do p=p+1 end
ins(preMission,p,key) ins(MISSION,p,key)
S.cur=p S.cur=p
else else
if key=="space"then if key=="space"then
@@ -1310,7 +1310,7 @@ do--custom_mission
input=input..key input=input..key
if missionEnum[input]then if missionEnum[input]then
S.cur=S.cur+1 S.cur=S.cur+1
ins(preMission,S.cur,missionEnum[input]) ins(MISSION,S.cur,missionEnum[input])
input="" input=""
elseif #input>1 or not legalInput[input]then elseif #input>1 or not legalInput[input]then
input="" input=""
@@ -1338,8 +1338,8 @@ do--custom_mission
--Draw targets --Draw targets
local libColor=SKIN.libColor local libColor=SKIN.libColor
local set=setting.skin local set=SETTING.skin
local L=preMission local L=MISSION
local x,y=100,136--Next block pos local x,y=100,136--Next block pos
local cx,cy=100,136--Cursor-center pos local cx,cy=100,136--Cursor-center pos
local i,j=1,#L local i,j=1,#L
@@ -1422,19 +1422,19 @@ do--play
end end
function touchDown.play(id,x,y) function touchDown.play(id,x,y)
if not setting.VKSwitch or game.replaying then return end if not SETTING.VKSwitch or GAME.replaying then return end
local t=onVirtualkey(x,y) local t=onVirtualkey(x,y)
if t then if t then
players[1]:pressKey(t) PLAYERS[1]:pressKey(t)
if setting.VKSFX>0 then if SETTING.VKSFX>0 then
SFX.play("virtualKey",setting.VKSFX) SFX.play("virtualKey",SETTING.VKSFX)
end end
VK[t].isDown=true VK[t].isDown=true
VK[t].pressTime=10 VK[t].pressTime=10
if setting.VKTrack then if SETTING.VKTrack then
local B=VK[t] local B=VK[t]
if setting.VKDodge then--Button collision (not accurate) if SETTING.VKDodge then--Button collision (not accurate)
for i=1,#VK do for i=1,#VK do
local b=VK[i] local b=VK[i]
local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--Hit depth(Neg means distance) local d=B.r+b.r-((B.x-b.x)^2+(B.y-b.y)^2)^.5--Hit depth(Neg means distance)
@@ -1445,25 +1445,25 @@ do--play
end end
end end
local O=VK_org[t] local O=VK_org[t]
local _FW,_CW=setting.VKTchW*.1,1-setting.VKCurW*.1 local _FW,_CW=SETTING.VKTchW*.1,1-SETTING.VKCurW*.1
local _OW=1-_FW-_CW local _OW=1-_FW-_CW
--Auto follow: finger, current, origin (weight from setting) --Auto follow: finger, current, origin (weight from setting)
B.x,B.y=x*_FW+B.x*_CW+O.x*_OW,y*_FW+B.y*_CW+O.y*_OW B.x,B.y=x*_FW+B.x*_CW+O.x*_OW,y*_FW+B.y*_CW+O.y*_OW
end end
VIB(setting.VKVIB) VIB(SETTING.VKVIB)
end end
end end
function touchUp.play(id,x,y) function touchUp.play(id,x,y)
if not setting.VKSwitch or game.replaying then return end if not SETTING.VKSwitch or GAME.replaying then return end
local t=onVirtualkey(x,y) local t=onVirtualkey(x,y)
if t then if t then
players[1]:releaseKey(t) PLAYERS[1]:releaseKey(t)
end end
end end
function touchMove.play(id,x,y,dx,dy) function touchMove.play(id,x,y,dx,dy)
if not setting.VKSwitch or game.replaying then return end if not SETTING.VKSwitch or GAME.replaying then return end
local l=tc.getTouches() local l=tc.getTouches()
for n=1,#VK do for n=1,#VK do
@@ -1474,17 +1474,17 @@ do--play
goto next goto next
end end
end end
players[1]:releaseKey(n) PLAYERS[1]:releaseKey(n)
::next:: ::next::
end end
end end
function keyDown.play(key) function keyDown.play(key)
if game.replaying then return end if GAME.replaying then return end
local m=keyMap local m=keyMap
for k=1,20 do for k=1,20 do
if key==m[1][k]or key==m[2][k]then if key==m[1][k]or key==m[2][k]then
players[1]:pressKey(k) PLAYERS[1]:pressKey(k)
VK[k].isDown=true VK[k].isDown=true
VK[k].pressTime=10 VK[k].pressTime=10
return return
@@ -1494,23 +1494,23 @@ do--play
if key=="escape"then pauseGame()end if key=="escape"then pauseGame()end
end end
function keyUp.play(key) function keyUp.play(key)
if game.replaying then return end if GAME.replaying then return end
local m=keyMap local m=keyMap
for k=1,20 do for k=1,20 do
if key==m[1][k]or key==m[2][k]then if key==m[1][k]or key==m[2][k]then
players[1]:releaseKey(k) PLAYERS[1]:releaseKey(k)
VK[k].isDown=false VK[k].isDown=false
return return
end end
end end
end end
function gamepadDown.play(key) function gamepadDown.play(key)
if game.replaying then return end if GAME.replaying then return end
local m=keyMap local m=keyMap
for k=1,20 do for k=1,20 do
if key==m[3][k]or key==m[4][k]then if key==m[3][k]or key==m[4][k]then
players[1]:pressKey(k) PLAYERS[1]:pressKey(k)
VK[k].isDown=true VK[k].isDown=true
VK[k].pressTime=10 VK[k].pressTime=10
return return
@@ -1520,12 +1520,12 @@ do--play
if key=="back"then pauseGame()end if key=="back"then pauseGame()end
end end
function gamepadUp.play(key) function gamepadUp.play(key)
if game.replaying then return end if GAME.replaying then return end
local m=keyMap local m=keyMap
for k=1,20 do for k=1,20 do
if key==m[3][k]or key==m[4][k]then if key==m[3][k]or key==m[4][k]then
players[1]:releaseKey(k) PLAYERS[1]:releaseKey(k)
VK[k].isDown=false VK[k].isDown=false
return return
end end
@@ -1534,13 +1534,13 @@ do--play
function Tmr.play(dt) function Tmr.play(dt)
local _ local _
local P1=players[1] local P1=PLAYERS[1]
local game=game local GAME=GAME
game.frame=game.frame+1 GAME.frame=GAME.frame+1
stat.time=stat.time+dt STAT.time=STAT.time+dt
--Update virtualkey animation --Update virtualkey animation
if setting.VKSwitch then if SETTING.VKSwitch then
for i=1,#VK do for i=1,#VK do
_=VK[i] _=VK[i]
if _.pressTime>0 then if _.pressTime>0 then
@@ -1550,10 +1550,10 @@ do--play
end end
--Replay --Replay
if game.replaying then if GAME.replaying then
_=game.replaying _=GAME.replaying
local L=game.rec local L=GAME.rec
while game.frame==L[_]do while GAME.frame==L[_]do
local k=L[_+1] local k=L[_+1]
if k>0 then if k>0 then
P1:pressKey(k) P1:pressKey(k)
@@ -1565,18 +1565,18 @@ do--play
end end
_=_+2 _=_+2
end end
game.replaying=_ GAME.replaying=_
end end
--Counting,include pre-das,directy RETURN,or restart counting --Counting,include pre-das,directy RETURN,or restart counting
if game.frame<180 then if GAME.frame<180 then
if game.frame==179 then if GAME.frame==179 then
gameStart() gameStart()
elseif game.frame==60 or game.frame==120 then elseif GAME.frame==60 or GAME.frame==120 then
SFX.play("ready") SFX.play("ready")
end end
for p=1,#players do for p=1,#PLAYERS do
local P=players[p] local P=PLAYERS[p]
if P.movDir~=0 then if P.movDir~=0 then
if P.moving<P.gameEnv.das then if P.moving<P.gameEnv.das then
P.moving=P.moving+1 P.moving=P.moving+1
@@ -1598,19 +1598,19 @@ do--play
end end
--Update players --Update players
for p=1,#players do for p=1,#PLAYERS do
local P=players[p] local P=PLAYERS[p]
P:update(dt) P:update(dt)
end end
--Fresh royale target --Fresh royale target
if modeEnv.royaleMode and game.frame%120==0 then if modeEnv.royaleMode and GAME.frame%120==0 then
freshMostDangerous() freshMostDangerous()
end end
--Warning check --Warning check
if P1.alive then if P1.alive then
if game.frame%26==0 and setting.warn then if GAME.frame%26==0 and SETTING.warn then
local F=P1.field local F=P1.field
local height=0--Max height of row 4~7 local height=0--Max height of row 4~7
for x=4,7 do for x=4,7 do
@@ -1623,17 +1623,17 @@ do--play
end end
end end
end end
game.warnLVL0=log(height-15+P1.atkBuffer.sum*.8) GAME.warnLVL0=log(height-15+P1.atkBuffer.sum*.8)
end end
_=game.warnLVL _=GAME.warnLVL
if _<game.warnLVL0 then if _<GAME.warnLVL0 then
_=_*.95+game.warnLVL0*.05 _=_*.95+GAME.warnLVL0*.05
elseif _>0 then elseif _>0 then
_=max(_-.026,0) _=max(_-.026,0)
end end
game.warnLVL=_ GAME.warnLVL=_
elseif game.warnLVL>0 then elseif GAME.warnLVL>0 then
game.warnLVL=max(game.warnLVL-.026,0) GAME.warnLVL=max(GAME.warnLVL-.026,0)
end end
end end
@@ -1646,9 +1646,9 @@ do--play
gc.circle("line",x,y,30*(1+a),6) gc.circle("line",x,y,30*(1+a),6)
end end
local function drawVirtualkey() local function drawVirtualkey()
local a=setting.VKAlpha local a=SETTING.VKAlpha
local _ local _
if setting.VKIcon then if SETTING.VKIcon then
local icons=TEXTURE.VKIcon local icons=TEXTURE.VKIcon
for i=1,#VK do for i=1,#VK do
if VK[i].ava then if VK[i].ava then
@@ -1689,15 +1689,15 @@ do--play
gc.setColor(1,1,1,.2+.1*(sin(3*t)+sin(2.6*t))) gc.setColor(1,1,1,.2+.1*(sin(3*t)+sin(2.6*t)))
mStr(text.marking,190,60+26*sin(t)) mStr(text.marking,190,60+26*sin(t))
end end
for p=1,#players do for p=1,#PLAYERS do
players[p]:draw() PLAYERS[p]:draw()
end end
gc.setColor(1,1,1) gc.setColor(1,1,1)
if setting.VKSwitch then drawVirtualkey()end if SETTING.VKSwitch then drawVirtualkey()end
if modeEnv.royaleMode then if modeEnv.royaleMode then
local P=players[1] local P=PLAYERS[1]
gc.setLineWidth(5) gc.setLineWidth(5)
gc.setColor(.8,1,0,.2) gc.setColor(.8,1,0,.2)
for i=1,#P.atker do for i=1,#P.atker do
@@ -1720,7 +1720,7 @@ do--play
gc.draw(drawableText.levelName,511+drawableText.modeName:getWidth(),10) gc.draw(drawableText.levelName,511+drawableText.modeName:getWidth(),10)
--Replaying --Replaying
if game.replaying then if GAME.replaying then
gc.setColor(1,1,Timer()%1>.5 and 1 or 0) gc.setColor(1,1,Timer()%1>.5 and 1 or 0)
mText(drawableText.replaying,410,17) mText(drawableText.replaying,410,17)
end end
@@ -1728,16 +1728,16 @@ do--play
--Warning --Warning
gc.push("transform") gc.push("transform")
gc.origin() gc.origin()
if game.warnLVL>0 then if GAME.warnLVL>0 then
gc.setColor(0,0,0,0) gc.setColor(0,0,0,0)
SHADER.warning:send("level",game.warnLVL) SHADER.warning:send("level",GAME.warnLVL)
gc.setShader(SHADER.warning) gc.setShader(SHADER.warning)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.setShader() gc.setShader()
end end
if restartCount>0 then if restartCount>0 then
gc.setColor(0,0,0,restartCount*.05) gc.setColor(0,0,0,restartCount*.05)
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
end end
gc.pop() gc.pop()
end end
@@ -1761,7 +1761,7 @@ do--pause
then then
TEXT.show(text.needRestart,640,440,50,"fly",.6) TEXT.show(text.needRestart,640,440,50,"fly",.6)
end end
local P=players[1] local P=PLAYERS[1]
local S=P.stat local S=P.stat
sceneTemp={ sceneTemp={
timer=org=="play"and 0 or 50, timer=org=="play"and 0 or 50,
@@ -1848,8 +1848,8 @@ do--pause
end end
function sceneBack.pause() function sceneBack.pause()
love.keyboard.setKeyRepeat(true) love.keyboard.setKeyRepeat(true)
if not game.replaying then if not GAME.replaying then
mergeStat(stat,players[1].stat) mergeStat(STAT,PLAYERS[1].stat)
end end
FILE.saveData() FILE.saveData()
end end
@@ -1864,15 +1864,15 @@ do--pause
elseif key=="r"then elseif key=="r"then
resetGameData() resetGameData()
SCN.swapTo("play","none") SCN.swapTo("play","none")
elseif key=="p"and(game.result or game.replaying)and #players==1 then elseif key=="p"and(GAME.result or GAME.replaying)and #PLAYERS==1 then
resetPartGameData(true) resetPartGameData(true)
SCN.swapTo("play","none") SCN.swapTo("play","none")
end end
end end
function Tmr.pause(dt) function Tmr.pause(dt)
if not game.result then if not GAME.result then
game.pauseTime=game.pauseTime+dt GAME.pauseTime=GAME.pauseTime+dt
end end
if sceneTemp.timer<50 then if sceneTemp.timer<50 then
sceneTemp.timer=sceneTemp.timer+1 sceneTemp.timer=sceneTemp.timer+1
@@ -1886,22 +1886,22 @@ do--pause
function Pnt.pause() function Pnt.pause()
local S=sceneTemp local S=sceneTemp
local T=S.timer*.02 local T=S.timer*.02
if T<1 or game.result then Pnt.play()end if T<1 or GAME.result then Pnt.play()end
--Dark BG --Dark BG
local _=T local _=T
if game.result then _=_*.7 end if GAME.result then _=_*.7 end
gc.setColor(.15,.15,.15,_) gc.setColor(.15,.15,.15,_)
gc.push("transform") gc.push("transform")
gc.origin() gc.origin()
gc.rectangle("fill",0,0,scr.w,scr.h) gc.rectangle("fill",0,0,SCR.w,SCR.h)
gc.pop() gc.pop()
--Pause Info --Pause Info
setFont(25) setFont(25)
if game.pauseCount>0 then if GAME.pauseCount>0 then
gc.setColor(1,.4,.4,T) gc.setColor(1,.4,.4,T)
gc.print(text.pauseCount..":["..game.pauseCount.."] "..format("%.2f",game.pauseTime).."s",70,100) gc.print(text.pauseCount..":["..GAME.pauseCount.."] "..format("%.2f",GAME.pauseTime).."s",70,100)
end end
gc.setColor(1,1,1,T) gc.setColor(1,1,1,T)
@@ -1913,10 +1913,10 @@ do--pause
--Result Text --Result Text
setFont(35) setFont(35)
mText(game.result and drawableText[game.result]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5) mText(GAME.result and drawableText[GAME.result]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
--Infos --Infos
if game.frame>180 then if GAME.frame>180 then
_=S.list _=S.list
setFont(26) setFont(26)
for i=1,10 do for i=1,10 do
@@ -1938,7 +1938,7 @@ do--pause
end end
--Radar Chart --Radar Chart
if T>.5 and game.frame>180 then if T>.5 and GAME.frame>180 then
T=T*2-1 T=T*2-1
gc.setLineWidth(2) gc.setLineWidth(2)
gc.push("transform") gc.push("transform")
@@ -2057,8 +2057,8 @@ end
do--setting_control do--setting_control
function sceneInit.setting_control() function sceneInit.setting_control()
sceneTemp={ sceneTemp={
das=setting.das, das=SETTING.das,
arr=setting.arr, arr=SETTING.arr,
pos=0, pos=0,
dir=1, dir=1,
wait=30, wait=30,
@@ -2081,8 +2081,8 @@ do--setting_control
if T.das==0 then if T.das==0 then
if T.arr==0 then if T.arr==0 then
T.pos=T.pos+7*T.dir T.pos=T.pos+7*T.dir
T.das=setting.das+1 T.das=SETTING.das+1
T.arr=setting.arr T.arr=SETTING.arr
T.dir=-T.dir T.dir=-T.dir
T.wait=26 T.wait=26
else else
@@ -2093,15 +2093,15 @@ do--setting_control
T.arr=T.arr-1 T.arr=T.arr-1
if T.arr==0 then if T.arr==0 then
T.pos=T.pos+T.dir T.pos=T.pos+T.dir
T.arr=setting.arr T.arr=SETTING.arr
elseif T.arr==-1 then elseif T.arr==-1 then
T.pos=T.dir>0 and 8 or 0 T.pos=T.dir>0 and 8 or 0
T.arr=setting.arr T.arr=SETTING.arr
end end
if T.pos%8==0 then if T.pos%8==0 then
T.dir=-T.dir T.dir=-T.dir
T.wait=26 T.wait=26
T.das=setting.das T.das=SETTING.das
end end
end end
end end
@@ -2121,7 +2121,7 @@ do--setting_control
gc.line(950,530,950,630) gc.line(950,530,950,630)
--Testing O mino --Testing O mino
_=blockSkin[setting.skin[6]] _=blockSkin[SETTING.skin[6]]
local x=550+40*sceneTemp.pos local x=550+40*sceneTemp.pos
gc.draw(_,x,540,nil,40/30) gc.draw(_,x,540,nil,40/30)
gc.draw(_,x,580,nil,40/30) gc.draw(_,x,580,nil,40/30)
@@ -2261,13 +2261,13 @@ do--setting_skin
function Pnt.setting_skin() function Pnt.setting_skin()
gc.setColor(1,1,1) gc.setColor(1,1,1)
for N=1,7 do for N=1,7 do
local face=setting.face[N] local face=SETTING.face[N]
local B=blocks[N][face] local B=blocks[N][face]
local x,y=-55+140*N-scs[N][face][2]*30,355+scs[N][face][1]*30 local x,y=-55+140*N-scs[N][face][2]*30,355+scs[N][face][1]*30
local col=#B[1] local col=#B[1]
for i=1,#B do for j=1,col do for i=1,#B do for j=1,col do
if B[i][j]then if B[i][j]then
gc.draw(blockSkin[setting.skin[N]],x+30*j,y-30*i) gc.draw(blockSkin[SETTING.skin[N]],x+30*j,y-30*i)
end end
end end end end
gc.circle("fill",-10+140*N,340,sin(Timer()*10)+5) gc.circle("fill",-10+140*N,340,sin(Timer()*10)+5)
@@ -2341,15 +2341,15 @@ do--setting_touch
end end
local function VirtualkeyPreview() local function VirtualkeyPreview()
if setting.VKSwitch then if SETTING.VKSwitch then
for i=1,#VK_org do for i=1,#VK_org do
local B=VK_org[i] local B=VK_org[i]
if B.ava then if B.ava then
local c=sceneTemp.sel==i and .6 or 1 local c=sceneTemp.sel==i and .6 or 1
gc.setColor(c,1,c,setting.VKAlpha) gc.setColor(c,1,c,SETTING.VKAlpha)
gc.setLineWidth(B.r*.07) gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r,10) gc.circle("line",B.x,B.y,B.r,10)
if setting.VKIcon then gc.draw(TEXTURE.VKIcon[i],B.x,B.y,nil,B.r*.025,nil,18,18)end if SETTING.VKIcon then gc.draw(TEXTURE.VKIcon[i],B.x,B.y,nil,B.r*.025,nil,18,18)end
end end
end end
end end
@@ -2375,9 +2375,9 @@ end
do--setting_trackSetting do--setting_trackSetting
function Pnt.setting_trackSetting() function Pnt.setting_trackSetting()
gc.setColor(1,1,1) gc.setColor(1,1,1)
mText(drawableText.VKTchW,140+50*setting.VKTchW,260) mText(drawableText.VKTchW,140+50*SETTING.VKTchW,260)
mText(drawableText.VKOrgW,140+50*setting.VKTchW+50*setting.VKCurW,320) mText(drawableText.VKOrgW,140+50*SETTING.VKTchW+50*SETTING.VKCurW,320)
mText(drawableText.VKCurW,640+50*setting.VKCurW,380) mText(drawableText.VKCurW,640+50*SETTING.VKCurW,380)
end end
end end
do--setting_touchSwitch do--setting_touchSwitch
@@ -2421,7 +2421,7 @@ do--music
end end
elseif key=="return"or key=="space"then elseif key=="return"or key=="space"then
if BGM.nowPlay~=BGM.list[S]then if BGM.nowPlay~=BGM.list[S]then
if setting.bgm>0 then if SETTING.bgm>0 then
SFX.play("click") SFX.play("click")
BGM.play(BGM.list[S]) BGM.play(BGM.list[S])
end end
@@ -2488,7 +2488,7 @@ do--help
end end
do--dict do--dict
function sceneInit.dict() function sceneInit.dict()
local location=(setting.lang==3 or setting.lang==4)and"en"or"zh" local location=(SETTING.lang==3 or SETTING.lang==4)and"en"or"zh"
sceneTemp={ sceneTemp={
dict=require("document/dict_"..location), dict=require("document/dict_"..location),
@@ -2689,7 +2689,7 @@ do--staff
end end
do--stat do--stat
function sceneInit.stat() function sceneInit.stat()
local S=stat local S=STAT
local X1,X2,Y1,Y2={0,0,0,0},{0,0,0,0},{},{} local X1,X2,Y1,Y2={0,0,0,0},{0,0,0,0},{},{}
for i=1,7 do for i=1,7 do
local S,C=S.spin[i],S.clear[i] local S,C=S.spin[i],S.clear[i]
@@ -2728,7 +2728,7 @@ do--stat
function Pnt.stat() function Pnt.stat()
local chart=sceneTemp.chart local chart=sceneTemp.chart
setFont(24) setFont(24)
local _,__=SKIN.libColor,setting.skin local _,__=SKIN.libColor,SETTING.skin
local A,B=chart.A1,chart.A2 local A,B=chart.A1,chart.A2
for x=1,7 do for x=1,7 do
gc.setColor(_[__[x]]) gc.setColor(_[__[x]])

View File

@@ -82,7 +82,7 @@ function SKIN.load()
end end
I:release() I:release()
end end
SKIN.change(setting.skinSet) SKIN.change(SETTING.skinSet)
puzzleMark={} puzzleMark={}
gc.setLineWidth(3) gc.setLineWidth(3)
for i=1,11 do for i=1,11 do
@@ -110,29 +110,29 @@ function SKIN.load()
end end
local L=#list local L=#list
function SKIN.prevSet()--Prev skin_set function SKIN.prevSet()--Prev skin_set
local _=(setting.skinSet-2)%L+1 local _=(SETTING.skinSet-2)%L+1
setting.skinSet=_ SETTING.skinSet=_
SKIN.change(_) SKIN.change(_)
_=list[_] _=list[_]
TEXT.show(_,1100,100,int(300/#_)+5,"fly") TEXT.show(_,1100,100,int(300/#_)+5,"fly")
end end
function SKIN.nextSet()--Next skin_set function SKIN.nextSet()--Next skin_set
local _=setting.skinSet%L+1 local _=SETTING.skinSet%L+1
setting.skinSet=_ SETTING.skinSet=_
SKIN.change(_) SKIN.change(_)
_=list[_] _=list[_]
TEXT.show(_,1100,100,int(300/#_)+5,"fly") TEXT.show(_,1100,100,int(300/#_)+5,"fly")
end end
function SKIN.prev(i)--Prev skin for [i] function SKIN.prev(i)--Prev skin for [i]
local _=setting.skin local _=SETTING.skin
_[i]=(_[i]-2)%11+1 _[i]=(_[i]-2)%11+1
end end
function SKIN.next(i)--Next skin for [i] function SKIN.next(i)--Next skin for [i]
local _=setting.skin local _=SETTING.skin
_[i]=_[i]%11+1 _[i]=_[i]%11+1
end end
function SKIN.rotate(i)--Change direction of [i] function SKIN.rotate(i)--Change direction of [i]
setting.face[i]=(setting.face[i]+1)%4 SETTING.face[i]=(SETTING.face[i]+1)%4
SFX.play("rotate") SFX.play("rotate")
end end
function SKIN.change(i)--Change to skin_set[i] function SKIN.change(i)--Change to skin_set[i]

View File

@@ -34,7 +34,7 @@ function Tick.lose(P)
return true return true
end end
end end
if not modeEnv.royaleMode and #players>1 then if not modeEnv.royaleMode and #PLAYERS>1 then
P.y=P.y+P.endCounter*.26 P.y=P.y+P.endCounter*.26
P.absFieldY=P.absFieldY+P.endCounter*.26 P.absFieldY=P.absFieldY+P.endCounter*.26
end end