很多全局变量名改为大写

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

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

View File

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

View File

@@ -1,5 +1,5 @@
local L
if setting.lang==1 or setting.lang==2 then
if SETTING.lang==1 or SETTING.lang==2 then
L={
'注意到"旋转"到底对方块做了些什么吗?',
"(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",
-- "Z酱 可爱!",
}
elseif setting.lang==3 then
elseif SETTING.lang==3 then
L={
'Free block game with Battle Royale mode!',
'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",
"ZS JL T O I",
}
elseif setting.lang==4 then
elseif SETTING.lang==4 then
L={'!','@','#','$','%','^','&','*','(',')','-','=','_','+','[',']','{','}','\\','|',';',':','\'','"',',','<','.','>','/','?'}
local s=""
for i=1,math.random(16,26)do
s=s..L[math.random(#L)]
end
return s
elseif setting.lang==5 then
elseif SETTING.lang==5 then
local R=math.random()
if R<.05 then
local time={
@@ -268,14 +268,14 @@ elseif setting.lang==5 then
elseif R<.1 then
local int=math.floor
L={
"平均"..int(stat.row/stat.time*60).."LPM,那可真强呢",
"平均"..int(stat.atk/stat.time*60).."APM,好厉害哦",
"平均"..(int(stat.atk/stat.row*10)*.1).."效,你看这数据能看么",
"平均"..(int(stat.atk/stat.row*10)*.1).."效,我就不说你多菜了",
"才玩了"..stat.game.."把,跟几十万局的没法比",
"才玩了"..stat.game.."把,玩了不下几万局的人可不在少数",
"才玩了"..int(stat.time/3600).."小时,人家总时长是你不知道多少倍",
"才玩了"..int(stat.time/3600).."小时,别人总时长跟你都不在一个数量级",
"平均"..int(STAT.row/STAT.time*60).."LPM,那可真强呢",
"平均"..int(STAT.atk/STAT.time*60).."APM,好厉害哦",
"平均"..(int(STAT.atk/STAT.row*10)*.1).."效,你看这数据能看么",
"平均"..(int(STAT.atk/STAT.row*10)*.1).."效,我就不说你多菜了",
"才玩了"..STAT.game.."把,跟几十万局的没法比",
"才玩了"..STAT.game.."把,玩了不下几万局的人可不在少数",
"才玩了"..int(STAT.time/3600).."小时,人家总时长是你不知道多少倍",
"才玩了"..int(STAT.time/3600).."小时,别人总时长跟你都不在一个数量级",
}
else
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 ins,rem=table.insert,table.remove
local format=string.format
local scr=scr
local SCR=SCR
local setFont=setFont
--------------------------<Data>--------------------------
@@ -74,7 +74,7 @@ local function updateLine(P,dt)--Attacks, line pushing, cam moving
A.time=A.time+1
if not A.sent then
if A.countdown>0 then
A.countdown=max(A.countdown-game.garbageSpeed,0)
A.countdown=max(A.countdown-GAME.garbageSpeed,0)
end
else
if A.time>20 then
@@ -167,7 +167,7 @@ end
local function Pupdate_alive(P,dt)
if P.timing then P.stat.time=P.stat.time+dt end
if P.keyRec then--Update speeds
local _=game.frame
local _=GAME.frame
local v=0
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 V,F=P.visTime,P.field
local start=int((P.fieldBeneath+P.fieldUp)/30+1)
local rep=game.replaying
local rep=GAME.replaying
if P.falling==-1 then--Blocks only
for j=start,min(start+21,#F)do
for i=1,10 do
@@ -608,7 +608,7 @@ local Pdraw_norm do
--In-field things
gc.push("transform")
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
gc.setColor(1,0,0,.3)
@@ -848,8 +848,8 @@ local Pdraw_norm do
--Other messages
gc.setColor(1,1,1)
if curMode.mesDisp then
curMode.mesDisp(P)
if CURMODE.mesDisp then
CURMODE.mesDisp(P)
end
--Missions
@@ -882,8 +882,8 @@ local Pdraw_norm do
--Draw starting counter
gc.setColor(1,1,1)
if game.frame<180 then
local count=179-game.frame
if GAME.frame<180 then
local count=179-GAME.frame
gc.push("transform")
gc.translate(305,290)
setFont(95)
@@ -1092,7 +1092,7 @@ local function pressKey(P,i)
P.act[i](P)
if P.control then
if P.keyRec then
ins(P.keyTime,1,game.frame)
ins(P.keyTime,1,GAME.frame)
P.keyTime[11]=nil
end
end
@@ -1104,15 +1104,15 @@ local function releaseKey(P,i)
end
local function pressKey_Rec(P,i)
if P.keyAvailable[i]then
if game.recording then
ins(game.rec,game.frame+1)
ins(game.rec,i)
if GAME.recording then
ins(GAME.rec,GAME.frame+1)
ins(GAME.rec,i)
end
P.keyPressing[i]=true
P.act[i](P)
if P.control then
if P.keyRec then
ins(P.keyTime,1,game.frame)
ins(P.keyTime,1,GAME.frame)
P.keyTime[11]=nil
end
end
@@ -1120,9 +1120,9 @@ local function pressKey_Rec(P,i)
end
end
local function releaseKey_Rec(P,i)
if game.recording then
ins(game.rec,game.frame+1)
ins(game.rec,-i)
if GAME.recording then
ins(GAME.rec,GAME.frame+1)
ins(GAME.rec,-i)
end
P.keyPressing[i]=false
end
@@ -1135,11 +1135,11 @@ local function loadGameEnv(P)--Load gameEnv
if modeEnv[k]~=nil then
v=modeEnv[k] --Mode setting
-- DBP("mode-"..k..":"..tostring(v))
elseif game.setting[k]~=nil then
v=game.setting[k] --Game setting
elseif GAME.setting[k]~=nil then
v=GAME.setting[k] --Game setting
-- DBP("game-"..k..":"..tostring(v))
elseif setting[k]~=nil then
v=setting[k] --Global setting
elseif SETTING[k]~=nil then
v=SETTING[k] --Global setting
-- DBP("global-"..k..":"..tostring(v))
-- else
-- DBP("default-"..k..":"..tostring(v))
@@ -1189,7 +1189,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
ENV.das=max(ENV.das,ENV.mindas)
ENV.arr=max(ENV.arr,ENV.minarr)
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
ENV.bagLine=false
@@ -1355,12 +1355,12 @@ local function loadAI(P,AIdata)--Load AI params
end
local function newEmptyPlayer(id,x,y,size)
local P={id=id}
players[id]=P
players.alive[id]=P
PLAYERS[id]=P
PLAYERS.alive[id]=P
--Inherit functions of player class
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.releaseKey=releaseKey_Rec
else
@@ -1387,7 +1387,7 @@ local function newEmptyPlayer(id,x,y,size)
P.draw=Pdraw_norm
P.bonus={}--Text objects
end
P.randGen=mt.newRandomGenerator(game.seed)
P.randGen=mt.newRandomGenerator(GAME.seed)
P.small=false
P.alive=true
@@ -1581,7 +1581,7 @@ function player.createBeam(P,R,send,time,target,color,clear,combo)
radius=radius*.4
a=.35
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
function player.newTask(P,code,data)
local L=P.tasks
@@ -1621,7 +1621,7 @@ function player.ckfull(P,i)
return true
end
function player.attack(P,R,send,time,...)
if setting.atkFX>0 then
if SETTING.atkFX>0 then
P:createBeam(R,send,time,...)
end
R.lastRecv=P
@@ -1730,9 +1730,9 @@ function player.freshTarget(P)
P:changeAtk(randomTarget(P))
end
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
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
for i=1,#P.atker do
if not P.atker[i].alive then
@@ -1754,7 +1754,7 @@ function player.changeAtkMode(P,m)
end
end
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
local K=P.atking.atker
for i=1,#K do
@@ -1905,7 +1905,7 @@ function player.resetBlock(P)
--Spawn SFX
if P.sound and id<8 then
SFX.fplay(spawnSFX_name[id],setting.spawn)
SFX.fplay(spawnSFX_name[id],SETTING.spawn)
end
end
@@ -2133,7 +2133,7 @@ do--player.drop(P)--Place piece
function player.drop(P)
local _
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 STAT=P.stat
P.waiting=ENV.wait
@@ -2491,7 +2491,7 @@ do--player.drop(P)--Place piece
P:freshTarget()
T=P.atking
end
elseif #players.alive>1 then
elseif #PLAYERS.alive>1 then
T=randomTarget(P)
end
if T then
@@ -2622,12 +2622,12 @@ end
--------------------------<Events>--------------------------
local function gameOver()--Save record
if game.replaying then return end
if GAME.replaying then return end
FILE.saveData()
local M=curMode
local M=CURMODE
local R=M.getRank
if R then
local P=players[1]
local P=PLAYERS[1]
R=R(P)--New rank
if R then
local r=modeRanks[M.name]--Old rank
@@ -2700,14 +2700,14 @@ function player.win(P,result)
P:changeAtk()
end
if P.human then
game.result=result or"win"
GAME.result=result or"win"
SFX.play("win")
VOC.play("win")
if modeEnv.royaleMode then
BGM.play("8-bit happiness")
end
end
if curMode.id=="custom_puzzle"then
if CURMODE.id=="custom_puzzle"then
P:showTextF(text.win,0,0,90,"beat",.4)
else
P:showTextF(text.win,0,0,90,"beat",.5,.2)
@@ -2761,16 +2761,16 @@ function player.lose(P)
return
end
P:die()
for i=1,#players.alive do
if players.alive[i]==P then
rem(players.alive,i)
for i=1,#PLAYERS.alive do
if PLAYERS.alive[i]==P then
rem(PLAYERS.alive,i)
break
end
end
P.result="K.O."
if modeEnv.royaleMode then
P:changeAtk()
P.modeData.event=#players.alive+1
P.modeData.event=#PLAYERS.alive+1
P.strength=0
if P.lastRecv then
local A,i=P,0
@@ -2799,7 +2799,7 @@ function player.lose(P)
freshMostBadge()
freshMostDangerous()
if #players.alive==royaleData.stage[game.stage]then
if #PLAYERS.alive==royaleData.stage[GAME.stage]then
royaleLevelup()
end
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:showTextF(text.gameover,0,0,60,"appear",.26,.9)
if P.human then
game.result="gameover"
GAME.result="gameover"
SFX.play("fail")
VOC.play("lose")
if modeEnv.royaleMode then
@@ -2818,7 +2818,7 @@ function player.lose(P)
end
end
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})
if MARKING then
P:showTextF(text.marking,0,-226,25,"appear",.4,.0626)
@@ -2826,8 +2826,8 @@ function player.lose(P)
else
P:newTask(TICK.lose)
end
if #players.alive==1 then
players.alive[1]:win()
if #PLAYERS.alive==1 then
PLAYERS.alive[1]:win()
end
end
@@ -2971,7 +2971,7 @@ function player.act.func(P)
P.gameEnv.Fkey(P)
end
function player.act.restart(P)
if game.frame<240 or game.result then
if GAME.frame<240 or GAME.result then
resetPartGameData()
else
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,
swap=true,
ghost=setting.ghost,
center=setting.center,
smooth=setting.smooth,
grid=setting.grid,
text=setting.text,
score=setting.score,
lockFX=setting.lockFX,
dropFX=setting.dropFX,
moveFX=setting.moveFX,
clearFX=setting.clearFX,
shakeFX=setting.shakeFX,
ghost=SETTING.ghost,
center=SETTING.center,
smooth=SETTING.smooth,
grid=SETTING.grid,
text=SETTING.text,
score=SETTING.score,
lockFX=SETTING.lockFX,
dropFX=SETTING.dropFX,
moveFX=SETTING.moveFX,
clearFX=SETTING.clearFX,
shakeFX=SETTING.shakeFX,
drop=1e99,lock=1e99,
wait=10,fall=20,
@@ -3140,7 +3140,7 @@ function PLY.newDemoPlayer(id,x,y,size)
sequence="bag",
bag={1,2,3,4,5,6,7},
face={0,0,0,0,0,0,0},
skin=setting.skin,
skin=SETTING.skin,
mission=false,
life=1e99,

View File

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

View File

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

View File

@@ -34,7 +34,7 @@ function Tick.lose(P)
return true
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.absFieldY=P.absFieldY+P.endCounter*.26
end