diff --git a/Zframework/scene.lua b/Zframework/scene.lua index 92442eeb..8e9a7e9c 100644 --- a/Zframework/scene.lua +++ b/Zframework/scene.lua @@ -52,17 +52,17 @@ local swap={ none={1,0,NULL},--swapTime, changeTime, drawFunction flash={8,1,function()gc.clear(1,1,1)end}, fade={30,15,function(t) - local t=t>15 and 2-t/15 or t/15 + t=t>15 and 2-t/15 or t/15 gc.setColor(0,0,0,t) gc.rectangle("fill",0,0,SCR.w,SCR.h) end}, fade_togame={120,20,function(t) - local t=t>20 and(120-t)/100 or t/20 + t=t>20 and(120-t)/100 or t/20 gc.setColor(0,0,0,t) gc.rectangle("fill",0,0,SCR.w,SCR.h) end}, slowFade={180,90,function(t) - local t=t>90 and 2-t/90 or t/90 + t=t>90 and 2-t/90 or t/90 gc.setColor(0,0,0,t) gc.rectangle("fill",0,0,SCR.w,SCR.h) end}, diff --git a/Zframework/toolfunc.lua b/Zframework/toolfunc.lua index c200205c..88672fd1 100644 --- a/Zframework/toolfunc.lua +++ b/Zframework/toolfunc.lua @@ -208,7 +208,7 @@ do--json -- SOFTWARE. -- - local chr=string.char + local char=string.char json = {} ------------------------------------------------------------------------------- @@ -343,14 +343,14 @@ do--json -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa local f = math.floor if n <= 0x7f then - return chr(n) + return char(n) elseif n <= 0x7ff then - return chr(f(n / 64) + 192, n % 64 + 128) + return char(f(n / 64) + 192, n % 64 + 128) elseif n <= 0xffff then - return chr(f(n / 4096) + 224, f(n % 4096 / 64) + 128, + return char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128) elseif n <= 0x10ffff then - return chr(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, + return char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, f(n % 4096 / 64) + 128, n % 64 + 128) end error(string.format("invalid unicode codepoint '%x'", n)) diff --git a/Zframework/voice.lua b/Zframework/voice.lua index 1fafac1f..f77672ae 100644 --- a/Zframework/voice.lua +++ b/Zframework/voice.lua @@ -46,12 +46,12 @@ function VOC.loadAll() end function VOC.getFreeChannel() - local i=#voiceQueue - for i=1,i do + local l=#voiceQueue + for i=1,l do if #voiceQueue[i]==0 then return i end end - voiceQueue[i+1]={s=0} - return i+1 + voiceQueue[l+1]={s=0} + return l+1 end function VOC.getCount() return #voiceQueue @@ -92,8 +92,8 @@ function VOC.update() end elseif Q.s==3 then--Playing 12 same time if not Q[1]:isPlaying()then - for i=1,#Q do - Q[i]=Q[i+1] + for j=1,#Q do + Q[j]=Q[j+1] end Q.s=Q[2]and 2 or 4 end diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 6e58cfd9..25737abf 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -384,8 +384,8 @@ function slider:draw() if not self.smooth then gc.setLineWidth(2) for p=0,self.unit do - local x=x+(x2-x)*p/self.unit - gc.line(x,y+7,x,y-7) + local X=x+(x2-x)*p/self.unit + gc.line(X,y+7,X,y-7) end end @@ -731,8 +731,8 @@ function WIDGET.press(x,y) end elseif W.type=="textBox"then if MOBILE then - local _,y=xOy:transformPoint(0,W.y+W.h) - kb.setTextInput(true,0,y,1,1) + local _,y1=xOy:transformPoint(0,W.y+W.h) + kb.setTextInput(true,0,y1,1,1) end end if W.hide and W.hide()then WIDGET.sel=nil end diff --git a/modes/GM.lua b/modes/GM.lua index 60cb599f..b0b2afba 100644 --- a/modes/GM.lua +++ b/modes/GM.lua @@ -51,7 +51,7 @@ return{ scoreDisp=function(D)return sectionName[int(D[1]*.1)+1].." "..D[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]>b[2]end, getRank=function(P) - local P=P.modeData.point + P=P.modeData.point return P==80 and 5 or P>=70 and 4 or P>=60 and 3 or P>=40 and 2 or P>=20 and 1 or P>=5 and 0 end, } \ No newline at end of file diff --git a/modes/master_advance.lua b/modes/master_advance.lua index 6e769c83..b482096a 100644 --- a/modes/master_advance.lua +++ b/modes/master_advance.lua @@ -18,7 +18,8 @@ local function score(P) SFX.play("blip_1") elseif MD.point>=100*(MD.event+1)then --Level up! - local s=MD.event+1;MD.event=s + s=MD.event+1 + MD.event=s local E=P.gameEnv BG.set(s==1 and"rainbow"or s==2 and"rainbow2"or s==3 and"lightning"or s==4 and"lightning2"or"lightning") E.lock=death_lock[s] diff --git a/modes/master_beginner.lua b/modes/master_beginner.lua index 2877dbbe..4e9dbbc0 100644 --- a/modes/master_beginner.lua +++ b/modes/master_beginner.lua @@ -17,7 +17,8 @@ local function score(P) SFX.play("blip_1") elseif MD.point>=100*(MD.event+1)then --Level up! - local s=MD.event+1;MD.event=s + s=MD.event+1 + MD.event=s local E=P.gameEnv BG.set(s==1 and"bg1"or s==2 and"bg2"or s==3 and"rainbow"or "rainbow2") E.lock=rush_lock[s] diff --git a/modes/master_final.lua b/modes/master_final.lua index a5b3017f..6b410606 100644 --- a/modes/master_final.lua +++ b/modes/master_final.lua @@ -14,7 +14,8 @@ local function score(P) if MD.point%100==99 then SFX.play("blip_1")end if int(MD.point*.01)>MD.event then --Level up! - local s=MD.event+1;MD.event=s + s=MD.event+1 + MD.event=s local E=P.gameEnv if s<4 then P:showTextF(text.stage:gsub("$1",s),0,-120,80,"fly") diff --git a/parts/ai.lua b/parts/ai.lua index 509ff09e..80e7b906 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -151,8 +151,8 @@ local function getScore(field,cb,cy) height[x]=h if x>3 and x<8 and h>highest then highest=h end if h>1 then - for h=h-1,1,-1 do - if field[h][x]==0 then + for h1=h-1,1,-1 do + if field[h1][x]==0 then hole=hole+1 if hole==5 then break end end diff --git a/parts/default_data.lua b/parts/default_data.lua index 567e8215..043092e1 100644 --- a/parts/default_data.lua +++ b/parts/default_data.lua @@ -14,7 +14,7 @@ SETTING={ lang=1, skinSet=1, skin={1,7,11,3,14,4,9,1,7,1,7,11,3,14,4,9,14,9,11,3,11,3,1,7,4}, - face={}, + face={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, --Graphic block=true,ghost=.3,center=1, @@ -56,9 +56,6 @@ SETTING={ VKIcon=true,--If disp icon VKAlpha=.3, } -for i=1,25 do - SETTING.face[i]=0 -end STAT={ version=gameVersion, diff --git a/parts/kickList.lua b/parts/kickList.lua index 059b0204..5188cd34 100644 --- a/parts/kickList.lua +++ b/parts/kickList.lua @@ -6,9 +6,9 @@ local map={} for x=-3,3 do map[x]={}for y=-3,3 do map[x][y]={x,y}end end local function collect(T)--Make all vec point to the same vec if type(T)=="table"then - for _,T in next,T do - for k,vec in next,T do - T[k]=map[vec[1]][vec[2]] + for _,t in next,T do + for k,vec in next,t do + t[k]=map[vec[1]][vec[2]] end end end @@ -42,8 +42,8 @@ local function reflect(a) b[13]=flipList(a[31]) return b end -local function pushZero(T) - for _,L in next,T do +local function pushZero(t) + for _,L in next,t do if type(L)=="table"then for _,v in next,L do table.insert(v,1,zero) @@ -55,8 +55,8 @@ end local TRS do local OspinList={ - {111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},--T - {333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},--T + {111,5,2, 0,-1,0},{111,5,2,-1,-1,0},{111,5,0,-1, 0,0},--t + {333,5,2,-1,-1,0},{333,5,2, 0,-1,0},{333,5,0, 0, 0,0},--t {313,1,2,-1, 0,0},{313,1,2, 0,-1,0},{313,1,2, 0, 0,0},--Z {131,2,2, 0, 0,0},{131,2,2,-1,-1,0},{131,2,2,-1, 0,0},--S {331,3,2, 0,-1,0},{113,3,0, 0, 0,0},{113,3,2,-1, 0,0},--J @@ -114,7 +114,7 @@ do [20]={{ 1, 0},{-1, 0},{ 0,-1}}, [13]={{ 0,-1},{ 0, 1},{ 1, 0},{ 0,-2},{ 0, 2}}, [31]={{ 0,-1},{ 0, 1},{-1, 0},{ 0,-2},{ 0, 2}}, - },--T + },--t function(P,d) if P.human then SFX.fieldPlay("rotate",nil,P)end if not P.gameEnv.ospin then return end @@ -131,7 +131,7 @@ do if D==L[1]then local id,dir=L[2],L[3] local bk=blocks[id][dir] - local x,y=P.curX+L[4],P.curY+L[5] + x,y=P.curX+L[4],P.curY+L[5] if not P:ifoverlap(bk,x,y)and(L[6]>0 or P:ifoverlap(bk,x-1,y)and P:ifoverlap(bk,x+1,y))and(L[6]==2 or P:ifoverlap(bk,x,y-1))and P:ifoverlap(bk,x,y+1)then local C=P.cur C.id=id diff --git a/parts/player.lua b/parts/player.lua index dfc37c4a..9cf00b0a 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -746,10 +746,10 @@ local Pdraw_norm do mText(drawableText.next,378,-15) N=1 while N<=ENV.next and P.next[N]do - local b,c=P.next[N].bk,P.next[N].color - for i=1,#b do for j=1,#b[1] do - if b[i][j]then - gc.draw(blockSkin[c],30*(j+12.6-#b[1]*.5)-30,-30*(i-2.4*N-#b*.5))-- drawCell(i-2.4*N-#b*.5,j+12.6-#b[1]*.5,c) + local bk,clr=P.next[N].bk,P.next[N].color + for i=1,#bk do for j=1,#bk[1] do + if bk[i][j]then + gc.draw(blockSkin[clr],30*(j+12.6-#bk[1]*.5)-30,-30*(i-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr) end end end N=N+1 @@ -2182,9 +2182,9 @@ do--player.drop(P)--Place piece ::L1:: if y then x=CX+x-1 - for y=y0+y,#P.field do + for y1=y0+y,#P.field do --Roof=finesse - if P:solid(x,y)then + if P:solid(x,y1)then finesse=true goto L2 end @@ -2727,9 +2727,9 @@ function player.lose(P) P.killMark=A.id==1 end A.modeData.point,A.badge=A.modeData.point+1,A.badge+P.badge+1 - for i=A.strength+1,4 do - if A.badge>=royaleData.powerUp[i]then - A.strength=i + for j=A.strength+1,4 do + if A.badge>=royaleData.powerUp[j]then + A.strength=j A.frameColor=frameColor[A.strength] end end @@ -3143,7 +3143,6 @@ function PLY.newAIPlayer(id,x,y,size,AIdata) loadGameEnv(P) applyGameEnv(P) - local ENV=P.gameEnv ENV.face={0,0,0,0,0,0,0} ENV.skin={1,5,8,2,10,3,7} prepareSequence(P) diff --git a/parts/scenes.lua b/parts/scenes.lua index 08c5f4e7..8d39ac16 100644 --- a/parts/scenes.lua +++ b/parts/scenes.lua @@ -426,8 +426,7 @@ do--intro } function Pnt.intro() local S=sceneTemp - local t=S.t1 - local T=(t+110)%300 + local T=(S.t1+110)%300 if T<30 then gc.setLineWidth(4+(30-T)^1.626/62) else @@ -437,12 +436,12 @@ do--intro gc.push("transform") gc.translate(126,226) for i=1,8 do - local T=t-i*15 - if T>0 then + local t=S.t1-i*15 + if t>0 then gc.push("transform") - gc.setColor(1,1,1,min(T*.025,1)) - titleTransform[S.r[i]](T,i) - local dt=(t+62-5*i)%300 + gc.setColor(1,1,1,min(t*.025,1)) + titleTransform[S.r[i]](t,i) + local dt=(S.t1+62-5*i)%300 if dt<20 then gc.translate(0,abs(10-dt)-10) end @@ -451,9 +450,8 @@ do--intro end end gc.pop() - t=S.t2 - if t>=80 then - gc.setColor(1,1,1,.6+sin((t-80)*.0626)*.3) + if S.t2>=80 then + gc.setColor(1,1,1,.6+sin((S.t2-80)*.0626)*.3) mText(drawableText.anykey,640,615+sin(Timer()*3)*5) end end @@ -635,12 +633,12 @@ do--mode if kb.isDown("right","d")then x=x+10*k F=true end local js1=joysticks[1] if js1 then - local k=js1:getAxis(1) - if k~="c"then - if k=="u"or k=="ul"or k=="ur"then y=y-10*k F=true end - if k=="d"or k=="dl"or k=="dl"then y=y+10*k F=true end - if k=="l"or k=="ul"or k=="dl"then x=x-10*k F=true end - if k=="r"or k=="ur"or k=="dr"then x=x+10*k F=true end + local dir=js1:getAxis(1) + if dir~="c"then + if dir=="u"or dir=="ul"or dir=="ur"then y=y-10*k F=true end + if dir=="d"or dir=="dl"or dir=="dl"then y=y+10*k F=true end + if dir=="l"or dir=="ul"or dir=="dl"then x=x-10*k F=true end + if dir=="r"or dir=="ur"or dir=="dr"then x=x+10*k F=true end end end end @@ -648,17 +646,17 @@ do--mode if F then cam.keyCtrl=true end - local x,y=(cam.x1-180)/cam.k1,cam.y1/cam.k1 + local x1,y1=(cam.x1-180)/cam.k1,cam.y1/cam.k1 for name,M in next,Modes do if modeRanks[name]then local SEL local s=M.size if M.shape==1 then - if x>M.x-s and xM.y-s and yM.x-s and x1M.y-s and y11120 then - local P=x<160 and S.p1 or S.p2 + P=x<160 and S.p1 or S.p2 local d=y-P.y if abs(d)<60 then vx=-vx-(vx>0 and .05 or -.5)