diff --git a/document/mode.txt b/document/mode.txt index 930c0dde..97675bef 100644 --- a/document/mode.txt +++ b/document/mode.txt @@ -69,7 +69,6 @@ fineKill:是否开启非极简即死 b2bKill:是否开启断b2b即死 missionKill:是否开启强制任务 - target:目标行数,如果dropPiece使用了默认的几个通用通关函数或者自己有一个目标数字就要写 dropPiece:放一块后要执行的函数,输入玩家对象 bg:背景,只能填写内置背景的名字 @@ -116,7 +115,7 @@ return{--返回一个table,你也可以在之前定义一些常量或者函数 color=COLOR.green,--颜色 env={--模式环境变量 drop=60,lock=60, - target=40,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=40 then P:win("finish")end end, bg="bg2",bgm="race", }, load=function()--生成玩家 diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 64676248..93439ce4 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -172,7 +172,6 @@ CUSTOMENV={--gameEnv for cutsom game easyFresh=true, deepDrop=false, visible="show", - target=1e99, freshLimit=1e99, diff --git a/parts/modes/attacker_h.lua b/parts/modes/attacker_h.lua index faa38115..091e61db 100644 --- a/parts/modes/attacker_h.lua +++ b/parts/modes/attacker_h.lua @@ -12,23 +12,23 @@ return{ local p=#P.atkBuffer+1 local B,D=P.atkBuffer,P.modeData local t - if D.event<20 then - t=1500-30*D.event--1500~900 + if D.wave<20 then + t=1500-30*D.wave--1500~900 B[p]= {line=generateLine(P:RND(4,7)),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3} B[p+1]= {line=generateLine(P:RND(3,8)),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4} else - t=900-10*(D.event-20)--900~600 + t=900-10*(D.wave-20)--900~600 B[p]= {line=generateLine(P:RND(10)),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4} B[p+1]= {line=generateLine(P:RND(4,7)),amount=8,countdown=t,cd0=t,time=0,sent=false,lv=5} end B.sum=B.sum+22 P.stat.recv=P.stat.recv+22 - D.event=D.event+1 - if D.event%10==0 then - if D.event==20 then + D.wave=D.wave+1 + if D.wave%10==0 then + if D.wave==20 then P:showTextF(text.great,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=3 - elseif D.event==50 then + elseif D.wave==50 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6) end end @@ -43,16 +43,16 @@ return{ end, mesDisp=function(P) setFont(55) - mStr(P.modeData.event,69,200) + mStr(P.modeData.wave,69,200) mStr("22",69,320) mText(drawableText.wave,69,260) mText(drawableText.nextWave,69,380) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=50 and 5 or W>=40 and 4 or diff --git a/parts/modes/attacker_u.lua b/parts/modes/attacker_u.lua index f7c61d99..c0bf5798 100644 --- a/parts/modes/attacker_u.lua +++ b/parts/modes/attacker_u.lua @@ -11,12 +11,12 @@ return{ local p=#P.atkBuffer+1 local B,D=P.atkBuffer,P.modeData local s - local t=800-10*D.event--800~700~600~500 - if D.event<10 then + local t=800-10*D.wave--800~700~600~500 + if D.wave<10 then B[p]= {line=generateLine(P:RND(5,6)),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3} B[p+1]= {line=generateLine(P:RND(4,7)),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4} s=20 - elseif D.event<20 then + elseif D.wave<20 then B[p]= {line=generateLine(P:RND(3,8)),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4} B[p+1]= {line=generateLine(P:RND(4,7)),amount=13,countdown=t,cd0=t+62,time=0,sent=false,lv=5} s=24 @@ -27,15 +27,15 @@ return{ end B.sum=B.sum+s P.stat.recv=P.stat.recv+s - D.event=D.event+1 - if D.event%10==0 then - if D.event==10 then + D.wave=D.wave+1 + if D.wave%10==0 then + if D.wave==10 then P:showTextF(text.great,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=4 - elseif D.event==20 then + elseif D.wave==20 then P:showTextF(text.awesome,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=5 - elseif D.event==30 then + elseif D.wave==30 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6) end end @@ -50,20 +50,16 @@ return{ end, mesDisp=function(P) setFont(55) - mStr(P.modeData.event,69,200) - mStr( - P.modeData.event<10 and 20 - or P.modeData.event<20 and 24 - or 28 - ,69,320) + mStr(P.modeData.wave,69,200) + mStr(20+4*math.min(math.floor(P.modeData.wave/10),2),69,320) mText(drawableText.wave,69,260) mText(drawableText.nextWave,69,380) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=50 and 5 or W>=40 and 4 or diff --git a/parts/modes/blind_e.lua b/parts/modes/blind_e.lua index 80b8434e..14bfa281 100644 --- a/parts/modes/blind_e.lua +++ b/parts/modes/blind_e.lua @@ -4,9 +4,8 @@ return{ env={ drop=30,lock=45, visible="easy", - dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=20 then P:win("finish")end end, freshLimit=10, - target=200, bg="glow",bgm="reason", }, pauseLimit=true, diff --git a/parts/modes/blind_h.lua b/parts/modes/blind_h.lua index 907cd183..569f39be 100644 --- a/parts/modes/blind_h.lua +++ b/parts/modes/blind_h.lua @@ -8,9 +8,8 @@ return{ dropFX=0,lockFX=0, visible="none", score=false, - dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end, freshLimit=15, - target=200, bg="rgb",bgm="reason", }, pauseLimit=true, diff --git a/parts/modes/blind_l.lua b/parts/modes/blind_l.lua index adf2e438..79f75fed 100644 --- a/parts/modes/blind_l.lua +++ b/parts/modes/blind_l.lua @@ -9,9 +9,8 @@ return{ dropFX=0,lockFX=0, visible="none", score=false, - dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end, freshLimit=15, - target=200, bg="rgb",bgm="reason", }, pauseLimit=true, diff --git a/parts/modes/blind_n.lua b/parts/modes/blind_n.lua index c7f373c9..dc6af9ce 100644 --- a/parts/modes/blind_n.lua +++ b/parts/modes/blind_n.lua @@ -6,8 +6,7 @@ return{ drop=15,lock=45, freshLimit=10, visible="fast", - dropPiece=PLY.check_lineReach, - target=200, + dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end, bg="glow",bgm="reason", }, pauseLimit=true, diff --git a/parts/modes/blind_u.lua b/parts/modes/blind_u.lua index 556cfd29..842bb150 100644 --- a/parts/modes/blind_u.lua +++ b/parts/modes/blind_u.lua @@ -8,9 +8,8 @@ return{ dropFX=0,lockFX=0, visible="none", score=false, - dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, freshLimit=15, - target=100, bg="rgb",bgm="push", }, pauseLimit=true, diff --git a/parts/modes/blind_wtf.lua b/parts/modes/blind_wtf.lua index 6776ba61..815c3b7e 100644 --- a/parts/modes/blind_wtf.lua +++ b/parts/modes/blind_wtf.lua @@ -8,9 +8,8 @@ return{ block=false,center=0,ghost=0, dropFX=0,lockFX=0, visible="none", - dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=40 then P:win("finish")end end, freshLimit=15, - target=40, bg="none",bgm="push", }, pauseLimit=true, diff --git a/parts/modes/c4wtrain_l.lua b/parts/modes/c4wtrain_l.lua index cf13c36b..7126300d 100644 --- a/parts/modes/c4wtrain_l.lua +++ b/parts/modes/c4wtrain_l.lua @@ -1,16 +1,17 @@ -local rnd,min=math.random,math.min +local rnd=math.random local rem=table.remove local function check_c4w(P) if P.lastPiece.row==0 then P:lose() else for _=1,P.lastPiece.row do - P.field[#P.field+1]=FREEROW.get(20) - P.visTime[#P.visTime+1]=FREEROW.get(20) - for i=4,7 do P.field[#P.field][i]=0 end + local h=#P.field + P.field[h+1]=FREEROW.get(20) + P.visTime[h+1]=FREEROW.get(20) + for i=4,7 do P.field[h][i]=0 end end - if P.combo>P.modeData.point then - P.modeData.point=P.combo + if P.combo>P.modeData.maxCombo then + P.modeData.maxCombo=P.combo end if P.stat.row>=100 then P:win("finish") @@ -22,6 +23,7 @@ return{ color=COLOR.red, env={ drop=5,lock=30, + task=function(P)P.modeData.maxCombo=0 end, dropPiece=check_c4w, freshLimit=15,ospin=false, bg="rgb",bgm="oxygen", @@ -55,15 +57,15 @@ return{ mesDisp=function(P) setFont(45) mStr(P.combo,69,310) - mStr(P.modeData.point,69,400) + mStr(P.modeData.maxCombo,69,400) mText(drawableText.combo,69,358) mText(drawableText.maxcmb,69,450) end, - score=function(P)return{min(P.modeData.point,100),P.stat.time}end, + score=function(P)return{math.min(P.modeData.maxCombo,100),P.stat.time}end, scoreDisp=function(D)return D[1].." Combo "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 then for _=1,#P.clearedRow do - P.field[#P.field+1]=FREEROW.get(20) - P.visTime[#P.visTime+1]=FREEROW.get(20) - for i=4,7 do P.field[#P.field][i]=0 end + local h=#P.field + P.field[h+1]=FREEROW.get(20) + P.visTime[h+1]=FREEROW.get(20) + for i=4,7 do P.field[h][i]=0 end end - if P.combo>P.modeData.point then - P.modeData.point=P.combo + if P.combo>P.modeData.maxCombo then + P.modeData.maxCombo=P.combo end if P.stat.row>=100 then P:win("finish") @@ -20,6 +21,7 @@ return{ color=COLOR.green, env={ drop=30,lock=60,infHold=true, + task=function(P)P.modeData.maxCombo=0 end, dropPiece=check_c4w, freshLimit=15,ospin=false, bg="rgb",bgm="oxygen", @@ -53,11 +55,11 @@ return{ mesDisp=function(P) setFont(45) mStr(P.combo,69,310) - mStr(P.modeData.point,69,400) + mStr(P.modeData.maxCombo,69,400) mText(drawableText.combo,69,358) mText(drawableText.maxcmb,69,450) end, - score=function(P)return{min(P.modeData.point,100),P.stat.time}end, + score=function(P)return{math.min(P.modeData.maxCombo,100),P.stat.time}end, scoreDisp=function(D)return D[1].." Combo "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=P.gameEnv.target then - P.gameEnv.target=P.gameEnv.target+10 - if P.gameEnv.target==110 then + task=function(P)P.modeData.target=10 end, + dropPiece=function(P) + local D=P.modeData + if P.stat.row>=D.target then + D.target=D.target+10 + if D.target==110 then P.gameEnv.drop,P.gameEnv.lock=2,2 SFX.play("blip_1") - elseif P.gameEnv.target==200 then + elseif D.target==200 then P.gameEnv.drop,P.gameEnv.lock=1,1 SFX.play("blip_1") else @@ -37,12 +39,12 @@ return{ end, mesDisp=function(P) setFont(75) - local r=P.gameEnv.target*.1 - mStr(r<11 and 18 or r<22 and r+8 or r==22 and"00"or r==23 and"0a"or format("%x",r*10-220),69,210) + local r=P.modeData.target*.1 + mStr(r<11 and 18 or r<22 and r+8 or format("%02x",r*10-220),69,210) mText(drawableText.speedLV,69,290) setFont(45) mStr(P.stat.row,69,320) - mStr(P.gameEnv.target,69,370) + mStr(P.modeData.target,69,370) gc.rectangle("fill",25,375,90,4) end, score=function(P)return{P.stat.score,P.stat.row}end, diff --git a/parts/modes/custom_clear.lua b/parts/modes/custom_clear.lua index 0be505ce..5809db7b 100644 --- a/parts/modes/custom_clear.lua +++ b/parts/modes/custom_clear.lua @@ -1,5 +1,3 @@ -local int=math.floor - local function notAir(L) for i=1,10 do if L[i]>0 then return true end @@ -29,15 +27,16 @@ local function setField(P,page) end local function checkClear(P) if P.garbageBeneath==0 then - P.modeData.point=P.modeData.point+1 - if FIELD[P.modeData.point+1]then + local D=P.modeData + D.finished=D.finished+1 + if FIELD[D.finished+1]then P.waiting=26 for _=#P.field,1,-1 do FREEROW.discard(P.field[_]) FREEROW.discard(P.visTime[_]) P.field[_],P.visTime[_]=nil end - setField(P,P.modeData.point+1) + setField(P,D.finished+1) SYSFX.newShade(1.4,P.absFieldX,P.absFieldY,300*P.size,610*P.size,.6,.8,.6) SFX.play("blip_1") else @@ -69,7 +68,7 @@ return{ PLY.newAIPlayer(2,AIBUILDER("9S",2*AIlevel)) elseif AItype=="CC"then ENV.target=nil - PLY.newAIPlayer(2,AIBUILDER("CC",2*AIlevel-1,int(AIlevel*.5+1),true,20000+5000*AIlevel)) + PLY.newAIPlayer(2,AIBUILDER("CC",2*AIlevel-1,math.floor(AIlevel*.5+1),true,20000+5000*AIlevel)) end for _,P in next,PLAYERS.alive do @@ -78,11 +77,11 @@ return{ end, mesDisp=function(P) setFont(55) - if P.gameEnv.target>1e10 then + if P.modeData.target>1e10 then mStr(P.stat.row,69,225) mText(drawableText.line,69,290) else - local R=P.gameEnv.target-P.stat.row + local R=P.modeData.target-P.stat.row mStr(R>=0 and R or 0,69,240) end end, diff --git a/parts/modes/custom_puzzle.lua b/parts/modes/custom_puzzle.lua index 4f3ecc07..275b8768 100644 --- a/parts/modes/custom_puzzle.lua +++ b/parts/modes/custom_puzzle.lua @@ -1,7 +1,7 @@ local gc=love.graphics -local int=math.floor local function puzzleCheck(P) - local F=FIELD[P.modeData.point+1] + local D=P.modeData + local F=FIELD[D.finished+1] for y=1,20 do local L=P.field[y] for x=1,10 do @@ -14,8 +14,8 @@ local function puzzleCheck(P) end end end - P.modeData.point=P.modeData.point+1 - if FIELD[P.modeData.point+1]then + D.finished=D.finished+1 + if FIELD[D.finished+1]then P.waiting=26 for _=#P.field,1,-1 do FREEROW.discard(P.field[_]) @@ -24,9 +24,9 @@ local function puzzleCheck(P) end SYSFX.newShade(1.4,P.absFieldX,P.absFieldY,300*P.size,610*P.size,.3,1,.3) SFX.play("reach") - P.modeData.event=0 + D.showMark=0 else - P.modeData.event=1 + D.showMark=1 P:win("finish") end end @@ -34,7 +34,7 @@ end return{ color=COLOR.white, env={ - fkey1=function(P)P.modeData.event=1-P.modeData.event end, + fkey1=function(P)P.modeData.showMark=1-P.modeData.showMark end, dropPiece=puzzleCheck, }, load=function() @@ -44,11 +44,9 @@ return{ local AItype=ENV.opponent:sub(1,2) local AIlevel=tonumber(ENV.opponent:sub(-1)) if AItype=="9S"then - ENV.target=nil PLY.newAIPlayer(2,AIBUILDER("9S",2*AIlevel)) elseif AItype=="CC"then - ENV.target=nil - PLY.newAIPlayer(2,AIBUILDER("CC",2*AIlevel-1,int(AIlevel*.5+1),true,20000+5000*AIlevel)) + PLY.newAIPlayer(2,AIBUILDER("CC",2*AIlevel-1,math.floor(AIlevel*.5+1),true,20000+5000*AIlevel)) end end, mesDisp=function(P) @@ -56,9 +54,9 @@ return{ setFont(55) mStr(P.stat.row,69,225) mText(drawableText.line,69,290) - if P.modeData.event==0 then + if P.modeData.showMark==0 then local mark=TEXTURE.puzzleMark - local F=FIELD[P.modeData.point+1] + local F=FIELD[P.modeData.finished+1] for y=1,20 do for x=1,10 do local T=F[y][x] if T~=0 then diff --git a/parts/modes/defender_l.lua b/parts/modes/defender_l.lua index 07872f1c..12d44d08 100644 --- a/parts/modes/defender_l.lua +++ b/parts/modes/defender_l.lua @@ -1,4 +1,3 @@ -local int=math.floor return{ color=COLOR.red, env={ @@ -13,7 +12,7 @@ return{ if P.control and SCN.cur=="play"then local D=P.modeData D.counter=D.counter+1 - local t=math.max(240-2*D.event,40) + local t=math.max(240-2*D.wave,40) if D.counter>=t then D.counter=0 for _=1,4 do @@ -21,18 +20,18 @@ return{ end P.atkBuffer.sum=P.atkBuffer.sum+4 P.stat.recv=P.stat.recv+4 - D.event=D.event+1 - if D.event<=75 then - D.point=int(144e3/t)*.1 - if D.event==25 then + D.wave=D.wave+1 + if D.wave<=75 then + D.rpm=math.floor(144e3/t)*.1 + if D.wave==25 then P:showTextF(text.great,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=3 P.dropDelay,P.gameEnv.drop=4,4 - elseif D.event==50 then + elseif D.wave==50 then P:showTextF(text.awesome,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=4 P.dropDelay,P.gameEnv.drop=3,3 - elseif D.event==75 then + elseif D.wave==75 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6) P.dropDelay,P.gameEnv.drop=2,2 end @@ -49,16 +48,16 @@ return{ end, mesDisp=function(P) setFont(55) - mStr(P.modeData.event,69,200) - mStr(P.modeData.point,69,320) + mStr(P.modeData.wave,69,200) + mStr(P.modeData.rpm,69,320) mText(drawableText.wave,69,260) mText(drawableText.rpm,69,380) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=100 and 5 or W>=80 and 4 or diff --git a/parts/modes/defender_n.lua b/parts/modes/defender_n.lua index 09f5f5b5..fecff8cb 100644 --- a/parts/modes/defender_n.lua +++ b/parts/modes/defender_n.lua @@ -1,4 +1,3 @@ -local int=math.floor return{ color=COLOR.green, env={ @@ -13,7 +12,7 @@ return{ if P.control and SCN.cur=="play"then local D=P.modeData D.counter=D.counter+1 - local t=math.max(360-D.event*2,60) + local t=math.max(360-D.wave*2,60) if D.counter>=t then D.counter=0 for _=1,3 do @@ -21,18 +20,18 @@ return{ end P.atkBuffer.sum=P.atkBuffer.sum+3 P.stat.recv=P.stat.recv+3 - D.event=D.event+1 - if D.event<=90 then - D.point=int(108e3/t)*.1 - if D.event==25 then + D.wave=D.wave+1 + if D.wave<=90 then + D.rpm=math.floor(108e3/t)*.1 + if D.wave==25 then P:showTextF(text.great,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=2 P.dropDelay,P.gameEnv.drop=20,20 - elseif D.event==50 then + elseif D.wave==50 then P:showTextF(text.awesome,0,-140,100,"appear",.6) P.gameEnv.pushSpeed=3 P.dropDelay,P.gameEnv.drop=10,10 - elseif D.event==90 then + elseif D.wave==90 then P.dropDelay,P.gameEnv.drop=5,5 P:showTextF(text.maxspeed,0,-140,100,"appear",.6) end @@ -49,16 +48,16 @@ return{ end, mesDisp=function(P) setFont(55) - mStr(P.modeData.event,69,200) - mStr(P.modeData.point,69,320) + mStr(P.modeData.wave,69,200) + mStr(P.modeData.rpm,69,320) mText(drawableText.wave,69,260) mText(drawableText.rpm,69,380) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=120 and 5 or W>=100 and 4 or diff --git a/parts/modes/dig_h.lua b/parts/modes/dig_h.lua index 54d344c6..a1971249 100644 --- a/parts/modes/dig_h.lua +++ b/parts/modes/dig_h.lua @@ -9,12 +9,12 @@ return{ YIELD() if P.control and SCN.cur=="play"then local D=P.modeData - D.counter=D.counter+1 - if D.counter>=math.max(90,180-D.event)then + D.timer=D.timer+1 + if D.timer>=math.max(90,180-D.wave)then P:garbageRise(21,1,P:getHolePos()) P.stat.recv=P.stat.recv+1 - D.counter=0 - D.event=D.event+1 + D.timer=0 + D.wave=D.wave+1 end end end @@ -27,14 +27,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,310) + mStr(P.modeData.wave,69,310) mText(drawableText.wave,69,375) end, - score=function(P)return{P.modeData.event,P.stat.row}end, + score=function(P)return{P.modeData.wave,P.stat.row}end, scoreDisp=function(D)return D[1].." Waves "..D[2].." Lines"end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=150 and 5 or W>=110 and 4 or diff --git a/parts/modes/dig_u.lua b/parts/modes/dig_u.lua index 1ce165a1..f6ad5bf3 100644 --- a/parts/modes/dig_u.lua +++ b/parts/modes/dig_u.lua @@ -8,12 +8,12 @@ return{ YIELD() if P.control and SCN.cur=="play"then local D=P.modeData - D.counter=D.counter+1 - if D.counter>=math.max(30,80-.3*D.event)then - P:garbageRise(20+D.event%5,1,P:getHolePos()) + D.timer=D.timer+1 + if D.timer>=math.max(30,80-.3*D.wave)then + P:garbageRise(20+D.wave%5,1,P:getHolePos()) P.stat.recv=P.stat.recv+1 - D.counter=0 - D.event=D.event+1 + D.timer=0 + D.wave=D.wave+1 end end end @@ -26,14 +26,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,310) + mStr(P.modeData.wave,69,310) mText(drawableText.wave,69,375) end, - score=function(P)return{P.modeData.event,P.stat.row}end, + score=function(P)return{P.modeData.wave,P.stat.row}end, scoreDisp=function(D)return D[1].." Waves "..D[2].." Lines"end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=150 and 5 or W>=110 and 4 or diff --git a/parts/modes/drought_l.lua b/parts/modes/drought_l.lua index 70b6622a..0ecd1950 100644 --- a/parts/modes/drought_l.lua +++ b/parts/modes/drought_l.lua @@ -92,7 +92,7 @@ return{ end end end, - target=100,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, nextCount=1,holdCount=0, ospin=false, freshLimit=15, diff --git a/parts/modes/drought_n.lua b/parts/modes/drought_n.lua index 3a711daf..81dc2ce5 100644 --- a/parts/modes/drought_n.lua +++ b/parts/modes/drought_n.lua @@ -5,7 +5,7 @@ return{ drop=20,lock=60, sequence="bag", seqData={1,1,2,2,3,3,4,4,5,5,6,6}, - target=100,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, nextCount=3, ospin=false, freshLimit=15, diff --git a/parts/modes/marathon_bfmax.lua b/parts/modes/marathon_bfmax.lua index 1ded1654..657a18c3 100644 --- a/parts/modes/marathon_bfmax.lua +++ b/parts/modes/marathon_bfmax.lua @@ -1,12 +1,13 @@ local gc=love.graphics -local dropSpeed={[0]=60,50,40,30,25,20,15,12,9,7,5,4,3,2,1,1,.5,.5,.25,.25} +local dropSpeed={50,40,30,25,20,15,12,9,7,5,4,3,2,1,1,.5,.5,.25,.25} return{ color=COLOR.yellow, env={ noTele=true, - wait=8,fall=20, - target=10,dropPiece=function(P) + drop=60,wait=8,fall=20, + task=function(P)P.modeData.target=10 end, + dropPiece=function(P) if P.combo>1 or P.b2b>0 or P.lastPiece.row>1 then if P.combo>1 then P:showText("2x",0,-220,40,"flicker",.3)end if P.b2b>0 then P:showText("spin",0,-160,40,"flicker",.3)end @@ -14,13 +15,14 @@ return{ P:lose() return end - local T=P.modeData.point+10 + local T=P.modeData.target if P.stat.row>=T then if T==200 then P:win("finish") else + T=T+10 P.gameEnv.drop=dropSpeed[T/10] - P.modeData.point=T + P.modeData.target=T SFX.play("reach") end end @@ -36,7 +38,7 @@ return{ mesDisp=function(P) setFont(45) mStr(P.stat.row,69,320) - mStr(P.modeData.point+10,69,370) + mStr(P.modeData.target,69,370) gc.rectangle("fill",25,375,90,4) end, getRank=function(P) diff --git a/parts/modes/marathon_h.lua b/parts/modes/marathon_h.lua index 2bfa5fea..5fd2eb63 100644 --- a/parts/modes/marathon_h.lua +++ b/parts/modes/marathon_h.lua @@ -1,20 +1,4 @@ local gc=love.graphics -local function check(P) - if P.stat.row>=P.gameEnv.target then - local T=P.gameEnv.target - if T==50 then - P.gameEnv.drop=.25 - P.gameEnv.target=100 - SFX.play("reach") - elseif T==100 then - P:set20G(true) - P.gameEnv.target=200 - SFX.play("reach") - else - P:win("finish") - end - end -end return{ color=COLOR.magenta, @@ -22,7 +6,24 @@ return{ noTele=true, mindas=7,minarr=1,minsdarr=1, drop=.5,wait=8,fall=20, - target=50,dropPiece=check, + task=function(P)P.modeData.target=50 end, + dropPiece=function(P) + if P.stat.row>=P.modeData.target then + local T=P.modeData.target + if T==50 then + P.gameEnv.drop=.25 + P.modeData.target=100 + SFX.play("reach") + elseif T==100 then + P:set20G(true) + P.modeData.target=200 + SFX.play("reach") + else + P.stat.row=200 + P:win("finish") + end + end + end, bg="cubes",bgm="push", }, pauseLimit=true, @@ -33,7 +34,7 @@ return{ mesDisp=function(P) setFont(45) mStr(P.stat.row,69,320) - mStr(P.gameEnv.target,69,370) + mStr(P.modeData.target,69,370) gc.rectangle("fill",25,375,90,4) end, score=function(P)return{math.min(P.stat.row,200),P.stat.time}end, diff --git a/parts/modes/marathon_n.lua b/parts/modes/marathon_n.lua index 33b482a4..41f41367 100644 --- a/parts/modes/marathon_n.lua +++ b/parts/modes/marathon_n.lua @@ -1,19 +1,21 @@ local gc=love.graphics -local dropSpeed={[0]=60,50,40,30,24,18,14,10,8,6,5,4,3,2,1,1,.5,.5,.25,.25} +local dropSpeed={50,40,30,24,18,14,10,8,6,5,4,3,2,1,1,.5,.5,.25,.25} return{ color=COLOR.green, env={ noTele=true, - wait=8,fall=20, + drop=60,wait=8,fall=20, + task=function(P)P.modeData.target=10 end, dropPiece=function(P) - local T=P.modeData.point+10 + local T=P.modeData.target if P.stat.row>=T then if T==200 then P:win("finish") else + T=T+10 P.gameEnv.drop=dropSpeed[T/10] - P.modeData.point=T + P.modeData.target=T SFX.play("reach") end end @@ -29,7 +31,7 @@ return{ mesDisp=function(P) setFont(45) mStr(P.stat.row,69,320) - mStr(P.modeData.point+10,69,370) + mStr(P.modeData.target+10,69,370) gc.rectangle("fill",25,375,90,4) end, score=function(P)return{math.min(P.stat.row,200),P.stat.time}end, diff --git a/parts/modes/master_advance.lua b/parts/modes/master_advance.lua index f868bd9b..b6e5d1d5 100644 --- a/parts/modes/master_advance.lua +++ b/parts/modes/master_advance.lua @@ -1,38 +1,37 @@ local gc=love.graphics -local int=math.floor local death_lock={12,11,10,9,8} local death_wait={10,9,8,7,6} local death_fall={10,9,8,7,6} local function score(P) - local MD=P.modeData + local D=P.modeData local c=#P.clearedRow - if c==0 and MD.point%100==99 then return end + if c==0 and D.pt%100==99 then return end local s=c<3 and c+1 or c==3 and 5 or 7 if P.combo>7 then s=s+2 elseif P.combo>3 then s=s+1 end - MD.point=MD.point+s + D.pt=D.pt+s - if MD.point%100==99 then + if D.pt%100==99 then SFX.play("blip_1") - elseif MD.point>=100*(MD.event+1)then - --Level up! - s=MD.event+1 - MD.event=s + elseif D.pt>=D.target then--Level up! + s=D.target/100 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] E.wait=death_wait[s] E.fall=death_fall[s] - E.das=int(6.9-s*.4) + E.das=math.floor(6.9-s*.4) if s==3 then - P.gameEnv.bone=true + E.bone=true end + if s==5 then - MD.point,MD.event=500,4 + D.pt=500 P:win("finish") else + D.target=D.target+100 P:showTextF(text.stage:gsub("$1",s),0,-120,80,"fly") end SFX.play("reach") @@ -49,6 +48,10 @@ return{ wait=death_wait[1], fall=death_fall[1], dropPiece=score, + task=function(P) + P.modeData.pt=0 + P.modeData.target=100 + end, freshLimit=15, bg="bg2",bgm="secret7th", }, @@ -58,17 +61,17 @@ return{ end, mesDisp=function(P) setFont(45) - mStr(P.modeData.point,69,320) - mStr((P.modeData.event+1)*100,69,370) + mStr(P.modeData.pt,69,320) + mStr(P.modeData.target,69,370) gc.rectangle("fill",25,375,90,4) end, - score=function(P)return{P.modeData.point,P.stat.time}end, + score=function(P)return{P.modeData.pt,P.stat.time}end, scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end, comp=function(a,b) return a[1]>b[1]or(a[1]==b[1]and a[2]7 then s=s+2 elseif P.combo>3 then s=s+1 end - MD.point=MD.point+s + D.pt=D.pt+s - if MD.point%100==99 then + if D.pt%100==99 then SFX.play("blip_1") - elseif MD.point>=100*(MD.event+1)then - --Level up! - s=MD.event+1 - MD.event=s + elseif D.pt>=D.target then--Level up! + s=D.target/100 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] @@ -26,15 +24,16 @@ local function score(P) E.fall=rush_fall[s] E.das=10-s if s==2 then - P.gameEnv.arr=2 + E.arr=2 elseif s==4 then - P.gameEnv.bone=true + E.bone=true end if s==5 then - MD.point,MD.event=500,4 + D.pt=500 P:win("finish") else + D.target=D.target+100 P:showTextF(text.stage:gsub("$1",s),0,-120,80,"fly") end SFX.play("reach") @@ -51,6 +50,10 @@ return{ wait=rush_wait[1], fall=rush_fall[1], dropPiece=score, + task=function(P) + P.modeData.pt=0 + P.modeData.target=100 + end, freshLimit=15, bg="bg1",bgm="secret8th", }, @@ -60,17 +63,17 @@ return{ end, mesDisp=function(P) setFont(45) - mStr(P.modeData.point,69,320) - mStr((P.modeData.event+1)*100,69,370) + mStr(P.modeData.pt,69,320) + mStr(P.modeData.target,69,370) gc.rectangle("fill",25,375,90,4) end, - score=function(P)return{P.modeData.point,P.stat.time}end, + score=function(P)return{P.modeData.pt,P.stat.time}end, scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end, comp=function(a,b) return a[1]>b[1]or(a[1]==b[1]and a[2]0 then if R==4 then R=10 end--Techrash bonus - P.modeData.rankScore=min(P.modeData.rankScore+R,120) - P.modeData.rankName=sectionName[int(P.modeData.rankScore/10)+1] + P.modeData.rankScore=math.min(P.modeData.rankScore+R,120) + P.modeData.rankName=sectionName[math.floor(P.modeData.rankScore/10)+1] end end end @@ -29,8 +28,8 @@ return{ while true do YIELD() if P.stat.frame>=3600 then - P.modeData.rankScore=min(P.modeData.rankScore+16,140) - P.modeData.rankName=sectionName[int(P.modeData.rankScore*.1)+1] + P.modeData.rankScore=math.min(P.modeData.rankScore+16,140) + P.modeData.rankName=sectionName[math.floor(P.modeData.rankScore*.1)+1] P:win("finish") return end @@ -53,7 +52,7 @@ return{ mStr(P.stat.clears[4],69,340) end, score=function(P)return{P.modeData.rankScore,P.stat.score}end, - scoreDisp=function(D)return sectionName[int(D[1]*.1)+1].." "..D[2]end, + scoreDisp=function(D)return sectionName[math.floor(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) P=P.modeData.rankScore diff --git a/parts/modes/master_final.lua b/parts/modes/master_final.lua index 2ab669fb..8715ad59 100644 --- a/parts/modes/master_final.lua +++ b/parts/modes/master_final.lua @@ -1,21 +1,19 @@ local gc=love.graphics -local int=math.floor local function score(P) - local MD=P.modeData + local D=P.modeData local c=#P.clearedRow - if c==0 and MD.point%100==99 then return end + if c==0 and D.pt%100==99 then return end local s=c<3 and c+1 or c==3 and 5 or 7 if P.combo>7 then s=s+2 elseif P.combo>3 then s=s+1 end - MD.point=MD.point+s + D.pt=D.pt+s - if MD.point%100==99 then SFX.play("blip_1")end - if int(MD.point*.01)>MD.event then - --Level up! - s=MD.event+1 - MD.event=s + if D.pt%100==99 then + SFX.play("blip_1") + elseif D.pt>=D.target then--Level up! + s=D.target/100 local E=P.gameEnv if s<4 then P:showTextF(text.stage:gsub("$1",s),0,-120,80,"fly") @@ -23,6 +21,7 @@ local function score(P) if s~=1 then E.lock=E.lock-1 end if s~=2 then E.wait=E.wait-1 end if s~=3 then E.fall=E.fall-1 end + D.target=D.target+100 elseif s<10 then P:showTextF(text.stage:gsub("$1",s),0,-120,60,"fly",1.26) if s==4 or s==7 then E.das=E.das-1 end @@ -31,8 +30,9 @@ local function score(P) elseif s==1 then E.wait=E.wait-1 elseif s==2 then E.fall=E.fall-1 end + D.target=D.target+100 else - MD.point,MD.event=1000,9 + D.pt=1000 P:win("finish") end SFX.play("reach") @@ -47,6 +47,10 @@ return{ drop=0,lock=12, wait=10,fall=10, dropPiece=score, + task=function(P) + P.modeData.pt=0 + P.modeData.target=100 + end, freshLimit=15, easyFresh=false,bone=true, bg="lightning",bgm="distortion", @@ -57,15 +61,15 @@ return{ end, mesDisp=function(P) setFont(45) - mStr(P.modeData.point,69,320) - mStr((P.modeData.event+1)*100,69,370) + mStr(P.modeData.pt,69,320) + mStr(P.modeData.target,69,370) gc.rectangle("fill",25,375,90,4) end, - score=function(P)return{P.modeData.point,P.stat.time}end, + score=function(P)return{P.modeData.pt,P.stat.time}end, scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=1000 and 5 or S>=800 and 4 or diff --git a/parts/modes/master_phantasm.lua b/parts/modes/master_phantasm.lua index 4a2801de..0313b88a 100644 --- a/parts/modes/master_phantasm.lua +++ b/parts/modes/master_phantasm.lua @@ -9,9 +9,10 @@ return{ wait=10,fall=10, nextCount=2, sequence="his4", - target=12,dropPiece=function(P) - local p=P.modeData.point+P.lastPiece.row - if p>=P.gameEnv.target then + task=function(P)P.modeData.target=12 end, + dropPiece=function(P) + local p=P.modeData.pt+P.lastPiece.row + if p>=P.modeData.target then local ENV=P.gameEnv local T=ENV.target --Stage 1: clear 3 techrash @@ -136,7 +137,7 @@ return{ p=260 end end - P.modeData.point=p + P.modeData.pt=p end, mission={4,4,4,64}, missionKill=true, @@ -149,15 +150,15 @@ return{ end, mesDisp=function(P) setFont(45) - mStr(P.modeData.point,69,320) - mStr(P.gameEnv.target,69,370) + mStr(P.modeData.pt,69,320) + mStr(P.modeData.target,69,370) gc.rectangle("fill",25,375,90,4) end, - score=function(P)return{P.result=="WIN"and 260 or P.modeData.point,P.stat.time}end, + score=function(P)return{P.result=="WIN"and 260 or P.modeData.pt,P.stat.time}end, scoreDisp=function(D)return D[1].."P "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=226 and 4 or diff --git a/parts/modes/pc_h.lua b/parts/modes/pc_h.lua index bb8aa550..e407f2f0 100644 --- a/parts/modes/pc_h.lua +++ b/parts/modes/pc_h.lua @@ -3,7 +3,7 @@ return{ env={ drop=60,lock=120, fall=10, - target=100,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, freshLimit=15, ospin=false, bg="rgb",bgm="truth", diff --git a/parts/modes/pc_l.lua b/parts/modes/pc_l.lua index ac7f605c..0853a79c 100644 --- a/parts/modes/pc_l.lua +++ b/parts/modes/pc_l.lua @@ -3,7 +3,7 @@ return{ env={ drop=20,lock=60, fall=20, - target=100,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, freshLimit=15, ospin=false, bg="rgb",bgm="truth", diff --git a/parts/modes/pc_n.lua b/parts/modes/pc_n.lua index eef9614b..23881c20 100644 --- a/parts/modes/pc_n.lua +++ b/parts/modes/pc_n.lua @@ -3,7 +3,7 @@ return{ env={ infHold=true, drop=150,lock=1e99, - target=100,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, bg="rgb",bgm="truth", }, pauseLimit=true, diff --git a/parts/modes/pctrain_l.lua b/parts/modes/pctrain_l.lua index afbda05b..d7e97d69 100644 --- a/parts/modes/pctrain_l.lua +++ b/parts/modes/pctrain_l.lua @@ -1,4 +1,3 @@ -local int=math.floor local pc_drop={50,45,40,35,30,26,22,18,15,12} local pc_lock={55,50,46,42,39,36,33,31,29,27} local pc_fall={18,16,14,12,10,9,8,7,6,5} @@ -33,7 +32,7 @@ local function check(P) P:newTask(task_PC) local s=P.stat.pc*.25 - if int(s)==s and s>0 then + if math.floor(s)==s and s>0 then P.gameEnv.drop=pc_drop[s]or 10 P.gameEnv.lock=pc_lock[s]or 25 P.gameEnv.fall=pc_fall[s]or 4 diff --git a/parts/modes/sprintFix.lua b/parts/modes/sprintFix.lua index 1ad5bcba..23860685 100644 --- a/parts/modes/sprintFix.lua +++ b/parts/modes/sprintFix.lua @@ -4,8 +4,7 @@ return{ drop=60,lock=180, noTele=true, keyCancel={1,2}, - target=40,dropPiece=PLY.check_lineReach, - bg="aura",bgm="waterfall", + dropPiece=function(P)if P.stat.row>=40 then P:win("finish")end end, bg="aura",bgm="waterfall", }, load=function() PLY.newPlayer(1) diff --git a/parts/modes/sprintLock.lua b/parts/modes/sprintLock.lua index 61b06938..1260c5b4 100644 --- a/parts/modes/sprintLock.lua +++ b/parts/modes/sprintLock.lua @@ -3,7 +3,7 @@ return{ env={ drop=60,lock=180, keyCancel={3,4,5}, - target=40,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, bg="aura",bgm="waterfall", }, load=function() diff --git a/parts/modes/sprintMPH.lua b/parts/modes/sprintMPH.lua index b27af4e1..6d106946 100644 --- a/parts/modes/sprintMPH.lua +++ b/parts/modes/sprintMPH.lua @@ -4,7 +4,7 @@ return{ drop=60,lock=60, nextCount=0,holdCount=0, sequence="rnd", - target=40,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, bg="aura",bgm="waterfall", }, load=function() diff --git a/parts/modes/sprintPenta.lua b/parts/modes/sprintPenta.lua index 8173c719..dbe7e1a3 100644 --- a/parts/modes/sprintPenta.lua +++ b/parts/modes/sprintPenta.lua @@ -3,7 +3,7 @@ return{ env={ drop=60,lock=60, sequence="bag",seqData={8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}, - target=40,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, bg="aura",bgm="waterfall", }, load=function() diff --git a/parts/modes/sprint_1000l.lua b/parts/modes/sprint_1000l.lua index 244f6fca..2a645188 100644 --- a/parts/modes/sprint_1000l.lua +++ b/parts/modes/sprint_1000l.lua @@ -2,8 +2,7 @@ return{ color=COLOR.lGrey, env={ drop=60,lock=60, - target=1000,dropPiece=PLY.check_lineReach, - bg="rainbow",bgm="push", + dropPiece=function(P)if P.stat.row>=1000 then P:win("finish")end end, bg="rainbow",bgm="push", }, load=function() PLY.newPlayer(1) diff --git a/parts/modes/sprint_100l.lua b/parts/modes/sprint_100l.lua index f4aad465..c5168975 100644 --- a/parts/modes/sprint_100l.lua +++ b/parts/modes/sprint_100l.lua @@ -2,8 +2,7 @@ return{ color=COLOR.red, env={ drop=60,lock=60, - target=100,dropPiece=PLY.check_lineReach, - bg="bg2",bgm="race", + dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end, bg="bg2",bgm="race", }, load=function() PLY.newPlayer(1) diff --git a/parts/modes/sprint_10l.lua b/parts/modes/sprint_10l.lua index 4553de2c..7a92a793 100644 --- a/parts/modes/sprint_10l.lua +++ b/parts/modes/sprint_10l.lua @@ -2,7 +2,7 @@ return{ color=COLOR.cyan, env={ drop=60,lock=60, - target=10,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=10 then P:win("finish")end end, bg="bg2",bgm="race", }, load=function() diff --git a/parts/modes/sprint_20l.lua b/parts/modes/sprint_20l.lua index 33c03f24..a5ff6f7f 100644 --- a/parts/modes/sprint_20l.lua +++ b/parts/modes/sprint_20l.lua @@ -2,7 +2,7 @@ return{ color=COLOR.lBlue, env={ drop=60,lock=60, - target=20,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=20 then P:win("finish")end end, bg="bg2",bgm="race", }, load=function() diff --git a/parts/modes/sprint_400l.lua b/parts/modes/sprint_400l.lua index 852c3336..cdb88311 100644 --- a/parts/modes/sprint_400l.lua +++ b/parts/modes/sprint_400l.lua @@ -2,8 +2,7 @@ return{ color=COLOR.dRed, env={ drop=60,lock=60, - target=400,dropPiece=PLY.check_lineReach, - bg="rainbow",bgm="push", + dropPiece=function(P)if P.stat.row>=400 then P:win("finish")end end, bg="rainbow",bgm="push", }, load=function() PLY.newPlayer(1) diff --git a/parts/modes/sprint_40l.lua b/parts/modes/sprint_40l.lua index e83463cb..6f1b8c3f 100644 --- a/parts/modes/sprint_40l.lua +++ b/parts/modes/sprint_40l.lua @@ -2,7 +2,7 @@ return{ color=COLOR.green, env={ drop=60,lock=60, - target=40,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=40 then P:win("finish")end end, bg="bg2",bgm="race", }, load=function() diff --git a/parts/modes/survivor_e.lua b/parts/modes/survivor_e.lua index e66cb483..08078e7d 100644 --- a/parts/modes/survivor_e.lua +++ b/parts/modes/survivor_e.lua @@ -7,14 +7,15 @@ return{ while true do YIELD() if P.control and SCN.cur=="play"then - P.modeData.counter=P.modeData.counter+1 - if P.modeData.counter>=math.max(60,150-2*P.modeData.event)and P.atkBuffer.sum<4 then + local D=P.modeData + D.timer=D.timer+1 + if D.timer>=math.max(60,150-2*D.wave)and P.atkBuffer.sum<4 then P.atkBuffer[#P.atkBuffer+1]={line=generateLine(P:RND(10)),amount=1,countdown=30,cd0=30,time=0,sent=false,lv=1} P.atkBuffer.sum=P.atkBuffer.sum+1 P.stat.recv=P.stat.recv+1 - if P.modeData.event==45 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end - P.modeData.counter=0 - P.modeData.event=P.modeData.event+1 + if D.wave==45 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end + D.timer=0 + D.wave=D.wave+1 end end end @@ -27,14 +28,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,310) + mStr(P.modeData.wave,69,310) mText(drawableText.wave,69,375) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=100 and 5 or W>=60 and 4 or diff --git a/parts/modes/survivor_h.lua b/parts/modes/survivor_h.lua index c3dcb5f5..fe29cfb5 100644 --- a/parts/modes/survivor_h.lua +++ b/parts/modes/survivor_h.lua @@ -7,20 +7,21 @@ return{ while true do YIELD() if P.control and SCN.cur=="play"then - P.modeData.counter=P.modeData.counter+1 + local D=P.modeData + D.timer=D.timer+1 local B=P.atkBuffer - if P.modeData.counter>=math.max(60,180-2*P.modeData.event)and B.sum<15 then + if D.timer>=math.max(60,180-2*D.wave)and B.sum<15 then B[#B+1]= - P.modeData.event%3<2 and + D.wave%3<2 and {line=generateLine(P:RND(10)),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1} or {line=generateLine(P:RND(10)),amount=3,countdown=60,cd0=60,time=0,sent=false,lv=2} - local R=(P.modeData.event%3<2 and 1 or 3) + local R=(D.wave%3<2 and 1 or 3) B.sum=B.sum+R P.stat.recv=P.stat.recv+R - if P.modeData.event==60 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end - P.modeData.counter=0 - P.modeData.event=P.modeData.event+1 + if D.wave==60 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end + D.timer=0 + D.wave=D.wave+1 end end end @@ -33,14 +34,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,310) + mStr(P.modeData.wave,69,310) mText(drawableText.wave,69,375) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=90 and 5 or W>=60 and 4 or diff --git a/parts/modes/survivor_l.lua b/parts/modes/survivor_l.lua index e6d21d42..f77b0c6b 100644 --- a/parts/modes/survivor_l.lua +++ b/parts/modes/survivor_l.lua @@ -7,15 +7,16 @@ return{ while true do YIELD() if P.control and SCN.cur=="play"then - P.modeData.counter=P.modeData.counter+1 - if P.modeData.counter>=math.max(60,150-P.modeData.event)and P.atkBuffer.sum<20 then - local t=math.max(60,90-P.modeData.event) + local D=P.modeData + D.timer=D.timer+1 + if D.timer>=math.max(60,150-D.wave)and P.atkBuffer.sum<20 then + local t=math.max(60,90-D.wave) P.atkBuffer[#P.atkBuffer+1]={line=generateLine(P:RND(10)),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3} P.atkBuffer.sum=P.atkBuffer.sum+4 P.stat.recv=P.stat.recv+4 - if P.modeData.event==60 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end - P.modeData.counter=0 - P.modeData.event=P.modeData.event+1 + if D.wave==60 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end + D.timer=0 + D.wave=D.wave+1 end end end @@ -28,14 +29,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,310) + mStr(P.modeData.wave,69,310) mText(drawableText.wave,69,375) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=110 and 5 or W>=80 and 4 or diff --git a/parts/modes/survivor_n.lua b/parts/modes/survivor_n.lua index 8d5cd704..88a21325 100644 --- a/parts/modes/survivor_n.lua +++ b/parts/modes/survivor_n.lua @@ -7,9 +7,10 @@ return{ while true do YIELD() if P.control and SCN.cur=="play"then - P.modeData.counter=P.modeData.counter+1 - if P.modeData.counter>=math.max(90,180-2*P.modeData.event)and P.atkBuffer.sum<8 then - local d=P.modeData.event+1 + local D=P.modeData + D.timer=D.timer+1 + if D.timer>=math.max(90,180-2*D.wave)and P.atkBuffer.sum<8 then + local d=D.wave+1 P.atkBuffer[#P.atkBuffer+1]= d%4==0 and{line=generateLine(P:RND(10)),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1}or d%4==1 and{line=generateLine(P:RND(10)),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1}or @@ -17,9 +18,9 @@ return{ d%4==3 and{line=generateLine(P:RND(10)),amount=4,countdown=90,cd0=90,time=0,sent=false,lv=3} P.atkBuffer.sum=P.atkBuffer.sum+d%4+1 P.stat.recv=P.stat.recv+d%4+1 - if P.modeData.event==45 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end - P.modeData.counter=0 - P.modeData.event=d + if D.wave==45 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end + D.timer=0 + D.wave=d end end end @@ -32,14 +33,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,310) + mStr(P.modeData.wave,69,310) mText(drawableText.wave,69,375) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=80 and 5 or W>=55 and 4 or diff --git a/parts/modes/survivor_u.lua b/parts/modes/survivor_u.lua index ed888632..37f0a08d 100644 --- a/parts/modes/survivor_u.lua +++ b/parts/modes/survivor_u.lua @@ -9,9 +9,10 @@ return{ while true do YIELD() if P.control and SCN.cur=="play"then - P.modeData.counter=P.modeData.counter+1 - if P.modeData.counter>=math.max(300,600-10*P.modeData.event)and P.atkBuffer.sum<20 then - local t=math.max(300,480-12*P.modeData.event) + local D=P.modeData + D.timer=D.timer+1 + if D.timer>=math.max(300,600-10*D.wave)and P.atkBuffer.sum<20 then + local t=math.max(300,480-12*D.wave) local p=#P.atkBuffer+1 P.atkBuffer[p] ={line=generateLine(P:RND(10)),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=2} P.atkBuffer[p+1]={line=generateLine(P:RND(10)),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3} @@ -19,9 +20,9 @@ return{ P.atkBuffer[p+3]={line=generateLine(P:RND(10)),amount=6,countdown=1.5*t,cd0=1.5*t,time=0,sent=false,lv=5} P.atkBuffer.sum=P.atkBuffer.sum+20 P.stat.recv=P.stat.recv+20 - if P.modeData.event==31 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end - P.modeData.counter=0 - P.modeData.event=P.modeData.event+1 + if D.wave==31 then P:showTextF(text.maxspeed,0,-140,100,"appear",.6)end + D.timer=0 + D.wave=D.wave+1 end end end @@ -34,14 +35,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,310) + mStr(P.modeData.wave,69,310) mText(drawableText.wave,69,375) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.wave,P.stat.time}end, scoreDisp=function(D)return D[1].." Waves "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=35 and 5 or W>=26 and 4 or diff --git a/parts/modes/tech_finesse.lua b/parts/modes/tech_finesse.lua index fd679c0a..684dcfc3 100644 --- a/parts/modes/tech_finesse.lua +++ b/parts/modes/tech_finesse.lua @@ -1,13 +1,12 @@ local format=string.format -local int=math.floor + return{ color=COLOR.lYellow, env={ arr=0, drop=1e99,lock=60, freshLimit=15, - target=200, - dropPiece=PLY.check_attackReach, + function(P)if P.stat.atk>=200 then P:win("finish")end end, fineKill=true, bg="flink",bgm="infinite", }, @@ -22,7 +21,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 then @@ -34,7 +33,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=200 then P:win("finish")end end, bg="matrix",bgm="down", }, load=function() @@ -21,7 +19,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 then @@ -31,7 +30,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=200 then P:win("finish")end end, bg="matrix",bgm="warped", }, load=function() @@ -21,7 +19,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 then @@ -31,7 +30,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=200 then P:win("finish")end end, bg="matrix",bgm="new era", }, load=function() @@ -21,7 +19,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 then @@ -31,7 +30,7 @@ return{ mText(drawableText.atk,69,243) mText(drawableText.eff,69,363) end, - score=function(P)return{P.stat.atk<=200 and int(P.stat.atk)or 200,P.stat.time}end, + score=function(P)return{P.stat.atk<=200 and math.floor(P.stat.atk)or 200,P.stat.time}end, scoreDisp=function(D)return D[1].." Attack "..TIMESTR(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 R=P.modeData.event + local R=P.modeData.place return R==1 and 5 or R<=3 and 4 or diff --git a/parts/modes/techmino49_h.lua b/parts/modes/techmino49_h.lua index 94629b9c..ed0cc7a2 100644 --- a/parts/modes/techmino49_h.lua +++ b/parts/modes/techmino49_h.lua @@ -60,7 +60,7 @@ return{ mesDisp=function(P) setFont(35) mStr(#PLAYERS.alive.."/49",69,175) - mStr(P.modeData.point,80,215) + mStr(P.modeData.ko,80,215) gc.draw(drawableText.ko,23,225) setFont(20) gc.setColor(1,.5,0,.6) @@ -72,11 +72,11 @@ return{ gc.draw(IMG.badgeIcon,16*i+12,260) end end, - score=function(P)return{P.modeData.event,P.modeData.point}end, + score=function(P)return{P.modeData.place,P.modeData.ko}end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, comp=function(a,b)return a[1]b[2]end, getRank=function(P) - local R=P.modeData.event + local R=P.modeData.place return R==1 and 5 or R==2 and 4 or diff --git a/parts/modes/techmino49_u.lua b/parts/modes/techmino49_u.lua index dee4af98..b67bc254 100644 --- a/parts/modes/techmino49_u.lua +++ b/parts/modes/techmino49_u.lua @@ -60,7 +60,7 @@ return{ mesDisp=function(P) setFont(35) mStr(#PLAYERS.alive.."/49",69,175) - mStr(P.modeData.point,80,215) + mStr(P.modeData.ko,80,215) gc.draw(drawableText.ko,23,225) setFont(20) gc.setColor(1,.5,0,.6) @@ -72,11 +72,11 @@ return{ gc.draw(IMG.badgeIcon,16*i+12,260) end end, - score=function(P)return{P.modeData.event,P.modeData.point}end, + score=function(P)return{P.modeData.place,P.modeData.ko}end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, comp=function(a,b)return a[1]b[2]end, getRank=function(P) - local R=P.modeData.event + local R=P.modeData.place return R==1 and 5 or R==2 and 4 or diff --git a/parts/modes/techmino99_e.lua b/parts/modes/techmino99_e.lua index 93afa59a..8311008b 100644 --- a/parts/modes/techmino99_e.lua +++ b/parts/modes/techmino99_e.lua @@ -60,7 +60,7 @@ return{ mesDisp=function(P) setFont(35) mStr(#PLAYERS.alive.."/99",69,175) - mStr(P.modeData.point,80,215) + mStr(P.modeData.ko,80,215) gc.draw(drawableText.ko,23,225) setFont(20) gc.setColor(1,.5,0,.6) @@ -72,11 +72,11 @@ return{ gc.draw(IMG.badgeIcon,16*i+12,260) end end, - score=function(P)return{P.modeData.event,P.modeData.point}end, + score=function(P)return{P.modeData.place,P.modeData.ko}end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, comp=function(a,b)return a[1]b[2]end, getRank=function(P) - local R=P.modeData.event + local R=P.modeData.place return R==1 and 5 or R<=3 and 4 or diff --git a/parts/modes/techmino99_h.lua b/parts/modes/techmino99_h.lua index d550713e..8ef19c4f 100644 --- a/parts/modes/techmino99_h.lua +++ b/parts/modes/techmino99_h.lua @@ -60,7 +60,7 @@ return{ mesDisp=function(P) setFont(35) mStr(#PLAYERS.alive.."/99",69,175) - mStr(P.modeData.point,80,215) + mStr(P.modeData.ko,80,215) gc.draw(drawableText.ko,23,225) setFont(20) gc.setColor(1,.5,0,.6) @@ -72,11 +72,11 @@ return{ gc.draw(IMG.badgeIcon,16*i+12,260) end end, - score=function(P)return{P.modeData.event,P.modeData.point}end, + score=function(P)return{P.modeData.place,P.modeData.ko}end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, comp=function(a,b)return a[1]b[2]end, getRank=function(P) - local R=P.modeData.event + local R=P.modeData.place return R==1 and 5 or R<=3 and 4 or diff --git a/parts/modes/techmino99_u.lua b/parts/modes/techmino99_u.lua index c048556d..6a47a483 100644 --- a/parts/modes/techmino99_u.lua +++ b/parts/modes/techmino99_u.lua @@ -60,7 +60,7 @@ return{ mesDisp=function(P) setFont(35) mStr(#PLAYERS.alive.."/99",69,175) - mStr(P.modeData.point,80,215) + mStr(P.modeData.ko,80,215) gc.draw(drawableText.ko,23,225) setFont(20) gc.setColor(1,.5,0,.6) @@ -72,11 +72,11 @@ return{ gc.draw(IMG.badgeIcon,16*i+12,260) end end, - score=function(P)return{P.modeData.event,P.modeData.point}end, + score=function(P)return{P.modeData.place,P.modeData.ko}end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, comp=function(a,b)return a[1]b[2]end, getRank=function(P) - local R=P.modeData.event + local R=P.modeData.place return R==1 and 5 or R==2 and 4 or diff --git a/parts/modes/tsd_e.lua b/parts/modes/tsd_e.lua index 91ea108a..e5b8c186 100644 --- a/parts/modes/tsd_e.lua +++ b/parts/modes/tsd_e.lua @@ -2,7 +2,7 @@ local function check_tsd(P) local C=P.lastPiece if C.row>0 then if C.id==5 and C.row==2 and C.spin then - P.modeData.event=P.modeData.event+1 + P.modeData.tsd=P.modeData.tsd+1 else P:lose() end @@ -23,14 +23,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,250) + mStr(P.modeData.tsd,69,250) mText(drawableText.tsd,69,315) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.tsd,P.stat.time}end, scoreDisp=function(D)return D[1].."TSD "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=20 and 5 or T>=18 and 4 or diff --git a/parts/modes/tsd_h.lua b/parts/modes/tsd_h.lua index 8f917900..f66e20c8 100644 --- a/parts/modes/tsd_h.lua +++ b/parts/modes/tsd_h.lua @@ -2,7 +2,7 @@ local function check_tsd(P) local C=P.lastPiece if C.row>0 then if C.id==5 and C.row==2 and C.spin then - P.modeData.event=P.modeData.event+1 + P.modeData.tsd=P.modeData.tsd+1 else P:lose() end @@ -24,14 +24,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,250) + mStr(P.modeData.tsd,69,250) mText(drawableText.tsd,69,315) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.tsd,P.stat.time}end, scoreDisp=function(D)return D[1].."TSD "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=21 and 5 or T>=19 and 4 or diff --git a/parts/modes/tsd_u.lua b/parts/modes/tsd_u.lua index 3cc4f56b..563c2033 100644 --- a/parts/modes/tsd_u.lua +++ b/parts/modes/tsd_u.lua @@ -2,7 +2,7 @@ local function check_tsd(P) local C=P.lastPiece if C.row>0 then if C.id==5 and C.row==2 and C.spin then - P.modeData.event=P.modeData.event+1 + P.modeData.tsd=P.modeData.tsd+1 else P:lose() end @@ -24,14 +24,14 @@ return{ end, mesDisp=function(P) setFont(65) - mStr(P.modeData.event,69,250) + mStr(P.modeData.tsd,69,250) mText(drawableText.tsd,69,315) end, - score=function(P)return{P.modeData.event,P.stat.time}end, + score=function(P)return{P.modeData.tsd,P.stat.time}end, scoreDisp=function(D)return D[1].."TSD "..TIMESTR(D[2])end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=20 and 5 or T>=18 and 4 or diff --git a/parts/modes/ultra.lua b/parts/modes/ultra.lua index 5ccbf14e..815e06cc 100644 --- a/parts/modes/ultra.lua +++ b/parts/modes/ultra.lua @@ -8,13 +8,13 @@ return{ drop=60,lock=60, fall=20, task=function(P) + P.modeData.stage=1 while true do YIELD() - local _=P.modeData.counter+1 - if P.stat.time>=warnTime[_]then - if _<9 then - P.modeData.counter=_ - SFX.play("ready",.7+_*.03) + if P.stat.time>=warnTime[P.modeData.stage]then + if P.modeData.stage<9 then + P.modeData.stage=P.modeData.stage+1 + SFX.play("ready",.7+P.modeData.stage*.03) else SFX.play("start") P:win("finish") diff --git a/parts/modes/zen.lua b/parts/modes/zen.lua index 055dc6c5..aab2917d 100644 --- a/parts/modes/zen.lua +++ b/parts/modes/zen.lua @@ -3,7 +3,7 @@ return{ env={ drop=120,lock=120, infHold=true, - target=200,dropPiece=PLY.check_lineReach, + dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end, bg="bg2",bgm="venus", }, load=function() diff --git a/parts/player/draw.lua b/parts/player/draw.lua index d775e2ca..0d1faa0c 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -873,7 +873,7 @@ function draw.small(P) if P.result then gc_setColor(1,1,1,min(P.endCounter,60)*.01) setFont(20)mStr(P.result,32,47) - setFont(15)mStr(P.modeData.event,30,82) + setFont(15)mStr(P.modeData.place,30,82) end gc_pop() gc.setCanvas() diff --git a/parts/player/gameEnv0.lua b/parts/player/gameEnv0.lua index 2144026a..907dc15e 100644 --- a/parts/player/gameEnv0.lua +++ b/parts/player/gameEnv0.lua @@ -54,7 +54,7 @@ return{ fine=false,fineKill=false, b2bKill=false, missionKill=false, - target=1e99,dropPiece=NULL, + dropPiece=NULL, mindas=0,minarr=0,minsdarr=0, bg="none",bgm="race", diff --git a/parts/player/init.lua b/parts/player/init.lua index cf998b7d..5df55a90 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -10,7 +10,14 @@ local PLY={ draw=require"parts.player.draw", } ----------------------------------------------------- +---------------------------------------------------- +local modeDataMeta do + local rawset=rawset + modeDataMeta={ + __index=function(self,k)rawset(self,k,0)return 0 end, + __newindex=function(self,k,v)rawset(self,k,v)end, + } +end local function getNewStatTable() local T={ time=0,frame=0,score=0, @@ -107,7 +114,8 @@ local function newEmptyPlayer(id,mini) P.timing=false P.stat=getNewStatTable() - P.modeData={point=0,event=0,counter=0}--Data use by mode + P.modeData=setmetatable({},modeDataMeta)--Data use by mode + P.keyTime={}P.keySpeed=0 P.dropTime={}P.dropSpeed=0 for i=1,10 do P.keyTime[i]=-1e99 end @@ -320,20 +328,9 @@ local function applyGameEnv(P)--Finish gameEnv processing if ENV.ghost==0 then ENV.ghost=false end if ENV.center==0 then ENV.center=false end end ----------------------------------------------------- +---------------------------------------------------- ---------------------------------------------------- -function PLY.check_lineReach(P) - if P.stat.row>=P.gameEnv.target then - P:win("finish") - end -end -function PLY.check_attackReach(P) - if P.stat.atk>=P.gameEnv.target then - P:win("finish") - end -end - local DemoEnv={ face={0,0,0,0,0,0,0}, das=10,arr=2,sddas=2,sdarr=2, diff --git a/parts/player/player.lua b/parts/player/player.lua index 92bf3155..a002b6a0 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1677,7 +1677,7 @@ function Player.win(P,result) P:die() P.result="WIN" if GAME.modeEnv.royaleMode then - P.modeData.event=1 + P.modeData.place=1 P:changeAtk() end if P.type=="human"then @@ -1750,7 +1750,7 @@ function Player.lose(P,force) P.result="K.O." if GAME.modeEnv.royaleMode then P:changeAtk() - P.modeData.event=#PLAYERS.alive+1 + P.modeData.place=#PLAYERS.alive+1 P.strength=0 if P.lastRecv then local A,i=P,0 @@ -1761,7 +1761,7 @@ function Player.lose(P,force) if P.id==1 or A.id==1 then P.killMark=A.id==1 end - A.modeData.point,A.badge=A.modeData.point+1,A.badge+P.badge+1 + A.modeData.ko,A.badge=A.modeData.ko+1,A.badge+P.badge+1 for j=A.strength+1,4 do if A.badge>=royaleData.powerUp[j]then A.strength=j @@ -1782,7 +1782,7 @@ function Player.lose(P,force) if #PLAYERS.alive==royaleData.stage[GAME.stage]then royaleLevelup() end - P:showTextF(P.modeData.event,0,120,60,"appear",.26,.9) + P:showTextF(P.modeData.place,0,120,60,"appear",.26,.9) end P.gameEnv.keepVisible=P.gameEnv.visible~="show" P:showTextF(text.gameover,0,0,60,"appear",.26,.9) @@ -1791,7 +1791,7 @@ function Player.lose(P,force) SFX.play("fail") VOC.play("lose") if GAME.modeEnv.royaleMode then - if P.modeData.event==2 then + if P.modeData.place==2 then BGM.play("hay what kind of feeling") else BGM.play("end") diff --git a/parts/scenes/app_cmd.lua b/parts/scenes/app_cmd.lua index 180d0804..f709e79d 100644 --- a/parts/scenes/app_cmd.lua +++ b/parts/scenes/app_cmd.lua @@ -1,6 +1,5 @@ local gc=love.graphics local kb=love.keyboard -local int=math.floor local ins,rem=table.insert,table.remove local C=COLOR @@ -256,7 +255,7 @@ do--commands.help(arg) --help or help [page] local page=arg==""and 1 or tonumber(arg) if page then - if page==int(page)and page>=1 and page<=maxPage then + if page==math.floor(page)and page>=1 and page<=maxPage then log"Use help [page] to view more commands," log"or help [command_name] for details of a command." log"" @@ -366,7 +365,7 @@ commands.bye=backScene --Game commands function commands.fn(n) if tonumber(n)then - n=int(tonumber(n)) + n=math.floor(tonumber(n)) if n>=1 and n<=12 then love.keypressed("f"..n) return diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index 4f9eb06b..48d0daf1 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -1,6 +1,4 @@ local gc=love.graphics - -local int=math.floor local sin,log=math.sin,math.log10 local format=string.format @@ -251,7 +249,7 @@ function scene.draw() if M.sel>0 then _=M.color gc.setColor(_[1],_[2],_[3],T) - mStr(M.id,810+M.no%8*60,560+int(M.no/8)*45) + mStr(M.id,810+M.no%8*60,560+math.floor(M.no/8)*45) end end end diff --git a/parts/scenes/setting_control.lua b/parts/scenes/setting_control.lua index 0e0ca29c..8ebb151a 100644 --- a/parts/scenes/setting_control.lua +++ b/parts/scenes/setting_control.lua @@ -1,5 +1,4 @@ local gc=love.graphics -local int=math.floor local scene={} @@ -76,7 +75,7 @@ end local function sliderShow(S) S=S.disp() - return S.."F "..int(S*16.67).."ms" + return S.."F "..math.floor(S*16.67).."ms" end scene.widgetList={ WIDGET.newText{name="title", x=80, y=50,font=70,align="L"}, diff --git a/parts/scenes/setting_game.lua b/parts/scenes/setting_game.lua index db93f1b8..05a25023 100644 --- a/parts/scenes/setting_game.lua +++ b/parts/scenes/setting_game.lua @@ -1,5 +1,4 @@ local gc=love.graphics -local int=math.floor local scene={} @@ -12,7 +11,7 @@ end function scene.draw() local t=TIME() - local b=int(t*2)%16+1 + local b=math.floor(t*2)%16+1 gc.setColor(1,1,1) gc.draw(SKIN.curText[b],710,540,t%6.28319,2,nil,15,15) gc.setColor(1,1,1,t*2%1) diff --git a/parts/scenes/sound.lua b/parts/scenes/sound.lua index 47b42742..e9c0e8f8 100644 --- a/parts/scenes/sound.lua +++ b/parts/scenes/sound.lua @@ -1,5 +1,3 @@ -local int=math.floor - local scene={} local mini,b2b,b3b,pc @@ -28,7 +26,7 @@ function scene.keyDown(key) elseif b3b then VOC.play("b3b",CHN) end if key>=10 then - VOC.play(blockName[int(key/10)].."spin",CHN) + 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