diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 374f6f4a..e6c9dfbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -260,7 +260,7 @@ jobs: # In secrets: # - MACOS_CERTIFICATE: the *.p12 Developer ID Certificate, encoded in base64 # - MACOS_CERTIFICATE_PWD: The password - env: + env: MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df818fa1..c15660bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -388,7 +388,7 @@ jobs: # In secrets: # - MACOS_CERTIFICATE: the *.p12 Developer ID Certificate, encoded in base64 # - MACOS_CERTIFICATE_PWD: The password - env: + env: MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} run: | diff --git a/Zframework/background.lua b/Zframework/background.lua index 6add35da..3fd54057 100644 --- a/Zframework/background.lua +++ b/Zframework/background.lua @@ -30,7 +30,7 @@ function BG.setDefault(bg) BG.default=bg end function BG.set(background) - if not background then background=BG.default end + background=background or BG.default if not BGs[background]or not SETTING.bg then return end if background~=BG.cur then BG.discard() diff --git a/Zframework/bgm.lua b/Zframework/bgm.lua index 1f743dde..6c21fb3e 100644 --- a/Zframework/bgm.lua +++ b/Zframework/bgm.lua @@ -72,7 +72,7 @@ function BGM.init(list) return task.code==code and task.args[1]==src end function BGM.play(name) - if not name then name=BGM.default end + name=name or BGM.default if not _load(name)then return end if SETTING.bgm==0 then BGM.nowPlay=name @@ -81,7 +81,9 @@ function BGM.init(list) end if name and Sources[name]then if BGM.nowPlay~=name then - if BGM.nowPlay then TASK.new(task_fadeOut,BGM.playing)end + if BGM.nowPlay then + TASK.new(task_fadeOut,BGM.playing) + end TASK.removeTask_iterate(check_curFadeOut,task_fadeOut,Sources[name]) TASK.removeTask_code(task_fadeIn) @@ -107,7 +109,9 @@ function BGM.init(list) end function BGM.stop() TASK.removeTask_code(task_fadeIn) - if BGM.nowPlay then TASK.new(task_fadeOut,BGM.playing)end + if BGM.nowPlay then + TASK.new(task_fadeOut,BGM.playing) + end BGM.nowPlay,BGM.playing=nil end end diff --git a/Zframework/file.lua b/Zframework/file.lua index 9400c3f7..093ab98d 100644 --- a/Zframework/file.lua +++ b/Zframework/file.lua @@ -60,31 +60,33 @@ function FILE.save(data,name,mode) end end function FILE.clear(path) - if fs.getRealDirectory(path)~=SAVEDIR or fs.getInfo(path).type~='directory'then return end - for _,name in next,fs.getDirectoryItems(path)do - name=path..'/'..name - if fs.getRealDirectory(name)==SAVEDIR then - local t=fs.getInfo(name).type - if t=='file'then - fs.remove(name) + if fs.getRealDirectory(path)==SAVEDIR and fs.getInfo(path).type=='directory'then + for _,name in next,fs.getDirectoryItems(path)do + name=path..'/'..name + if fs.getRealDirectory(name)==SAVEDIR then + local t=fs.getInfo(name).type + if t=='file'then + fs.remove(name) + end end end end end function FILE.clear_s(path) - if path~=''and(fs.getRealDirectory(path)~=SAVEDIR or fs.getInfo(path).type~='directory')then return end - for _,name in next,fs.getDirectoryItems(path)do - name=path..'/'..name - if fs.getRealDirectory(name)==SAVEDIR then - local t=fs.getInfo(name).type - if t=='file'then - fs.remove(name) - elseif t=='directory'then - FILE.clear_s(name) - fs.remove(name) + if path==''or (fs.getRealDirectory(path)==SAVEDIR and fs.getInfo(path).type=='directory')then + for _,name in next,fs.getDirectoryItems(path)do + name=path..'/'..name + if fs.getRealDirectory(name)==SAVEDIR then + local t=fs.getInfo(name).type + if t=='file'then + fs.remove(name) + elseif t=='directory'then + FILE.clear_s(name) + fs.remove(name) + end end end + fs.remove(path) end - fs.remove(path) end return FILE diff --git a/Zframework/gcExtend.lua b/Zframework/gcExtend.lua index 09969471..13cb0565 100644 --- a/Zframework/gcExtend.lua +++ b/Zframework/gcExtend.lua @@ -145,7 +145,9 @@ do--function GC.DO(L) end if type(cmd)=='string'then local func=cmds[cmd] - if type(func)=='string'then func=gc[func]end + if type(func)=='string'then + func=gc[func] + end if func then func(unpack(L[i],2)) else diff --git a/Zframework/languages.lua b/Zframework/languages.lua index b74a528b..42f171c4 100644 --- a/Zframework/languages.lua +++ b/Zframework/languages.lua @@ -4,7 +4,9 @@ function LANG.init(langList,publicText)--Attention, calling this will destory al for k,v in next,T0 do if type(v)=='table'and not v.refuseCopy then--refuseCopy: just copy pointer, not contents if not T[k]then T[k]={}end - if type(T[k])=='table'then _langFallback(v,T[k])end + if type(T[k])=='table'then + _langFallback(v,T[k]) + end elseif not T[k]then T[k]=v end diff --git a/Zframework/scene.lua b/Zframework/scene.lua index d9fa956a..b67e6a48 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -86,7 +86,9 @@ function SCN.init(s,org) SCN.socketRead=S.socketRead SCN.update=S.update SCN.draw=S.draw - if S.sceneInit then S.sceneInit(org)end + if S.sceneInit then + S.sceneInit(org) + end end function SCN.push(tar,style) if not SCN.swapping then @@ -140,7 +142,7 @@ local swap={ function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back if scenes[tar]then if not SCN.swapping and tar~=SCN.cur then - if not style then style='fade'end + style=style or'fade' SCN.swapping=true local S=SCN.stat S.tar,S.style=tar,style @@ -164,7 +166,9 @@ function SCN.back() if SCN.swapping then return end --Leave scene - if SCN.sceneBack then SCN.sceneBack()end + if SCN.sceneBack then + SCN.sceneBack() + end --Poll&Back to previous Scene local m=#SCN.stack diff --git a/Zframework/text.lua b/Zframework/text.lua index c906aca1..a13f8c82 100644 --- a/Zframework/text.lua +++ b/Zframework/text.lua @@ -22,14 +22,18 @@ end function textFX.stretch(t) gc_push('transform') gc_translate(t.x,t.y) - if t.c<.3 then gc_scale((.3-t.c)*1.6+1,1)end + if t.c<.3 then + gc_scale((.3-t.c)*1.6+1,1) + end mStr(t.text,0,-t.font*.7) gc_pop() end function textFX.drive(t) gc_push('transform') gc_translate(t.x,t.y) - if t.c<.3 then gc_shear((.3-t.c)*2,0)end + if t.c<.3 then + gc_shear((.3-t.c)*2,0) + end mStr(t.text,0,-t.font*.7) gc_pop() end @@ -102,7 +106,9 @@ function TEXT.getText(text,x,y,font,style,spd,stop)--Another version of TEXT.sho } end function TEXT.update(list) - if not list then list=texts end + if not list then + list=texts + end for i=#list,1,-1 do local t=list[i] t.c=t.c+t.spd @@ -117,7 +123,9 @@ function TEXT.update(list) end end function TEXT.draw(list) - if not list then list=texts end + if not list then + list=texts + end for i=1,#list do local t=list[i] local p=t.c diff --git a/Zframework/theme.lua b/Zframework/theme.lua index 1742cf14..ac025727 100644 --- a/Zframework/theme.lua +++ b/Zframework/theme.lua @@ -7,7 +7,9 @@ local themeColor={ } function THEME.calculate(Y,M,D) - if not Y then Y,M,D=os.date('%Y'),os.date('%m'),os.date('%d')end + if not Y then + Y,M,D=os.date('%Y'),os.date('%m'),os.date('%d') + end --Festival calculate within one statement return --Christmas @@ -90,7 +92,9 @@ function THEME.set(theme) end function THEME.getThemeColor(theme) - if not theme then theme=THEME.cur end + if not theme then + theme=THEME.cur + end return themeColor[theme] end diff --git a/Zframework/voice.lua b/Zframework/voice.lua index 12215ab2..cc288ce2 100644 --- a/Zframework/voice.lua +++ b/Zframework/voice.lua @@ -49,7 +49,9 @@ function VOC.init(list) MES.new('warn',"No VOICE file: "..list[i],.1) end end - if not Source[list[i]][1]then Source[list[i]]=nil end + if not Source[list[i]][1]then + Source[list[i]]=nil + end end function VOC.getQueueCount() diff --git a/Zframework/widget.lua b/Zframework/widget.lua index d41deb51..fb06dfe8 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -220,7 +220,9 @@ function button:press(_,_,k) self.w+2*ATV, self.h+2*ATV ) - if self.sound then SFX.play('button')end + if self.sound then + SFX.play('button') + end end function WIDGET.newButton(D)--name,x,y,w[,h][,fText][,color][,font=30][,sound=true][,align='M'][,edge=0],code[,hideF][,hide] if not D.h then D.h=D.w end @@ -332,7 +334,9 @@ function key:getInfo() end function key:press(_,_,k) self.code(k) - if self.sound then SFX.play('key')end + if self.sound then + SFX.play('key') + end end function WIDGET.newKey(D)--name,x,y,w[,h][,fText][,fShade][,noFrame][,color][,font=30][,sound=true][,align='M'][,edge=0],code[,hideF][,hide] if not D.h then D.h=D.w end @@ -387,12 +391,16 @@ function switch:getCenter() end function switch:update() local atv=self.ATV - if WIDGET.sel==self then if atv<8 then self.ATV=atv+1 end - else if atv>0 then self.ATV=atv-.5 end + if WIDGET.sel==self then + if atv<8 then self.ATV=atv+1 end + else + if atv>0 then self.ATV=atv-.5 end end local chk=self.CHK - if self:disp()then if chk<6 then self.CHK=chk+1 end - else if chk>0 then self.CHK=chk-1 end + if self:disp()then + if chk<6 then self.CHK=chk+1 end + else + if chk>0 then self.CHK=chk-1 end end end function switch:draw() @@ -424,7 +432,9 @@ function switch:getInfo() end function switch:press() self.code() - if self.sound then SFX.play('move')end + if self.sound then + SFX.play('move') + end end function WIDGET.newSwitch(D)--name,x,y[,fText][,color][,font=30][,sound=true][,disp],code[,hideF][,hide] local _={ @@ -736,7 +746,9 @@ function selector:press(x) self.code(self.list[s]) self.select=s self.selText=self.list[s] - if self.sound then SFX.play('prerotate')end + if self.sound then + SFX.play('prerotate') + end end end end @@ -754,7 +766,9 @@ function selector:scroll(n) self.code(self.list[s]) self.select=s self.selText=self.list[s] - if self.sound then SFX.play('prerotate')end + if self.sound then + SFX.play('prerotate') + end end function selector:arrowKey(k) self:scroll((k=="left"or k=="up")and -1 or 1) @@ -1385,13 +1399,13 @@ function WIDGET.keyPressed(k,isRep) local tar local minDist=1e99 local swap_xy=k=="up"or k=="down" - if swap_xy then WX,WY=WY,WX end -- note that we do not swap them back later + if swap_xy then WX,WY=WY,WX end--note that we do not swap them back later for _,W1 in ipairs(WIDGET.active)do if W~=W1 and W1.resCtr and not W1.hide then local L=W1.resCtr for j=1,#L,2 do local x,y=L[j],L[j+1] - if swap_xy then x,y=y,x end -- note that we do not swap them back later + if swap_xy then x,y=y,x end--note that we do not swap them back later local dist=(x-WX)*dir if dist>10 then dist=dist+abs(y-WY)*6.26 diff --git a/build/Windows/Techmino.rc.template b/build/Windows/Techmino.rc.template index 09c61fab..30c8207d 100644 --- a/build/Windows/Techmino.rc.template +++ b/build/Windows/Techmino.rc.template @@ -18,6 +18,6 @@ FILETYPE 0x1 BLOCK "VarFileInfo" { - VALUE "Translation", 0x0409 0x04E4 + VALUE "Translation", 0x0409 0x04E4 } } diff --git a/main.lua b/main.lua index 43d90b02..0b9561ac 100644 --- a/main.lua +++ b/main.lua @@ -111,11 +111,17 @@ else FIELD[1]=DATA.newBoard() end local sequenceData=FILE.load('conf/customSequence') -if sequenceData then DATA.pasteSequence(sequenceData)end +if sequenceData then + DATA.pasteSequence(sequenceData) +end local missionData=FILE.load('conf/customMissions') -if missionData then DATA.pasteMission(missionData)end +if missionData then + DATA.pasteMission(missionData) +end local customData=FILE.load('conf/customEnv') -if customData and customData.version==VERSION.code then TABLE.complete(customData,CUSTOMENV)end +if customData and customData.version==VERSION.code then + TABLE.complete(customData,CUSTOMENV) +end TABLE.complete(require"parts.customEnv0",CUSTOMENV) @@ -285,12 +291,22 @@ do end if STAT.version==1506 then local temp1,temp2 - if fs.getInfo('record/master_l.rec')then temp1=fs.read('record/master_l.rec')end - if fs.getInfo('record/master_u.rec')then temp2=fs.read('record/master_u.rec')end - if temp1 then fs.write('record/master_u.rec',temp1)end - if temp2 then fs.write('record/master_l.rec',temp2)end + if fs.getInfo('record/master_l.rec')then + temp1=fs.read('record/master_l.rec') + end + if fs.getInfo('record/master_u.rec')then + temp2=fs.read('record/master_u.rec') + end + if temp1 then + fs.write('record/master_u.rec',temp1) + end + if temp2 then + fs.write('record/master_l.rec',temp2) + end RANKS.master_l,RANKS.master_u=RANKS.master_u,RANKS.master_l - if RANKS.tsd_u then RANKS.tsd_u=0 end + if RANKS.tsd_u then + RANKS.tsd_u=0 + end needSave=true end if STAT.version==1601 then @@ -320,22 +336,40 @@ do end SETTING.appLock=nil SETTING.dataSaving=nil - if not SETTING.VKSkin then SETTING.VKSkin=1 end + if not SETTING.VKSkin then + SETTING.VKSkin=1 + end for _,v in next,SETTING.skin do if v<1 or v>17 then v=17 end end if SETTING.RS=='ZRS'or SETTING.RS=='BRS'or SETTING.RS=='ASCplus'or SETTING.RS=='C2sym' then SETTING.RS='TRS'end - if SETTING.ghostType=='greyCell'then SETTING.ghostType='grayCell'end - if type(SETTING.skinSet)=='number'then SETTING.skinSet='crystal_scf'end - if not TABLE.find({8,10,13,17,22,29,37,47,62,80,100},SETTING.frameMul)then SETTING.frameMul=100 end + if SETTING.ghostType=='greyCell'then + SETTING.ghostType='grayCell' + end + if type(SETTING.skinSet)=='number'then + SETTING.skinSet='crystal_scf' + end + if not TABLE.find({8,10,13,17,22,29,37,47,62,80,100},SETTING.frameMul)then + SETTING.frameMul=100 + end for _,v in next,VK_org do v.color=nil end - if RANKS.infinite then RANKS.infinite=0 end - if RANKS.infinite_dig then RANKS.infinite_dig=0 end - if not RANKS.sprint_10l then RANKS.sprint_10l=0 end - if RANKS.master_l then RANKS.master_n,RANKS.master_l=RANKS.master_l needSave=true end - if RANKS.master_u then RANKS.master_h,RANKS.master_u=RANKS.master_u needSave=true end + if RANKS.infinite then + RANKS.infinite=0 + end + if RANKS.infinite_dig then + RANKS.infinite_dig=0 + end + if not RANKS.sprint_10l then + RANKS.sprint_10l=0 + end + if RANKS.master_l then + RANKS.master_n,RANKS.master_l=RANKS.master_l needSave=true + end + if RANKS.master_u then + RANKS.master_h,RANKS.master_u=RANKS.master_u needSave=true + end for k in next,RANKS do if type(k)=='number'then RANKS[k]=nil diff --git a/parts/RSlist.lua b/parts/RSlist.lua index 6a6dbc58..610ba314 100644 --- a/parts/RSlist.lua +++ b/parts/RSlist.lua @@ -61,7 +61,9 @@ end --Use this to copy a symmetry set local function _flipList(O) - if not O then return end + if not O then + return + end local L={} for i,s in next,O do L[i]=string.char(88-s:byte())..s:sub(2) @@ -173,9 +175,12 @@ do if P.gameEnv.ospin then local x,y=P.curX,P.curY if y==P.ghoY and((P:solid(x-1,y)or P:solid(x-1,y+1)))and(P:solid(x+2,y)or P:solid(x+2,y+1))then - if P.sound then SFX.play('rotatekick',nil,P:getCenterX()*.15)end + if P.sound then + SFX.play('rotatekick',nil,P:getCenterX()*.15) + end P.spinSeq=P.spinSeq%100*10+d - if P.spinSeq<100 then return end + if P.spinSeq<100 then + return end for i=1,#OspinList do local L=OspinList[i] if P.spinSeq==L[1]then @@ -203,11 +208,15 @@ do end end else - if P.sound then SFX.play('rotate',nil,P:getCenterX()*.15)end + if P.sound then + SFX.play('rotate',nil,P:getCenterX()*.15) + end P.spinSeq=0 end else - if P.sound then SFX.play('rotate',nil,P:getCenterX()*.15)end + if P.sound then + SFX.play('rotate',nil,P:getCenterX()*.15) + end end end,--O { @@ -318,7 +327,9 @@ do [31]={'+0+0','+0-1','+1+0'}, },--W function(P,d) - if P.type=='human'then SFX.play('rotate',nil,P:getCenterX()*.15)end + if P.type=='human'then + SFX.play('rotate',nil,P:getCenterX()*.15) + end local kickData=XspinList[d] for test=1,#kickData do local x,y=P.curX+kickData[test][1],P.curY+kickData[test][2] @@ -612,7 +623,9 @@ do } for i=1,29 do local a,b=R,L - if i==6 or i==18 then a,b=b,a end + if i==6 or i==18 then + a,b=b,a + end list[i][01]=a;list[i][10]=b;list[i][03]=b;list[i][30]=a list[i][12]=a;list[i][21]=b;list[i][32]=b;list[i][23]=a end diff --git a/parts/backgrounds/blockfall.lua b/parts/backgrounds/blockfall.lua index db63ccf6..4ecb0a74 100644 --- a/parts/backgrounds/blockfall.lua +++ b/parts/backgrounds/blockfall.lua @@ -31,7 +31,9 @@ function back.update() for i=#mino,1,-1 do local M=mino[i] M.y=M.y+M.vy - if M.y-M.k*#M.block*30>SCR.h then rem(mino,i)end + if M.y-M.k*#M.block*30>SCR.h then + rem(mino,i) + end end end function back.draw() diff --git a/parts/backgrounds/welcome.lua b/parts/backgrounds/welcome.lua index e9b1cffe..15c030fe 100644 --- a/parts/backgrounds/welcome.lua +++ b/parts/backgrounds/welcome.lua @@ -4,10 +4,10 @@ local sin=math.sin local back={} local t -local txt +local textObj function back.init() t=math.random()*2600 - txt=gc.newText(getFont(80),"Welcome To Techmino") + textObj=gc.newText(getFont(80),"Welcome To Techmino") end function back.update(dt) t=t+dt @@ -21,7 +21,7 @@ function back.draw() gc.push('transform') gc.translate(SCR.cx,SCR.cy+20*sin(t*.02)) gc.scale(SCR.k) - gc.scale(1.1626,1.26) + gc.scale(1.26,1.36) if -t%6.26<.1355 then gc.translate(60*sin(t*.26),100*sin(t*.626)) end @@ -29,11 +29,11 @@ function back.draw() gc.rotate(t+5*sin(.26*t)+5*sin(.626*t)) end gc.setColor(.4,.6,1,.3) - gc.draw(txt,-883*.5+4*sin(t*.7942),-110*.5+4*sin(t*.7355)) + mDraw(textObj,4*sin(t*.7942),4*sin(t*.7355)) gc.setColor(.5,.7,1,.4) - gc.draw(txt,-883*.5+2*sin(t*.77023),-110*.5+2*sin(t*.7026)) + mDraw(textObj,2*sin(t*.77023),2*sin(t*.7026)) gc.setColor(1,1,1,.5) - gc.draw(txt,-883*.5+3*sin(t*.7283),-110*.5+3*sin(t*.7626)) + mDraw(textObj,3*sin(t*.7283),3*sin(t*.7626)) gc.pop() end return back diff --git a/parts/bot/bot_9s.lua b/parts/bot/bot_9s.lua index cd633658..532b8979 100644 --- a/parts/bot/bot_9s.lua +++ b/parts/bot/bot_9s.lua @@ -39,7 +39,9 @@ local LclearScore={[0]=0,-200,-150,-100,200} local HclearScore={[0]=0,100,140,200,500} local function _ifoverlapAI(f,bk,x,y) for i=1,#bk do for j=1,#bk[1]do - if f[y+i-1]and bk[i][j]and f[y+i-1][x+j-1]>0 then return true end + if f[y+i-1]and bk[i][j]and f[y+i-1][x+j-1]>0 then + return true + end end end end local discardRow=FREEROW.discard @@ -65,25 +67,33 @@ local function _getScore(field,cb,cy) for i=cy+#cb-1,cy,-1 do for j=1,10 do - if field[i][j]==0 then goto CONTINUE_notFull end + if field[i][j]==0 then + goto CONTINUE_notFull + end end discardRow(rem(field,i)) clear=clear+1 ::CONTINUE_notFull:: end - if #field==0 then return 1e99 end--PC + if #field==0 then--PC + return 1e99 + end for x=1,10 do local h=#field while field[h][x]==0 and h>1 do h=h-1 end height[x]=h - if x>3 and x<8 and h>highest then highest=h end + if x>3 and x<8 and h>highest then + highest=h + end if h>1 then for h1=h-1,1,-1 do if field[h1][x]==0 then hole=hole+1 - if hole==5 then break end + if hole==5 then + break + end end end end @@ -94,7 +104,9 @@ local function _getScore(field,cb,cy) local dh=abs(height[x]-height[x+1]) if dh==1 then h1=h1+1 - if h1>mh1 then mh1=h1 end + if h1>mh1 then + mh1=h1 + end else h1=0 end @@ -115,8 +127,12 @@ local function _getScore(field,cb,cy) -cy*40 -sdh*3 ) - if #field>6 then score=score-highest*5+20 end - if mh1>3 then score=score-20-mh1*30 end + if #field>6 then + score=score-highest*5+20 + end + if mh1>3 then + score=score-20-mh1*30 + end return score end @@ -158,7 +174,9 @@ function bot_9s.thread(bot) --Simulate lock for i=1,#cb do local y=cy+i-1 - if not Tfield[y]then Tfield[y]=getRow(0)end + if not Tfield[y]then + Tfield[y]=getRow(0) + end local L=Tfield[y] for j=1,#cb[1]do if cb[i][j]then diff --git a/parts/bot/bot_cc.lua b/parts/bot/bot_cc.lua index 658a7bd4..da3ac2c2 100644 --- a/parts/bot/bot_cc.lua +++ b/parts/bot/bot_cc.lua @@ -51,7 +51,9 @@ function bot_cc:thread() dest[1],dest[2]=dest[3][1],dest[3][2] dest[3],dest[4]=dest[4][1],dest[4][2] P.destFX=dest - if hold then keys[1]=8 end--Hold + if hold then--Hold + keys[1]=8 + end while move[1]do local m=rem(move,1) if m<4 then diff --git a/parts/bot/init.lua b/parts/bot/init.lua index 3ebe23ed..bc9f67c2 100644 --- a/parts/bot/init.lua +++ b/parts/bot/init.lua @@ -91,7 +91,9 @@ function BOT.new(P,data) bot.nexts={} bot.delay=data.delay bot.delay0=data.delay - if P.gameEnv.holdCount>1 then P:setHold(1)end + if P.gameEnv.holdCount>1 then + P:setHold(1) + end local cc=REQUIRE"CCloader" if not cc then diff --git a/parts/data.lua b/parts/data.lua index be311182..462bdb02 100644 --- a/parts/data.lua +++ b/parts/data.lua @@ -54,7 +54,9 @@ function DATA.pasteSequence(str) end end end - if reg then ins(BAG,reg)end + if reg then + ins(BAG,reg) + end return true end @@ -101,8 +103,12 @@ function DATA.copyBoards() return table.concat(out,"!") end function DATA.pasteBoard(str,page)--Paste [str] data to [page] board - if not page then page=1 end - if not FIELD[page]then FIELD[page]=DATA.newBoard()end + if not page then + page=1 + end + if not FIELD[page]then + FIELD[page]=DATA.newBoard() + end local F=FIELD[page] --Decode @@ -212,7 +218,9 @@ function DATA.pasteMission(str) end end end - if reg then ins(MISSION,reg)end + if reg then + ins(MISSION,reg) + end return true end diff --git a/parts/eventsets/master_ph.lua b/parts/eventsets/master_ph.lua index 0d9b8da0..30a608f2 100644 --- a/parts/eventsets/master_ph.lua +++ b/parts/eventsets/master_ph.lua @@ -28,7 +28,9 @@ return P.modeData.target=26 SFX.play('reach') elseif T==26 then--Stage 3: dig to bottom - if not P.holdQueue[1]then P.life=P.life+1 end--1 up if ban hold + if not P.holdQueue[1]then--1 up if ban hold + P.life=P.life+1 + end P.waiting=45 ENV.skin[1],ENV.skin[2]=ENV.skin[2],ENV.skin[1] ENV.skin[3],ENV.skin[4]=ENV.skin[4],ENV.skin[3] diff --git a/parts/eventsets/survivor_e.lua b/parts/eventsets/survivor_e.lua index 943fc33d..f6efc32c 100644 --- a/parts/eventsets/survivor_e.lua +++ b/parts/eventsets/survivor_e.lua @@ -14,7 +14,9 @@ return{ table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1}) P.atkBufferSum=P.atkBufferSum+1 P.stat.recv=P.stat.recv+1 - if D.wave==45 then P:_showText(text.maxspeed,0,-140,100,'appear',.6)end + if D.wave==45 then + P:_showText(text.maxspeed,0,-140,100,'appear',.6) + end D.timer=0 D.wave=D.wave+1 end diff --git a/parts/eventsets/survivor_h.lua b/parts/eventsets/survivor_h.lua index 453a3ef2..bc913b85 100644 --- a/parts/eventsets/survivor_h.lua +++ b/parts/eventsets/survivor_h.lua @@ -21,7 +21,9 @@ return{ end P.atkBufferSum=P.atkBufferSum+s P.stat.recv=P.stat.recv+s - if D.wave==60 then P:_showText(text.maxspeed,0,-140,100,'appear',.6)end + if D.wave==60 then + P:_showText(text.maxspeed,0,-140,100,'appear',.6) + end D.timer=0 D.wave=D.wave+1 end diff --git a/parts/eventsets/survivor_l.lua b/parts/eventsets/survivor_l.lua index 414d0d23..fc11d8b8 100644 --- a/parts/eventsets/survivor_l.lua +++ b/parts/eventsets/survivor_l.lua @@ -15,7 +15,9 @@ return{ table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3}) P.atkBufferSum=P.atkBufferSum+4 P.stat.recv=P.stat.recv+4 - if D.wave==60 then P:_showText(text.maxspeed,0,-140,100,'appear',.6)end + if D.wave==60 then + P:_showText(text.maxspeed,0,-140,100,'appear',.6) + end D.timer=0 D.wave=D.wave+1 end diff --git a/parts/eventsets/survivor_n.lua b/parts/eventsets/survivor_n.lua index 235fd1db..c8a75002 100644 --- a/parts/eventsets/survivor_n.lua +++ b/parts/eventsets/survivor_n.lua @@ -20,7 +20,9 @@ return{ ) P.atkBufferSum=P.atkBufferSum+d%4+1 P.stat.recv=P.stat.recv+d%4+1 - if D.wave==45 then P:_showText(text.maxspeed,0,-140,100,'appear',.6)end + if D.wave==45 then + P:_showText(text.maxspeed,0,-140,100,'appear',.6) + end D.timer=0 D.wave=d end diff --git a/parts/eventsets/survivor_u.lua b/parts/eventsets/survivor_u.lua index 0ed9ed03..79339782 100644 --- a/parts/eventsets/survivor_u.lua +++ b/parts/eventsets/survivor_u.lua @@ -18,7 +18,9 @@ return{ table.insert(P.atkBuffer,{line=generateLine(P.holeRND:random(10)),amount=6,countdown=1.5*t,cd0=1.5*t,time=0,sent=false,lv=5}) P.atkBufferSum=P.atkBufferSum+20 P.stat.recv=P.stat.recv+20 - if D.wave==31 then P:_showText(text.maxspeed,0,-140,100,'appear',.6)end + if D.wave==31 then + P:_showText(text.maxspeed,0,-140,100,'appear',.6) + end D.timer=0 D.wave=D.wave+1 end diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index b54f259a..f93fa4ed 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -116,7 +116,9 @@ function royaleLevelup() for _,P in next,PLY_ALIVE do P.gameEnv.garbageSpeed=.6 end - if PLAYERS[1].alive then BGM.play('cruelty')end + if PLAYERS[1].alive then + BGM.play('cruelty') + end elseif GAME.stage==4 then spd=10 for _,P in next,PLY_ALIVE do @@ -129,7 +131,9 @@ function royaleLevelup() end 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 _,P in next,PLY_ALIVE do P.gameEnv.drop=spd @@ -155,7 +159,9 @@ function generateLine(hole) end function solidLine(L) for i=1,10 do - if L[i]>0 then return true end + if L[i]>0 then + return true + end end end function setField(P,page) @@ -181,7 +187,9 @@ function setField(P,page) end end function freshDate(mode) - if not mode then mode=""end + if not mode then + mode="" + end local date=os.date("%Y/%m/%d") if STAT.date~=date then STAT.date=date @@ -238,7 +246,9 @@ end function destroyPlayers()--Destroy all player objects, restore freerows and free CCs for i=#PLAYERS,1,-1 do 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 FREEROW.discard(rem(P.field)) FREEROW.discard(rem(P.visTime)) @@ -283,7 +293,9 @@ end function loadGame(mode,ifQuickPlay,ifNet)--Load a mode and go to game scene freshDate() if legalGameTime()then - if MODES[mode].score then STAT.lastPlay=mode end + if MODES[mode].score then + STAT.lastPlay=mode + end GAME.playing=true GAME.init=true GAME.fromRepMenu=false @@ -306,7 +318,9 @@ function gameOver()--Save record local R=GAME.curMode.getRank if R then R=R(PLAYERS[1]) - if R and R>0 then GAME.rank=R end + if R and R>0 then + GAME.rank=R + end end end trySave() @@ -333,7 +347,9 @@ function gameOver()--Save record local m=M.unlock[i] local n=MODES[m].name if not RANKS[n]then - if MODES[m].x then RANKS[n]=0 end + if MODES[m].x then + RANKS[n]=0 + end needSave=true end end diff --git a/parts/modes/techmino49_e.lua b/parts/modes/techmino49_e.lua index 831599db..273281da 100644 --- a/parts/modes/techmino49_e.lua +++ b/parts/modes/techmino49_e.lua @@ -33,7 +33,10 @@ return{ local t=2 while t>0 do local r=math.random(2,49) - if L[r]then L[r],t=false,t-1 end + if L[r]then + L[r]=false + t=t-1 + end end local n=2 for _=1,4 do for _=1,6 do diff --git a/parts/modes/techmino49_h.lua b/parts/modes/techmino49_h.lua index d799ca53..077b4843 100644 --- a/parts/modes/techmino49_h.lua +++ b/parts/modes/techmino49_h.lua @@ -33,7 +33,10 @@ return{ local t=4 while t>0 do local r=math.random(2,49) - if L[r]then L[r],t=false,t-1 end + if L[r]then + L[r]=false + t=t-1 + end end local n=2 for _=1,4 do for _=1,6 do diff --git a/parts/modes/techmino49_u.lua b/parts/modes/techmino49_u.lua index cac82c53..ed90d271 100644 --- a/parts/modes/techmino49_u.lua +++ b/parts/modes/techmino49_u.lua @@ -33,7 +33,10 @@ return{ local t=6 while t>0 do local r=math.random(2,49) - if L[r]then L[r],t=false,t-1 end + if L[r]then + L[r]=false + t=t-1 + end end local n=2 for _=1,4 do for _=1,6 do diff --git a/parts/modes/techmino99_e.lua b/parts/modes/techmino99_e.lua index 6678443e..6e8a6060 100644 --- a/parts/modes/techmino99_e.lua +++ b/parts/modes/techmino99_e.lua @@ -33,7 +33,10 @@ return{ local t=4 while t>0 do local r=math.random(2,99) - if L[r]then L[r],t=false,t-1 end + if L[r]then + L[r]=false + t=t-1 + end end local n=2 for _=1,7 do for _=1,7 do diff --git a/parts/modes/techmino99_h.lua b/parts/modes/techmino99_h.lua index 46a1f2e0..1ed3af50 100644 --- a/parts/modes/techmino99_h.lua +++ b/parts/modes/techmino99_h.lua @@ -33,7 +33,10 @@ return{ local t=4 while t>0 do local r=math.random(2,99) - if L[r]then L[r],t=false,t-1 end + if L[r]then + L[r]=false + t=t-1 + end end local n=2 for _=1,7 do for _=1,7 do diff --git a/parts/modes/techmino99_u.lua b/parts/modes/techmino99_u.lua index f1526bc1..d8aae392 100644 --- a/parts/modes/techmino99_u.lua +++ b/parts/modes/techmino99_u.lua @@ -33,7 +33,10 @@ return{ local t=4 while t>0 do local r=math.random(2,99) - if L[r]then L[r],t=false,t-1 end + if L[r]then + L[r]=false + t=t-1 + end end local n=2 for _=1,7 do for _=1,7 do diff --git a/parts/net.lua b/parts/net.lua index bec602c1..d1e0f1bd 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -454,7 +454,9 @@ function NET.updateWS_user() USER.uid=res.uid USER.authToken=res.authToken FILE.save(USER,'conf/user') - if SCN.cur=='login'then SCN.back()end + if SCN.cur=='login'then + SCN.back() + end end MES.new('check',text.loginSuccessed) @@ -549,7 +551,9 @@ function NET.updateWS_play() mode=d.mode, config=d.config, } - if SCN.cur=='net_game'then SCN.socketRead('join',d)end + if SCN.cur=='net_game'then + SCN.socketRead('join',d) + end if NET.roomReadyState=='allReady'then NET.roomReadyState=false end @@ -558,16 +562,22 @@ function NET.updateWS_play() if not d.uid then NET.wsclose_stream() NET.unlock('quit') - if SCN.stack[#SCN.stack-1]=='net_newRoom'then SCN.pop()end + if SCN.stack[#SCN.stack-1]=='net_newRoom'then + SCN.pop() + end SCN.back() else netPLY.remove(d.sid) _removePlayer(PLAYERS,d.sid) _removePlayer(PLY_ALIVE,d.sid) - if SCN.cur=='net_game'then SCN.socketRead('leave',d)end + if SCN.cur=='net_game'then + SCN.socketRead('leave',d) + end end elseif res.action==4 then--Player talk - if SCN.cur=='net_game'then SCN.socketRead('talk',d)end + if SCN.cur=='net_game'then + SCN.socketRead('talk',d) + end elseif res.action==5 then--Player change settings netPLY.setConf(d.uid,d.config) elseif res.action==6 then--Player change join mode @@ -579,7 +589,9 @@ function NET.updateWS_play() NET.roomReadyState='connecting' NET.wsconn_stream(d.srid) elseif res.action==9 then--Game finished - if SCN.cur=='net_game'then SCN.socketRead('finish',d)end + if SCN.cur=='net_game'then + SCN.socketRead('finish',d) + end --d.result: list of {place,survivalTime,uid,score} for _,p in next,d.result do @@ -595,7 +607,9 @@ function NET.updateWS_play() netPLY.resetState() netPLY.freshPos() NET.roomState.start=false - if NET.spectate then NET.signal_setMode(2)end + if NET.spectate then + NET.signal_setMode(2) + end NET.spectate=false NET.wsclose_stream() end diff --git a/parts/player/draw.lua b/parts/player/draw.lua index 3139db69..1b798d64 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -655,7 +655,9 @@ function draw.drawTargetLine(P,r) gc_setColor(1,r>10 and 0 or .2+.8*rnd(),.5) _applyField(P) r=600-30*r - if P.falling~=-1 then r=r-#P.clearingRow*(P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^1.6*30 or 30)end + if P.falling~=-1 then + r=r-#P.clearingRow*(P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^1.6*30 or 30) + end gc_line(0,r,300,r) _cancelField() end @@ -896,7 +898,9 @@ function draw.norm(P,repMode) ENV.mesDisp[i](P,repMode) end - if P.frameRun<180 then _drawStartCounter(P.frameRun)end + if P.frameRun<180 then + _drawStartCounter(P.frameRun) + end gc_pop() end function draw.small(P) @@ -972,7 +976,9 @@ function draw.demo(P) _drawField(P) _drawFXs(P) if P.cur and P.waiting==-1 then - if ENV.ghost then drawGhost[ENV.ghostType](P.cur.bk,P.curX,P.ghoY,ENV.ghost,P.skinLib,curColor)end + if ENV.ghost then + drawGhost[ENV.ghostType](P.cur.bk,P.curX,P.ghoY,ENV.ghost,P.skinLib,curColor) + end if ENV.block then local dy=ENV.smooth and P.ghoY~=P.curY and(P.dropDelay/ENV.drop-1)*30 or 0 gc_translate(0,-dy) diff --git a/parts/player/init.lua b/parts/player/init.lua index cc1a8d48..7248ef7c 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -355,7 +355,9 @@ local function _applyGameEnv(P)--Finish gameEnv processing ENV.bagLine=ENV.bagLine and(ENV.sequence=='bag'or ENV.sequence=='loop')and #ENV.seqData - if ENV.nextCount==0 then ENV.nextPos=false end + if ENV.nextCount==0 then + ENV.nextPos=false + end P.newNext=coroutine.wrap(getSeqGen(P)) P:newNext(P.gameEnv.seqData) diff --git a/parts/player/player.lua b/parts/player/player.lua index 8451846a..15db98e6 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -248,7 +248,9 @@ function Player:set20G(if20g) self:switchKey(14,not if20g) self:switchKey(15,f) self:switchKey(16,f) - if if20g and self.bot then self.bot:switch20G()end + if if20g and self.bot then + self.bot:switch20G() + end end function Player:setHold(count)--Set hold count (false/true as 0/1) if not count then @@ -287,7 +289,9 @@ function Player:setRS(RSname) --Reset all player's blocks' RSs for i=1,#self.nextQueue do self.nextQueue[i].RS=rs end for i=1,#self.holdQueue do self.holdQueue[i].RS=rs end - if self.cur then self.cur.RS=rs end + if self.cur then + self.cur.RS=rs + end end function Player:triggerDropEvents() @@ -323,7 +327,9 @@ function Player:garbageRelease()--Check garbage buffer and try to release them break end end - if flag and self.bot then self.bot:updateField()end + if flag and self.bot then + self.bot:updateField() + end end function Player:garbageRise(color,amount,line)--Release n-lines garbage to field local _ @@ -353,7 +359,9 @@ function Player:garbageRise(color,amount,line)--Release n-lines garbage to field _=self.dropFX[i] _[3],_[5]=_[3]+amount,_[5]+amount end - if #self.field>self.gameEnv.heightLimit then self:lose()end + if #self.field>self.gameEnv.heightLimit then + self:lose() + end end local invList={2,1,4,3,5,6,7} @@ -394,19 +402,29 @@ function Player:getCenterY() return self.curY-C.RS.centerPos[C.id][C.dir][1] end function Player:solid(x,y) - if x<1 or x>10 or y<1 then return true end - if y>#self.field then return false end + if x<1 or x>10 or y<1 then + return true + end + if y>#self.field then + return false + end return self.field[y] [x]>0--to catch bug (nil[*]) end function Player:ifoverlap(bk,x,y) local C=#bk[1] - if x<1 or x+C>11 or y<1 then return true end - if y>#self.field then return end + if x<1 or x+C>11 or y<1 then + return true + end + if y>#self.field then + return + end for i=1,#bk do if self.field[y+i-1]then for j=1,C do - if bk[i][j]and self.field[y+i-1][x+j-1]>0 then return true end + if bk[i][j]and self.field[y+i-1][x+j-1]>0 then + return true + end end end end @@ -443,7 +461,9 @@ end function Player:receive(A,send,time,line) self.lastRecv=A local B=self.atkBuffer - if send+self.atkBufferSum>self.gameEnv.bufferLimit then send=self.gameEnv.bufferLimit-self.atkBufferSum end + if send+self.atkBufferSum>self.gameEnv.bufferLimit then + send=self.gameEnv.bufferLimit-self.atkBufferSum + end if send>0 then local m,k=#B,1 while k<=m and time>B[k].countdown do k=k+1 end @@ -492,7 +512,9 @@ function Player:freshTarget() end end function Player:changeAtkMode(m) - if self.atkMode==m then return end + if self.atkMode==m then + return + end self.atkMode=m if m==1 then self:changeAtk(randomTarget(self)) @@ -507,7 +529,9 @@ function Player:changeAtk(R) if self.atking then local K=self.atking.atker local i=TABLE.find(K,self) - if i then rem(K,i)end + if i then + rem(K,i) + end end if R then self.atking=R @@ -584,7 +608,10 @@ function Player:lock() local CB=self.cur.bk for i=1,#CB do local y=self.curY+i-1 - if not self.field[y]then self.field[y],self.visTime[y]=FREEROW.get(0),FREEROW.get(0)end + if not self.field[y]then + self.field[y]=FREEROW.get(0) + self.visTime[y]=FREEROW.get(0) + end for j=1,#CB[1]do if CB[i][j]then self.field[y][self.curX+j-1]=self.cur.color @@ -742,7 +769,9 @@ function Player:spin(d,ifpre) --Fresh ghost and freshTime local t=self.freshTime - if not ifpre then self:freshBlock('move')end + if not ifpre then + self:freshBlock('move') + end if kickData[test][2]>0 and self.freshTime==t and self.curY~=self.imgY then self.freshTime=self.freshTime-1 end @@ -880,7 +909,9 @@ function Player:getBlock(id,name,color)--Get a block object end function Player:getNext(id)--Push a block to nextQueue ins(self.nextQueue,self:getBlock(id)) - if self.bot then self.bot:pushNewNext(id)end + if self.bot then + self.bot:pushNewNext(id) + end end function Player:popNext(ifhold)--Pop nextQueue to hand local ENV=self.gameEnv @@ -932,7 +963,9 @@ function Player:cancel(N)--Cancel Garbage local off=0--Lines offseted local bf=self.atkBuffer for i=1,#bf do - if self.atkBufferSum==0 or N==0 then break end + if self.atkBufferSum==0 or N==0 then + break + end local A=bf[i] if not A.sent then local O=min(A.amount,N)--Cur Offset @@ -1107,7 +1140,9 @@ do--Player.drop(self)--Place piece if c~=0 then if self:solid(x-1,y-1)then c=c+1 end if self:solid(x+1,y-1)then c=c+1 end - if c>2 then dospin=dospin+2 end + if c>2 then + dospin=dospin+2 + end end end end @@ -1119,7 +1154,9 @@ do--Player.drop(self)--Place piece self:lock() --Clear list of cleared-rows - if self.clearedRow[1]then TABLE.cut(self.clearedRow)end + if self.clearedRow[1]then + TABLE.cut(self.clearedRow) + end --Check line clear cc=cc+self:checkClear(self.field,CY,#CB,CB,CX) @@ -1177,7 +1214,9 @@ do--Player.drop(self)--Place piece --Finesse check (control) local finePts if not finesse then - if dospin then self.ctrlCount=self.ctrlCount-2 end--Allow 2 more step for roof-less spin + if dospin then--Allow 2 more step for roof-less spin + self.ctrlCount=self.ctrlCount-2 + end local id=C.id local d=self.ctrlCount-finesseList[id][C.dir+1][CX] finePts=d<=0 and 5 or max(3-d,0) @@ -1404,14 +1443,18 @@ do--Player.drop(self)--Place piece self:attack(T,send,sendTime,generateLine(self.atkRND:random(10))) end end - if self.sound and send>3 then SFX.play('emit',min(send,7)*.1)end + if self.sound and send>3 then + SFX.play('emit',min(send,7)*.1) + end end --SFX & Vibrate if self.sound then SFX.play(clearSFX[cc]or'clear_4') SFX.play(renSFX[min(cmb,11)]) - if cmb>14 then SFX.play('ren_mega',(cmb-10)*.1)end + if cmb>14 then + SFX.play('ren_mega',(cmb-10)*.1) + end VIB(cc+1) end else--No lines clear @@ -1453,7 +1496,9 @@ do--Player.drop(self)--Place piece end --Speed bonus - if self.dropSpeed>60 then cscore=cscore*(.9+self.dropSpeed/600)end + if self.dropSpeed>60 then + cscore=cscore*(.9+self.dropSpeed/600) + end cscore=int(cscore) self:popScore(cscore) @@ -1470,7 +1515,9 @@ do--Player.drop(self)--Place piece SFX.play('reach') if self.curMission>#ENV.mission then self.curMission=false - if not finish then finish='finish'end + if not finish then + finish='finish' + end end elseif ENV.missionKill then self:_showText(text.missionFailed,0,140,40,'flicker',.5) @@ -1487,7 +1534,9 @@ do--Player.drop(self)--Place piece end --Check height limit - if cc==0 and #self.field>ENV.heightLimit then self:lose()end + if cc==0 and #self.field>ENV.heightLimit then + self:lose() + end --Update stat Stat.piece=Stat.piece+1 @@ -1524,7 +1573,9 @@ do--Player.drop(self)--Place piece self:lose() else self:triggerDropEvents() - if finish then self:win(finish)end + if finish then + self:win(finish) + end end else self:triggerDropEvents() @@ -1563,7 +1614,9 @@ local function task_throwBadge(ifAI,sender,time) SFX.play('collect') end end - if time<=0 then return end + if time<=0 then + return + end end end local function task_finish(self) @@ -1573,7 +1626,9 @@ local function task_finish(self) if self.endCounter<40 then --Make field visible for j=1,#self.field do for i=1,10 do - if self.visTime[j][i]<20 then self.visTime[j][i]=self.visTime[j][i]+.5 end + if self.visTime[j][i]<20 then + self.visTime[j][i]=self.visTime[j][i]+.5 + end end end elseif self.endCounter==60 then return @@ -1587,7 +1642,9 @@ local function task_lose(self) if self.endCounter<40 then --Make field visible for j=1,#self.field do for i=1,10 do - if self.visTime[j][i]<20 then self.visTime[j][i]=self.visTime[j][i]+.5 end + if self.visTime[j][i]<20 then + self.visTime[j][i]=self.visTime[j][i]+.5 + end end end elseif self.endCounter>80 then for i=1,#self.field do @@ -1662,7 +1719,9 @@ function Player:revive() self.field[_],self.visTime[_]=nil end self.garbageBeneath=0 - if self.bot then self.bot:revive()end + if self.bot then + self.bot:revive() + end self:clearAttackBuffer() @@ -1707,13 +1766,24 @@ function Player:win(result) self:newTask(task_finish) end function Player:lose(force) - if self.result then return end + if self.result then + return + end if not force then - if self.life>0 then self:revive()return end - if self.type=='remote'then self.waiting=1e99 return end + if self.life>0 then + self:revive() + return + end + if self.type=='remote'then + self.waiting=1e99 + return + end end self:die() - local p=TABLE.find(PLY_ALIVE,self)if p then rem(PLY_ALIVE,p)end + do + local p=TABLE.find(PLY_ALIVE,self) + if p then rem(PLY_ALIVE,p)end + end self.result='lose' if GAME.modeEnv.royaleMode then self:changeAtk() @@ -1792,8 +1862,12 @@ function Player:act_moveLeft(auto) self:createMoveFX('left') self.curX=self.curX-1 self:freshBlock('move') - if self.sound and self.curY==self.ghoY then SFX.play('move')end - if not auto then self.moving=0 end + if self.sound and self.curY==self.ghoY then + SFX.play('move') + end + if not auto then + self.moving=0 + end self.spinLast=false else self.moving=self.gameEnv.das @@ -1817,8 +1891,12 @@ function Player:act_moveRight(auto) self:createMoveFX('right') self.curX=self.curX+1 self:freshBlock('move') - if self.sound and self.curY==self.ghoY then SFX.play('move')end - if not auto then self.moving=0 end + if self.sound and self.curY==self.ghoY then + SFX.play('move') + end + if not auto then + self.moving=0 + end self.spinLast=false else self.moving=self.gameEnv.das @@ -1924,7 +2002,9 @@ function Player:act_func2() end function Player:act_insLeft(auto) - if not self.cur then return end + if not self.cur then + return + end local x0=self.curX while not self:ifoverlap(self.cur.bk,self.curX-1,self.curY)do self:createMoveFX('left') @@ -1938,13 +2018,17 @@ function Player:act_insLeft(auto) self.fieldOff.vx=-.5 end if auto then - if self.ctrlCount==0 then self.ctrlCount=1 end + if self.ctrlCount==0 then + self.ctrlCount=1 + end else self.ctrlCount=self.ctrlCount+1 end end function Player:act_insRight(auto) - if not self.cur then return end + if not self.cur then + return + end local x0=self.curX while not self:ifoverlap(self.cur.bk,self.curX+1,self.curY)do self:createMoveFX('right') @@ -1958,7 +2042,9 @@ function Player:act_insRight(auto) self.fieldOff.vx=.5 end if auto then - if self.ctrlCount==0 then self.ctrlCount=1 end + if self.ctrlCount==0 then + self.ctrlCount=1 + end else self.ctrlCount=self.ctrlCount+1 end @@ -2005,28 +2091,32 @@ function Player:act_down10() end end function Player:act_dropLeft() - if not self.cur then return end - self:act_insLeft() - self:act_hardDrop() + if self.cur then + self:act_insLeft() + self:act_hardDrop() + end end function Player:act_dropRight() - if not self.cur then return end - self:act_insRight() - self:act_hardDrop() + if self.cur then + self:act_insRight() + self:act_hardDrop() + end end function Player:act_zangiLeft() - if not self.cur then return end - self:act_insLeft() - self:act_insDown() - self:act_insRight() - self:act_hardDrop() + if self.cur then + self:act_insLeft() + self:act_insDown() + self:act_insRight() + self:act_hardDrop() + end end function Player:act_zangiRight() - if not self.cur then return end - self:act_insRight() - self:act_insDown() - self:act_insLeft() - self:act_hardDrop() + if self.cur then + self:act_insRight() + self:act_insDown() + self:act_insLeft() + self:act_hardDrop() + end end Player.actList={ Player.act_moveLeft, --1 diff --git a/parts/player/seqGenerators.lua b/parts/player/seqGenerators.lua index 77f8358f..c708a5ad 100644 --- a/parts/player/seqGenerators.lua +++ b/parts/player/seqGenerators.lua @@ -38,8 +38,11 @@ local seqGenerators={ do break end ::CONTINUE_rollAgain:: end - if history[1]~=0 then P:getNext(seq0[r])end - rem(history,1)ins(history,r) + if history[1]~=0 then + P:getNext(seq0[r]) + end + rem(history,1) + ins(history,r) end yield() end @@ -63,7 +66,11 @@ local seqGenerators={ for i=2,len do if droughtTimes[i]>maxTime then maxTime=droughtTimes[i] - if #droughtList==1 then droughtList[1]=i else droughtList={i}end + if #droughtList==1 then + droughtList[1]=i + else + droughtList={i} + end elseif droughtTimes[i]==maxTime then ins(droughtList,i) end @@ -91,13 +98,18 @@ local seqGenerators={ for i=1,len do if r==history[i]then tryTime=tryTime+1 - if tryTime=last then r=r+1 end + if r>=last then + r=r+1 + end P:getNext(seq0[r]) last=r end diff --git a/parts/player/update.lua b/parts/player/update.lua index 905bc089..dc6da5e6 100644 --- a/parts/player/update.lua +++ b/parts/player/update.lua @@ -13,7 +13,9 @@ local function _updateMisc(P,dt) end --Update spike counter - if P.spikeTime>0 then P.spikeTime=P.spikeTime-1 end + if P.spikeTime>0 then + P.spikeTime=P.spikeTime-1 + end --Update atkBuffer alert local t=P.atkBufferSum1 @@ -114,7 +116,9 @@ local function _updateMisc(P,dt) O.va=O.va*.7-abs(O.a)^1.4*(O.a>0 and .08 or -.08) O.a=O.a+O.va - if abs(O.a)<.0006 then O.a,O.va=0,0 end + if abs(O.a)<.0006 then + O.a,O.va=0,0 + end end --Update texts @@ -142,12 +146,16 @@ function update.alive(P,dt) P.frameRun=P.frameRun+1 if P.frameRun<=180 then if P.frameRun==180 then - if P.id==1 then SFX.play('start')end + if P.id==1 then + SFX.play('start') + end P.control=true P.timing=true P:popNext() elseif P.frameRun==60 or P.frameRun==120 then - if P.id==1 then SFX.play('ready')end + if P.id==1 then + SFX.play('ready') + end end if P.movDir~=0 then if P.moving0 then L[i]=L[i]-1 end + if L[i]>0 then + L[i]=L[i]-1 + end end end end @@ -293,7 +303,9 @@ function update.alive(P,dt) goto THROW_stop else local L=#P.clearingRow - if P.sound and ENV.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play('fall')end + if P.sound and ENV.fall>0 and #P.field+L>P.clearingRow[L]then + SFX.play('fall') + end P.clearingRow={} end end @@ -380,7 +392,9 @@ function update.dead(P,dt) P.falling=P.falling-1 if P.falling<0 then local L=#P.clearingRow - if P.sound and P.gameEnv.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play('fall')end + if P.sound and P.gameEnv.fall>0 and #P.field+L>P.clearingRow[L]then + SFX.play('fall') + end P.clearingRow={} end end diff --git a/parts/scenes/app_15p.lua b/parts/scenes/app_15p.lua index 56b7a3bc..5b2b568a 100644 --- a/parts/scenes/app_15p.lua +++ b/parts/scenes/app_15p.lua @@ -69,7 +69,9 @@ end local function checkBoard(b) for i=4,1,-1 do for j=1,4 do - if b[i][j]~=4*i+j-4 then return false end + if b[i][j]~=4*i+j-4 then + return false + end end end return true diff --git a/parts/scenes/app_2048.lua b/parts/scenes/app_2048.lua index 81af834a..7906fb61 100644 --- a/parts/scenes/app_2048.lua +++ b/parts/scenes/app_2048.lua @@ -119,7 +119,9 @@ local function newTile() end local function freshMaxTile() maxTile=maxTile+1 - if maxTile==12 then skipper.cd=0 end + if maxTile==12 then + skipper.cd=0 + end SFX.play('reach') ins(progress,("%s - %.3fs"):format(tileName[maxTile],TIME()-startTime)) end diff --git a/parts/scenes/app_UTTT.lua b/parts/scenes/app_UTTT.lua index 6429f5e0..ce3face3 100644 --- a/parts/scenes/app_UTTT.lua +++ b/parts/scenes/app_UTTT.lua @@ -233,7 +233,9 @@ end function scene.mouseDown(x,y) scene.mouseMove(x,y) - if curX then place(curX,curx)end + if curX then + place(curX,curx) + end end scene.widgetList={ diff --git a/parts/scenes/app_calc.lua b/parts/scenes/app_calc.lua index 0986bf7a..92f50e69 100644 --- a/parts/scenes/app_calc.lua +++ b/parts/scenes/app_calc.lua @@ -7,6 +7,14 @@ local reg--register local val--result value local sym--symbol +local function _autoReturn() + if reg and sym then + scene.keyDown("return") + else + reg=false + end +end + function scene.sceneInit() BG.set('none') BGM.stop() @@ -27,7 +35,9 @@ function scene.keyDown(key) val=key else if #val<14 then - if val=="0"then val=""end + if val=="0"then + val="" + end val=val..key end end @@ -60,19 +70,25 @@ function scene.keyDown(key) else val=val:sub(1,-2) end - if val==""then val="0"end + if val==""then + val="0" + end elseif key=="+"or key=="="and kb.isDown("lshift","rshift")then - if reg and sym then scene.keyDown("return")else reg=false end sym="+" + _autoReturn() + sym="+" elseif key=="*"or key=="8"and kb.isDown("lshift","rshift")then - if reg and sym then scene.keyDown("return")else reg=false end sym="*" + _autoReturn() + sym="*" elseif key=="-"then - if reg and sym then scene.keyDown("return")else reg=false end sym="-" + _autoReturn() + sym="-" elseif key=="/"then - if reg and sym then scene.keyDown("return")else reg=false end sym="/" + _autoReturn() + sym="/" elseif key=="return"then - if val:sub(-1)=="e"then val=val:sub(1,-2)end + val=val:gsub("e","") if sym and reg then - if reg:sub(-1)=="e"then reg=reg:sub(1,-2)end + reg=reg:gsub("e","") val= sym=="+"and tostring((tonumber(reg)or 0)+tonumber(val))or sym=="-"and tostring((tonumber(reg)or 0)-tonumber(val))or diff --git a/parts/scenes/app_console.lua b/parts/scenes/app_console.lua index 1167a918..84d04d3c 100644 --- a/parts/scenes/app_console.lua +++ b/parts/scenes/app_console.lua @@ -189,7 +189,9 @@ local commands={}do commands.del={ code=function(name) local recursive=name:sub(1,3)=="-s " - if recursive then name=name:sub(4)end + if recursive then + name=name:sub(4) + end if name~=""then local info=love.filesystem.getInfo(name) @@ -240,20 +242,35 @@ local commands={}do --Check file exist local info info=love.filesystem.getInfo(arg[1]) - if not(info and info.type=='file')then log{C.R,("'%s' is not a file!"):format(arg[1])}return end + if not(info and info.type=='file')then + log{C.R,("'%s' is not a file!"):format(arg[1])} + return + end info=love.filesystem.getInfo(arg[2]) - if info then log{C.R,("'%s' already exists!"):format(arg[2])}return end + if info then + log{C.R,("'%s' already exists!"):format(arg[2])} + return + end --Read file local data,err1=love.filesystem.read('data',arg[1]) - if not data then log{C.R,("Failed to read file '%s': "):format(arg[1],err1 or"Unknown error")}return end + if not data then + log{C.R,("Failed to read file '%s': "):format(arg[1],err1 or"Unknown error")} + return + end --Write file local res,err2=love.filesystem.write(arg[2],data) - if not res then log{C.R,("Failed to write file: "):format(err2 or"Unknown error")}return end + if not res then + log{C.R,("Failed to write file: "):format(err2 or"Unknown error")} + return + end --Delete file - if not love.filesystem.remove(arg[1])then log{C.R,("Failed to delete old file ''"):format(arg[1])}return end + if not love.filesystem.remove(arg[1])then + log{C.R,("Failed to delete old file ''"):format(arg[1])} + return + end log{C.Y,("Succesfully renamed file '%s' to '%s'"):format(arg[1],arg[2])} end, @@ -701,7 +718,9 @@ local commands={}do if bool=="sure"then for name,M in next,MODES do if type(name)=='string'and not RANKS[name]and M.x then - if M.x then RANKS[name]=0 end + if M.x then + RANKS[name]=0 + end end end saveProgress() @@ -896,7 +915,10 @@ local fleg={ second_box="Coming soon", }setmetatable(fleg,{__tostring=function()return"The fl\97g."end}) function userG.the_box(k) - if k~=first_key then log"Usage:"log"*The box is locked*"return end + if k~=first_key then + log"Usage:"log"*The box is locked*" + return + end log"*Breaking sound*" userG.the_box,userG.the_key=nil,nil return fleg @@ -923,7 +945,9 @@ function scene.keyDown(key) --Write History ins(history,input) - if history[27]then rem(history,1)end + if history[27]then + rem(history,1) + end hisPtr=nil --Execute @@ -1026,7 +1050,9 @@ function scene.keyDown(key) SCN.back() end else - if not WIDGET.isFocus(inputBox)then WIDGET.focus(inputBox)end + if not WIDGET.isFocus(inputBox)then + WIDGET.focus(inputBox) + end WIDGET.keyPressed(key) end end diff --git a/parts/scenes/app_cubefield.lua b/parts/scenes/app_cubefield.lua index 1d8f6a2d..05444749 100644 --- a/parts/scenes/app_cubefield.lua +++ b/parts/scenes/app_cubefield.lua @@ -179,22 +179,30 @@ function scene.update(dt) life1=life1*.7+life*.3 if play then - if inv>0 then inv=inv-1 end + if inv>0 then + inv=inv-1 + end score=score+dt*.04+life*.0004 life=min(life+dt*.04,1000) if score>1000*level then - if speed<3 then speed=speed+.2 end + if speed<3 then + speed=speed+.2 + end level=level+1 SFX.play('blip_1') end sunH=sunH+.01 elseif menu==1 then ct=ct+1 - if ct==60 then menu=false end + if ct==60 then + menu=false + end elseif menu==-1 then for i=1,3 do color[i]=near(color[i],cubeColor[1][i])end for i=1,40 do cubesY[i]=cubesY[i]-(70-ct)*.003 end - if sunH>0 then sunH=max(sunH*.85-1,0)end + if sunH>0 then + sunH=max(sunH*.85-1,0) + end ct=ct-1 if ct==0 then score=0 diff --git a/parts/scenes/app_pong.lua b/parts/scenes/app_pong.lua index caa09cee..5d566c29 100644 --- a/parts/scenes/app_pong.lua +++ b/parts/scenes/app_pong.lua @@ -86,8 +86,12 @@ function scene.update() P.vy=P.vy*.5 end else - if kb.isDown(P==p1 and"w"or"up")then P.vy=max(P.vy-1,-8)end - if kb.isDown(P==p1 and"s"or"down")then P.vy=min(P.vy+1,8)end + if kb.isDown(P==p1 and"w"or"up")then + P.vy=max(P.vy-1,-8) + end + if kb.isDown(P==p1 and"s"or"down")then + P.vy=min(P.vy+1,8) + end P.y=P.y+P.vy P.vy=P.vy*.9 if P.y>650 then diff --git a/parts/scenes/app_tap.lua b/parts/scenes/app_tap.lua index 8427b194..1e03209c 100644 --- a/parts/scenes/app_tap.lua +++ b/parts/scenes/app_tap.lua @@ -36,7 +36,9 @@ function scene.update() local v=0 for i=2,40 do v=v+i*(i-1)*.075/(t-keyTime[i])end speed=speed*.99+v*.01 - if speed>maxSpeed then maxSpeed=speed end + if speed>maxSpeed then + maxSpeed=speed + end end function scene.draw() diff --git a/parts/scenes/app_ten.lua b/parts/scenes/app_ten.lua index 9ea60cb7..ee96aa3d 100644 --- a/parts/scenes/app_ten.lua +++ b/parts/scenes/app_ten.lua @@ -161,7 +161,9 @@ function scene.keyDown(key,isRep) end function scene.mouseMove(x,y) cx,cy=int((x-192)/128),int((y+88)/128) - if cx<1 or cx>5 or cy<1 or cy>5 then cx,cy=false end + if cx<1 or cx>5 or cy<1 or cy>5 then + cx,cy=false + end end function scene.mouseDown(x,y) scene.mouseMove(x,y) diff --git a/parts/scenes/custom_field.lua b/parts/scenes/custom_field.lua index 87a81b1d..e102aaef 100644 --- a/parts/scenes/custom_field.lua +++ b/parts/scenes/custom_field.lua @@ -125,7 +125,9 @@ function scene.mouseMove(x,y) local sx,sy=int((x-200)/30)+1,20-int((y-60)/30) if sx>=1 and sx<=10 and sy>=1 and sy<=20 then penX,penY=sx,sy - if curPen then _pTouch(sx,sy)end + if curPen then + _pTouch(sx,sy) + end else penX,penY=nil end @@ -256,7 +258,9 @@ function scene.keyUp(key) end function scene.update(dt) - if sure>0 then sure=sure-dt end + if sure>0 then + sure=sure-dt + end end function scene.draw() diff --git a/parts/scenes/custom_mission.lua b/parts/scenes/custom_mission.lua index bb27402a..a56c1f52 100644 --- a/parts/scenes/custom_mission.lua +++ b/parts/scenes/custom_mission.lua @@ -117,7 +117,9 @@ function scene.keyDown(key) end function scene.update(dt) - if sure>0 then sure=sure-dt end + if sure>0 then + sure=sure-dt + end end function scene.draw() diff --git a/parts/scenes/custom_sequence.lua b/parts/scenes/custom_sequence.lua index 4a62272f..9414cce8 100644 --- a/parts/scenes/custom_sequence.lua +++ b/parts/scenes/custom_sequence.lua @@ -120,7 +120,9 @@ function scene.keyDown(key) end function scene.update(dt) - if sure>0 then sure=sure-dt end + if sure>0 then + sure=sure-dt + end end function scene.draw() diff --git a/parts/scenes/error.lua b/parts/scenes/error.lua index b1d55a9b..7fdbcee3 100644 --- a/parts/scenes/error.lua +++ b/parts/scenes/error.lua @@ -16,7 +16,9 @@ function scene.sceneInit() NET.wsclose_user() NET.wsclose_play() NET.wsclose_stream() - if SETTING then SFX.fplay('error',SETTING.voc*.8 or 0)end + if SETTING then + SFX.fplay('error',SETTING.voc*.8 or 0) + end end function scene.draw() diff --git a/parts/scenes/game.lua b/parts/scenes/game.lua index ecf3e2a2..e623724e 100644 --- a/parts/scenes/game.lua +++ b/parts/scenes/game.lua @@ -194,7 +194,9 @@ end function scene.keyDown(key,isRep) if replaying then if key=="space"then - if not isRep then gameRate=gameRate==0 and 1 or 0 end + if not isRep then + gameRate=gameRate==0 and 1 or 0 + end _updateRepButtons() elseif key=="left"then if not isRep then @@ -215,7 +217,9 @@ function scene.keyDown(key,isRep) elseif _checkGameKeyDown(key)then if GAME.tasUsed then if key=="f1"then - if not isRep then gameRate=gameRate==0 and .125 or 0 end + if not isRep then + gameRate=gameRate==0 and .125 or 0 + end _updateRepButtons() elseif key=='f2'then if not isRep then @@ -307,7 +311,9 @@ function scene.update(dt) floatGameRate=floatGameRate+gameRate while floatGameRate>=1 do floatGameRate=floatGameRate-1 - if GAME.replaying then _update_replay(GAME.replaying)end + if GAME.replaying then + _update_replay(GAME.replaying) + end _update_common(dt) end end diff --git a/parts/scenes/mod.lua b/parts/scenes/mod.lua index 59724eaf..82c359e5 100644 --- a/parts/scenes/mod.lua +++ b/parts/scenes/mod.lua @@ -7,7 +7,9 @@ local function _modComp(a,b) end local function _remMod(M) local i=TABLE.find(GAME.mod,M) - if i then rem(GAME.mod,i)end + if i then + rem(GAME.mod,i) + end end local function _toggleMod(M,back) if M.sel==0 then diff --git a/parts/scenes/music.lua b/parts/scenes/music.lua index 6a5987a4..e82429c0 100644 --- a/parts/scenes/music.lua +++ b/parts/scenes/music.lua @@ -48,7 +48,9 @@ function scene.keyDown(key,isRep) if key=="return"or key=="space"then if BGM.nowPlay~=bgmList[S]then BGM.play(bgmList[S]) - if SETTING.bgm>0 then SFX.play('click')end + if SETTING.bgm>0 then + SFX.play('click') + end else BGM.stop() end @@ -66,11 +68,19 @@ function scene.draw() setFont(50) gc.print(bgmList[selected],320,355) setFont(35) - if selected>1 then gc.print(bgmList[selected-1],320,350-30)end - if selected<#bgmList then gc.print(bgmList[selected+1],320,350+65)end + if selected>1 then + gc.print(bgmList[selected-1],320,350-30) + end + if selected<#bgmList then + gc.print(bgmList[selected+1],320,350+65) + end setFont(20) - if selected>2 then gc.print(bgmList[selected-2],320,350-50)end - if selected<#bgmList-1 then gc.print(bgmList[selected+2],320,350+110)end + if selected>2 then + gc.print(bgmList[selected-2],320,350-50) + end + if selected<#bgmList-1 then + gc.print(bgmList[selected+2],320,350+110) + end gc.draw(TEXTURE.title,840,220,nil,.5,nil,580,118) if BGM.nowPlay then diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index aa547405..034cf501 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -68,7 +68,9 @@ function scene.sceneInit(org) upstreamProgress=1 newMessageTimer=0 - if org=='setting_game'then NET.changeConfig()end + if org=='setting_game'then + NET.changeConfig() + end if GAME.prevBG then BG.set(GAME.prevBG) GAME.prevBG=false @@ -311,8 +313,12 @@ function scene.draw() gc_printf(NET.roomState.roomInfo.name,0,685,1270,'right') setFont(40) gc_print(netPLY.getCount().."/"..NET.roomState.capacity,70,655) - if NET.roomState.private then gc_draw(IMG.lock,30,668)end - if NET.roomState.start then gc_setColor(0,1,0)gc_print(text.started,230,655)end + if NET.roomState.private then + gc_draw(IMG.lock,30,668) + end + if NET.roomState.start then + gc_setColor(0,1,0)gc_print(text.started,230,655) + end --Profile drawSelfProfile() diff --git a/parts/scenes/net_newRoom.lua b/parts/scenes/net_newRoom.lua index 089878f8..97420212 100644 --- a/parts/scenes/net_newRoom.lua +++ b/parts/scenes/net_newRoom.lua @@ -29,7 +29,9 @@ local function _createRoom() local pw=passwordBox.value if pw==""then pw=nil end local roomname=STRING.trim(roomNameBox.value) - if #roomname==0 then roomname=(USERS.getUsername(USER.uid)or"Anonymous").."'s room"end + if #roomname==0 then + roomname=(USERS.getUsername(USER.uid)or"Anonymous").."'s room" + end NET.createRoom( roomname, descriptionBox.value, diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index 134b4b8a..f87f5ad3 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -16,7 +16,9 @@ local roomList=WIDGET.newListBox{name="roomList",x=50,y=50,w=800,h=440,lineH=40, gc_rectangle('fill',0,0,800,40) end gc_setColor(1,1,1) - if item.private then gc_draw(IMG.lock,10,5)end + if item.private then + gc_draw(IMG.lock,10,5) + end gc_print(item.count.."/"..item.capacity,670,-4) gc_setColor(.9,.9,1) diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index c38dab47..4baaea23 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -73,8 +73,13 @@ function scene.sceneInit(org) end local f=1 for i=1,6 do - if val[i]>.5 then f=2 end - if val[i]>1 then f=3 break end + if val[i]>.5 then + f=2 + end + if val[i]>1 then + f=3 + break + end end if f==1 then chartColor,f={.4,.9,.5},1.25--Vegetable elseif f==2 then chartColor,f={.4,.7,.9},1 --Normal @@ -177,8 +182,12 @@ function scene.update(dt) if not(GAME.result or GAME.replaying)then GAME.pauseTime=GAME.pauseTime+dt end - if timer1<50 then timer1=timer1+1 end - if timer2<25 then timer2=timer2+1 end + if timer1<50 then + timer1=timer1+1 + end + if timer2<25 then + timer2=timer2+1 + end end local hexList={1,0,.5,1.732*.5,-.5,1.732*.5} @@ -189,7 +198,9 @@ local tasText=gc.newText(getFont(100),"TAS") function scene.draw() local T=timer1*.02 local T2=timer2*.04 - if T<1 or GAME.result then SCN.scenes.game.draw()end + if T<1 or GAME.result then + SCN.scenes.game.draw() + end --Dark BG local _=T diff --git a/parts/scenes/replays.lua b/parts/scenes/replays.lua index 602644bb..9ec707f9 100644 --- a/parts/scenes/replays.lua +++ b/parts/scenes/replays.lua @@ -142,7 +142,9 @@ function scene.keyDown(key) end function scene.update(dt) - if sure>0 then sure=sure-dt end + if sure>0 then + sure=sure-dt + end end function scene.draw() diff --git a/parts/scenes/setting_sound.lua b/parts/scenes/setting_sound.lua index e0754a5f..129d849b 100644 --- a/parts/scenes/setting_sound.lua +++ b/parts/scenes/setting_sound.lua @@ -43,7 +43,9 @@ function scene.touchDown(x,y) end function scene.update() - if jump>0 then jump=jump-1 end + if jump>0 then + jump=jump-1 + end end function scene.draw() @@ -83,7 +85,9 @@ scene.widgetList={ WIDGET.newKey{name="mute", x=1160,y=180,w=80,color='lR',fText=TEXTURE.mute, code=function() if SETTING.sfx+SETTING.sfx_spawn+SETTING.sfx_warn+SETTING.bgm+SETTING.vib+SETTING.voc==0 then - if not soundBeforeMute then soundBeforeMute={1,0,.4,.7,0,0}end + if not soundBeforeMute then + soundBeforeMute={1,0,.4,.7,0,0} + end SETTING.sfx,SETTING.sfx_spawn,SETTING.sfx_warn,SETTING.bgm,SETTING.vib,SETTING.voc=unpack(soundBeforeMute) soundBeforeMute=false else diff --git a/parts/scenes/setting_touch.lua b/parts/scenes/setting_touch.lua index 2dd18aa0..168a1708 100644 --- a/parts/scenes/setting_touch.lua +++ b/parts/scenes/setting_touch.lua @@ -56,7 +56,9 @@ local function _onVK_org(x,y) return nearest end function scene.mouseDown(x,y,k) - if k==1 then scene.touchDown(x,y)end + if k==1 then + scene.touchDown(x,y) + end end function scene.mouseUp() scene.touchUp() diff --git a/parts/scenes/sound.lua b/parts/scenes/sound.lua index 748d9a31..1d04703a 100644 --- a/parts/scenes/sound.lua +++ b/parts/scenes/sound.lua @@ -22,15 +22,23 @@ function scene.keyDown(key,isRep) pc=not pc elseif type(key)=='number'then local CHN=VOC.getFreeChannel() - if mini then VOC.play('mini',CHN)end - if b2b then VOC.play('b2b',CHN) - elseif b3b then VOC.play('b3b',CHN) + if mini then + VOC.play('mini',CHN) + end + if b2b then + VOC.play('b2b',CHN) + elseif b3b then + VOC.play('b3b',CHN) end if key>=10 then VOC.play(blockName[math.floor(key/10)].."spin",CHN) end - if lineCount[key%10]then VOC.play(lineCount[key%10],CHN)end - if pc then VOC.play('perfect_clear',CHN)end + if lineCount[key%10]then + VOC.play(lineCount[key%10],CHN) + end + if pc then + VOC.play('perfect_clear',CHN) + end elseif key=="tab"then SCN.swapTo('music','none') elseif key=="escape"then diff --git a/parts/scenes/staff.lua b/parts/scenes/staff.lua index 89ac0799..4a34cb0f 100644 --- a/parts/scenes/staff.lua +++ b/parts/scenes/staff.lua @@ -96,7 +96,9 @@ function scene.draw() end mDraw(TEXTURE.title_color,640,800-T,nil,.6) mDraw(TEXTURE.title_color,640,2160-T,nil,.6) - if time>50 then gc.print("CLICK ME →",50,550,-.5)end + if time>50 then + gc.print("CLICK ME →",50,550,-.5) + end end scene.widgetList={ diff --git a/parts/skin.lua b/parts/skin.lua index fb0445e5..328b6569 100644 --- a/parts/skin.lua +++ b/parts/skin.lua @@ -36,10 +36,14 @@ function SKIN.init(list) for y=0,2 do for x=1,8 do SKIN.lib[name][8*y+x]=C(30,30) - if I then gc.draw(I,30-30*x,-30*y)end + if I then + gc.draw(I,30-30*x,-30*y) + end SKIN.libMini[name][8*y+x]=C(6,6) - if I then gc.draw(I,6-6*x,-6*y,nil,.2)end + if I then + gc.draw(I,6-6*x,-6*y,nil,.2) + end end end gc.setCanvas()