diff --git a/SFX/click.ogg b/SFX/click.ogg new file mode 100644 index 00000000..1a0b9dee Binary files /dev/null and b/SFX/click.ogg differ diff --git a/class.lua b/class.lua index 8765fa24..cef3b092 100644 --- a/class.lua +++ b/class.lua @@ -46,6 +46,9 @@ function newButton(x,y,w,h,color,font,code,hide,N) next=N, }for k,v in next,button do _[k]=v end return _ end +function button:reset() + self.ATV=0 +end function button:isAbove(x,y) return x>self.x-self.ATV and xself.y-self.ATV and y0 then gc.setLineWidth(4) gc.setColor(1,1,1,self.ATV*.125) @@ -95,6 +94,7 @@ end local switch={ type="switch", ATV=0,--activating time(0~8) + CHK=0,--check alpha(0~6) } function newSwitch(x,y,font,disp,code,hide,N) local _={ @@ -105,35 +105,37 @@ function newSwitch(x,y,font,disp,code,hide,N) next=N, }for k,v in next,switch do _[k]=v end return _ end +function switch:reset() + self.ATV=0 + self.CHK=0 +end function switch:isAbove(x,y) return x>self.x and xself.y-25 and y0 then self.ATV=self.ATV-1 end + local _=self.ATV + if widget_sel==self then if _<8 then self.ATV=_+1 end + else if _>0 then self.ATV=_-1 end + end + _=self.CHK + if self:disp()then if _<6 then self.CHK=_+1 end + else if _>0 then self.CHK=_-1 end end end function switch:draw() local x,y=self.x,self.y-25 - if self.disp()then - if self.ATV>0 then - gc.setColor(1,.3,.3,self.ATV*.06) - gc.rectangle("fill",x,y,50,50) - end - gc.setColor(.9,1,.9) + if self.ATV>0 then + gc.setColor(1,1,1,self.ATV*.08) + gc.rectangle("fill",x,y,50,50) + end + if self.CHK>0 then + gc.setColor(.9,1,.9,self.CHK/6) gc.setLineWidth(6) gc.line(x+5,y+25,x+18,y+38,x+45,y+11) - else - if self.ATV>0 then - gc.setColor(.3,1,.3,self.ATV*.06) - gc.rectangle("fill",x,y,50,50) - end end --checked gc.setLineWidth(4) - gc.setColor(1,1,1) + gc.setColor(1,1,1,.6+self.ATV*.05) gc.rectangle("line",x,y,50,50) --frame local t=self.text @@ -164,6 +166,10 @@ function newSlider(x,y,w,unit,font,change,disp,code,hide,N) next=N, }for k,v in next,slider do _[k]=v end return _ end +function slider:reset() + self.ATV=0 + self.pos=0 +end function slider:isAbove(x,y) return x>self.x-10 and xself.y-20 and y0 then self.ATV=self.ATV-1 end end if not(self.hide and self.hide())then - self.pos=self.pos*.8+self.disp()*.2 + self.pos=self.pos*.7+self.disp()*.3 end end function slider:draw() @@ -197,7 +203,7 @@ function slider:draw() gc.printf(t,x-312,y-self.font*.7,300,"right") end --text - local x,y,w,h=x1+(x2-x1)*self.pos/self.unit-10-self.ATV,y-16-self.ATV,20+2*self.ATV,32+2*self.ATV + local x,y,w,h=x1+(x2-x1)*self.pos/self.unit-10-self.ATV*.5,y-16-self.ATV,20+self.ATV,32+2*self.ATV gc.setColor(.8,.8,.8) gc.rectangle("fill",x,y,w,h) if self.ATV>0 then diff --git a/conf.lua b/conf.lua index e10b4418..8ef9f393 100644 --- a/conf.lua +++ b/conf.lua @@ -1,4 +1,4 @@ -gameVersion="Alpha V0.8.4" +gameVersion="Alpha V0.8.5-" function love.conf(t) t.identity="Techmino"--Save directory name t.version="11.1" @@ -17,9 +17,9 @@ function love.conf(t) W.resizable=1 W.fullscreentype="desktop"--"exclusive" W.fullscreen=X - W.vsync=0--0→∞fps + W.vsync=0--0:∞fps W.msaa=X--The number of samples to use with multi-sampled antialiasing (number) - W.depth=X--Bits per sample in the depth buffer + W.depth=0--Bits per sample in the depth buffer W.stencil=1--Bits per sample in the stencil buffer W.display=1--Monitor ID W.highdpi=X--Enable high-dpi mode for the window on a Retina display (boolean) diff --git a/dataList.lua b/dataList.lua index 3d0a93e3..321d2e7d 100644 --- a/dataList.lua +++ b/dataList.lua @@ -2,61 +2,9 @@ local int,rnd,max,min=math.floor,math.random,math.max,math.min local format=string.format local ins,rem=table.insert,table.remove local gc=love.graphics -local PCbase={ - {3,3,3,0,0,0,0,0,2,2}, - {3,6,6,0,0,0,0,2,2,5}, - {4,6,6,0,0,0,1,1,5,5}, - {4,4,4,0,0,0,0,1,1,5}, - {1,1,0,0,0,0,0,4,4,4}, - {5,1,1,0,0,0,0,6,6,4}, - {5,5,2,2,0,0,0,6,6,3}, - {5,2,2,0,0,0,0,3,3,3}, -} -local PClist={ - {7,7,4,5},{7,7,6,4},{7,7,2,4},{7,7,1,3},{7,7,5,6},{7,7,5,2},{7,7,5,4},{7,7,5,3}, - {7,4,1,2},{7,3,5,7},{7,5,4,3},{7,5,1,2},{7,1,4,2},{7,4,2,5},{7,6,4,5},{7,5,4,2}, - {7,5,6,4},{7,5,3,6},{7,2,5,6},{7,2,6,4},{7,2,1,3},{7,5,2,7},{7,5,7,2},{7,5,2,3}, - {7,5,3,2},{7,6,5,4},{7,3,1,5},{7,3,2,5},{7,4,1,5},{7,4,5,2},{7,7,3,6},{7,3,7,6}, - {7,3,6,2},{7,3,7,1},{7,6,4,2},{3,2,7,6},{3,2,6,7},{7,7,4,5},{7,5,3,4},{7,3,6,5}, - {7,3,2,5},{7,4,6,5},{7,5,2,3},{7,3,5,7},{7,3,2,5},{7,3,5,1},{7,5,2,3},{3,6,2,5}, - {3,1,2,5},{3,1,1,5},{3,1,5,2},{3,1,5,1},{3,5,1,2},{4,5,3,2},{4,2,6,5},{6,5,3,2}, - {1,4,2,5},{1,5,3,6},{5,2,6,3},{5,2,1,3},{5,2,7,4},{2,4,1,5},{2,4,5,1},{2,1,4,5}, - {2,5,4,3},{2,5,6,7},{7,5,4,2},{4,5,3,5}, -} -local marathon_drop={[0]=60,48,40,30,24,18,15,12,10,8,7,6,5,4,3,2,1,1,0,0} -local rush_lock={20,18,16,15,14} -local rush_wait={12,10,9,8,7} -local rush_fall={18,16,14,13,12} -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 pc_drop={50,45,40,35,30,26,22,18,15,12} -local pc_lock={55,50,45,40,36,32,30} -local pc_fall={18,16,14,12,10,9,8,7,6} -local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"} -local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} - -local Fkey_func={ - royale=function(P) - if setting.swap then - for i=1,#P.keyPressing do - if P.keyPressing[i]then - P.keyPressing[i]=false - end - end - P.keyPressing[9]=true - else - P:changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode) - P.swappingAtkMode=30 - end - end, - puzzle=function(P) - P.modeData.event=1-P.modeData.event - end, -} local AISpeed={60,50,45,35,25,15,9,6,4,2} -local function AITemplate(type,speedLV,next,hold,node) +function AITemplate(type,speedLV,next,hold,node) if type=="CC"then return{ type="CC", @@ -73,24 +21,52 @@ local function AITemplate(type,speedLV,next,hold,node) end end -------------------------------------------------- -Event={null=NULL} -function Event.reach_winCheck(P) - if P.stat.row>=P.gameEnv.target then - Event.win(P,"finish") +local function gameOver() + local M=curMode + if M.score then + local P=players[1] + local D=M.score(P) + local L=M.records + local p=#L--排名数-1 + if p>0 then + ::L:: + if M.comp(D,L[p])then--是否靠前 + p=p-1 + if p>0 then + goto L + end + end + end + if p<10 then + if p==0 then + P:showText(text.newRecord,0,-100,100,"beat",.5) + end + ins(L,p+1,D) + if L[11]then L[11]=nil end + saveRecord(M.saveFileName,L) + end + local R=M.getRank(P)--new rank + if R then + local r=modeRanks[M.id]--old rank + if R>r then + modeRanks[M.id]=R + if r==0 then + for i=1,#M.unlock do + local m=M.unlock[i] + modeRanks[m]=modes[m].score and 0 or 6 + end + end + end + end end -end -function Event.win(P,result) +end--Save record +local function die(P) P.alive=false P.control=false P.timing=false P.waiting=1e99 P.b2b=0 clearTask(P) - if modeEnv.royaleMode then - P.rank=1 - P.result="WIN" - P:changeAtk() - end for i=1,#P.atkBuffer do P.atkBuffer[i].sent=true P.atkBuffer[i].time=0 @@ -100,6 +76,20 @@ function Event.win(P,result) P.visTime[i][j]=min(P.visTime[i][j],20) end end +end--Same thing when win/lose/finish +Event={} +function Event.reach_winCheck(P) + if P.stat.row>=P.gameEnv.target then + Event.win(P,"finish") + end +end +function Event.win(P,result) + die(P) + P.result="WIN" + if modeEnv.royaleMode then + P.rank=1 + P:changeAtk() + end if P.human then gameResult=result or"win" SFX("win") @@ -109,11 +99,14 @@ function Event.win(P,result) end end newTask(Event_task.finish,P) - if curMode.id=="custom"then + if curMode.id=="custom_puzzle"then P:showText(text.win,0,0,90,"beat",.4) else P:showText(text.win,0,0,90,"beat",.5,.2) end + if P.human then + gameOver() + end end function Event.lose(P) if P.invincible then @@ -126,23 +119,16 @@ function Event.lose(P) end return end - P.alive=false - P.control=false - P.timing=false - P.waiting=1e99 - P.b2b=0 - clearTask(P) + die(P) for i=1,#players.alive do if players.alive[i]==P then - for k=i,#players.alive do - players.alive[k]=players.alive[k+1] - end + rem(players.alive,i) break end end + P.result="K.O." if modeEnv.royaleMode then P:changeAtk() - P.result="K.O." P.rank=#players.alive+1 P:showText(P.rank,0,-120,60,"appear",1,12) P.strength=0 @@ -157,7 +143,7 @@ function Event.lose(P) end A.ko,A.badge=A.ko+1,A.badge+P.badge+1 for i=A.strength+1,4 do - if A.badge>=modeEnv.royalePowerup[i]then + if A.badge>=royaleData.powerUp[i]then A.strength=i end end @@ -176,19 +162,10 @@ function Event.lose(P) players.alive[i]:freshTarget() end end - if #players.alive==modeEnv.royaleRemain[gameStage]then + if #players.alive==royaleData.stage[gameStage]then royaleLevelup() end end - for i=1,#P.atkBuffer do - P.atkBuffer[i].sent=true - P.atkBuffer[i].time=0 - end - for i=1,#P.field do - for j=1,10 do - P.visTime[i][j]=min(P.visTime[i][j],20) - end - end P.gameEnv.keepVisible=P.gameEnv.visible~="show" P:showText(text.lose,0,0,90,"appear",.5,.2) if P.human then @@ -200,265 +177,19 @@ function Event.lose(P) if #players.alive==1 then Event.win(players.alive[1]) end - if #players>1 then - newTask(Event_task.lose,P) - else - newTask(Event_task.finish,P) + if #players==1 or(P.human and not players[2].human)then + gameOver() end -end -function Event.marathon_update(P) - if P.stat.row>=P.gameEnv.target then - local s=int(P.stat.row*.1) - if s>=20 then - P.stat.row=200 - Event.win(P) - else - P.gameEnv.drop=marathon_drop[s] - if s==18 then P.gameEnv._20G=true end - P.gameEnv.target=s*10+10 - SFX("reach") - end - end -end -function Event.master_score(P) - local c=#P.cleared - if c==0 and P.modeData.point%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 - P.modeData.point=P.modeData.point+s - if P.modeData.point%100==99 then - SFX("blip_1") - elseif P.modeData.point>=100*(P.modeData.event+1)then - local s=P.modeData.event+1;P.modeData.event=s--level up! - local E=P.gameEnv - local mode=curMode.lv - if mode==1 then - curBG=s==1 and"game1"or s==2 and"game2"or s==3 and"game3"or "game4" - E.lock=rush_lock[s] - E.wait=rush_wait[s] - E.fall=rush_fall[s] - E.das=10-s - if s==2 then P.gameEnv.arr=2 end - if s==4 then P.gameEnv.bone=true end - elseif mode==2 then - curBG=s==1 and"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"or"game5" - E.lock=death_lock[s] - E.wait=death_wait[s] - E.fall=death_fall[s] - E.das=int(6.9-s*.4) - if s==3 then P.gameEnv.bone=true end - end - if s==5 then - P.modeData.point,P.modeData.event=500,4 - Event.win(P) - else - P:showText(text.stage(s),0,-120,80,"fly") - end - SFX("reach") - end -end -function Event.master_score_hard(P) - local c=#P.cleared - if c==0 then return end - local s - if P.lastClear<10 then - s=c - else - s=c<3 and c+1 or c<5 and 6 or 10 - end - if P.combo>9 then s=s+2 - elseif P.combo>4 then s=s+1 - end - P.modeData.point=P.modeData.point+s - if P.modeData.point%100==99 then SFX("blip_1")end - if int(P.modeData.point*.01)>P.modeData.event then - local s=P.modeData.event+1;P.modeData.event=s--level up! - P:showText(text.stage(s),0,-120,80,"fly") - if s<4 then--first 300 - if s~=1 then P.gameEnv.lock=P.gameEnv.lock-1 end - if s~=2 then P.gameEnv.wait=P.gameEnv.wait-1 end - if s~=3 then P.gameEnv.fall=P.gameEnv.fall-1 end - elseif s<10 then - if s==4 or s==7 then P.gameEnv.das=P.gameEnv.das-1 end - s=s%3 - if s==0 then - P.gameEnv.lock=P.gameEnv.lock-1 - elseif s==1 then - P.gameEnv.wait=P.gameEnv.wait-1 - elseif s==2 then - P.gameEnv.fall=P.gameEnv.fall-1 - end - else - P.modeData.point,P.modeData.event=1000,9 - Event.win(P) - end - SFX("reach") - end -end -function Event.classic_reach(P) - if P.stat.row>=P.gameEnv.target then - P.gameEnv.target=P.gameEnv.target+10 - if P.gameEnv.target==110 then - P.gameEnv.drop,P.gameEnv.lock=2,2 - elseif P.gameEnv.target==200 then - P.gameEnv.drop,P.gameEnv.lock=1,1 - end - if P.gameEnv.target>100 then - SFX("reach") - end - end -end -function Event.infinite_check(P) - for i=1,#P.cleared do - if P.cleared[i]<6 then - P:garbageRise(10,1,rnd(10)) - end - end -end -function Event.round_check(P) - if #players.alive>1 then - P.control=false - local ID=P.id - repeat - ID=ID+1 - if not players[ID]then ID=1 end - until players[ID].alive or ID==P.id - players[ID].control=true - end -end -function Event.GM_score(P) - local F=false - if P.modeData.point<70 then--if Less then MM - local R=#P.cleared - if R==4 then R=10 end - P.modeData.point=P.modeData.point+R - F=true - end - if P.stat.time>=53.5 then - P.modeData.point=min(P.modeData.point+15,80) - F=true - Event.win(P) - end - if F then - P.modeData.event=sectionName[int(P.modeData.point*.1)+1] - end -end -function Event.tsd_reach(P) - if #P.cleared>0 then - if P.lastClear~=52 then - Event.lose(P) - elseif #P.cleared>0 then - P.modeData.event=P.modeData.event+1 - end - end -end -function Event.tech_reach_easy(P) - if #P.cleared>0 and P.b2b<40 then - Event.lose(P) - end -end -function Event.tech_reach_hard(P) - if #P.cleared>0 and P.lastClear<10 then - Event.lose(P) - end -end -function Event.tech_reach_ultimate(P) - if #P.cleared>0 and P.lastClear<10 or P.lastClear==74 then - Event.lose(P) - end -end -function Event.c4w_reach(P) - for i=1,#P.cleared do - P.field[#P.field+1]=getNewRow(10) - P.visTime[#P.visTime+1]=getNewRow(20) - for i=4,7 do P.field[#P.field][i]=0 end - end - if #P.cleared==0 then - if curMode.lv==2 then - Event.lose(P) - end - else - if P.combo>P.modeData.point then - P.modeData.point=P.combo - end - if P.stat.row>=100 then - Event.win(P) - end - end -end -function Event.newPC(P) - local r=P.field;r=r[#r] - if r then - local c=0 - for i=1,10 do if r[i]>0 then c=c+1 end end - if c<5 then - Event.lose(P) - end - end - if P.stat.piece%4==0 and #P.field==0 then - P.modeData.event=P.modeData.event==0 and 1 or 0 - local r=rnd(#PClist) - local f=P.modeData.event==0 - for i=1,4 do - local b=PClist[r][i] - if f then - if b<3 then b=3-b - elseif b<5 then b=7-b - end - end - P.next[#P.next+1]={bk=blocks[b][0],id=b,color=b,name=b}--P:newNext(b)'s simple version! - end - P.counter=P.stat.piece==0 and 20 or 0 - newTask(Event_task.PC,P) - if curMode.lv==2 then - local s=P.stat.pc*.5 - if int(s)==s and s>0 then - P.gameEnv.drop=pc_drop[s]or 10 - P.gameEnv.lock=pc_lock[s]or 20 - P.gameEnv.fall=pc_fall[s]or 5 - if s==10 then - P:showText(text.maxspeed,0,-140,100,"appear",.6) - else - P:showText(text.speedup,0,-140,40,"appear",.8) - end - end - end - end -end -function Event.puzzleCheck(P) - for y=1,20 do - local L=P.field[y] - for x=1,10 do - local a,b=preField[y][x],L and L[x]or 0 - if a~=0 then - if a==-1 then - if b>0 then return end - elseif a<8 then - if a~=b then return end - elseif a>7 then - if b==0 then return end - end - end - end - end - P.modeData.event=1 - Event.win(P) + newTask(#players>1 and Event_task.lose or Event_task.finish,P) end -------------------------------------------------- -------------------------------------------------- Event_task={} function Event_task.finish(P) + if scene.cur~="play"then return true end P.endCounter=P.endCounter+1 - if scene.cur~="play"then - return true - end - if P.endCounter>120 then - pauseGame() - return true - end + if P.endCounter>120 then pauseGame()end end function Event_task.lose(P) P.endCounter=P.endCounter+1 @@ -506,246 +237,6 @@ function Event_task.throwBadge(A,data) end if data[2]<=0 then return true end end -function Event_task.dig_normal(P) - if not P.control then return end - P.counter=P.counter+1 - if P.counter>=max(90,180-P.modeData.event)then - P.counter=0 - P:garbageRise(10,1,rnd(10)) - P.modeData.event=P.modeData.event+1 - end -end -function Event_task.dig_lunatic(P) - if not P.control then return end - P.counter=P.counter+1 - if P.counter>=max(45,80-.3*P.modeData.event)then - P.counter=0 - P:garbageRise(11+P.modeData.event%3,1,rnd(10)) - P.modeData.event=P.modeData.event+1 - end -end -function Event_task.survivor_easy(P) - if not P.control then return end - P.counter=P.counter+1 - if P.counter>=max(60,150-2*P.modeData.event)and P.atkBuffer.sum<4 then - P.atkBuffer[#P.atkBuffer+1]={pos=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:showText(text.maxspeed,0,-140,100,"appear",.6)end - P.counter=0 - P.modeData.event=P.modeData.event+1 - end -end -function Event_task.survivor_normal(P) - if not P.control then return end - P.counter=P.counter+1 - if P.counter>=max(90,180-2*P.modeData.event)and P.atkBuffer.sum<8 then - local d=P.modeData.event+1 - P.atkBuffer[#P.atkBuffer+1]= - d%4==0 and{pos=rnd(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1}or - d%4==1 and{pos=rnd(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1}or - d%4==2 and{pos=rnd(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2}or - d%4==3 and{pos=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:showText(text.maxspeed,0,-140,100,"appear",.6)end - P.counter=0 - P.modeData.event=d - end -end -function Event_task.survivor_hard(P) - if not P.control then return end - P.counter=P.counter+1 - if P.counter>=max(60,180-2*P.modeData.event)and P.atkBuffer.sum<15 then - P.atkBuffer[#P.atkBuffer+1]= - P.modeData.event%3<2 and - {pos=rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1} - or - {pos=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) - P.atkBuffer.sum=P.atkBuffer.sum+R - P.stat.recv=P.stat.recv+R - if P.modeData.event==60 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end - P.counter=0 - P.modeData.event=P.modeData.event+1 - end -end -function Event_task.survivor_lunatic(P) - if not P.control then return end - P.counter=P.counter+1 - if P.counter>=max(60,150-P.modeData.event)and P.atkBuffer.sum<20 then - local t=max(60,90-P.modeData.event) - P.atkBuffer[#P.atkBuffer+1]={pos=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:showText(text.maxspeed,0,-140,100,"appear",.6)end - P.counter=0 - P.modeData.event=P.modeData.event+1 - end -end -function Event_task.survivor_ultimate(P) - if not P.control then return end - P.counter=P.counter+1 - if P.counter>=max(300,600-10*P.modeData.event)and P.atkBuffer.sum<20 then - local t=max(300,480-12*P.modeData.event) - local p=#P.atkBuffer+1 - P.atkBuffer[p] ={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=2} - P.atkBuffer[p+1]={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3} - P.atkBuffer[p+2]={pos=rnd(10),amount=6,countdown=1.2*t,cd0=1.2*t,time=0,sent=false,lv=4} - P.atkBuffer[p+3]={pos=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 - P.counter=0 - if P.modeData.event==31 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end - P.modeData.event=P.modeData.event+1 - end -end -function Event_task.defender_normal(P) - if not P.control then return end - P.counter=P.counter+1 - local t=360-P.modeData.event*2 - if P.counter>=t then - P.counter=0 - for _=1,3 do - P.atkBuffer[#P.atkBuffer+1]={pos=rnd(2,9),amount=1,countdown=2*t,cd0=2*t,time=0,sent=false,lv=1} - end - P.atkBuffer.sum=P.atkBuffer.sum+3 - P.stat.recv=P.stat.recv+3 - local D=P.modeData - if D.event<90 then - D.event=D.event+1 - D.point=int(108e3/(360-D.event*2))*.1 - if D.event==25 then - P:showText(text.great,0,-140,100,"appear",.6) - pushSpeed=2 - P.dropDelay,P.gameEnv.drop=20,20 - elseif D.event==50 then - P:showText(text.awesome,0,-140,100,"appear",.6) - pushSpeed=3 - P.dropDelay,P.gameEnv.drop=10,10 - elseif D.event==90 then - P.dropDelay,P.gameEnv.drop=5,5 - P:showText(text.maxspeed,0,-140,100,"appear",.6) - end - end - end -end -function Event_task.defender_lunatic(P) - if not P.control then return end - P.counter=P.counter+1 - local t=240-2*P.modeData.event - if P.counter>=t then - P.counter=0 - for _=1,4 do - P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=5*t,cd0=5*t,time=0,sent=false,lv=2} - end - P.atkBuffer.sum=P.atkBuffer.sum+4 - P.stat.recv=P.stat.recv+4 - local D=P.modeData - if D.event<75 then - D.event=D.event+1 - D.point=int(144e3/(240-2*D.event))*.1 - if D.event==25 then - P:showText(text.great,0,-140,100,"appear",.6) - pushSpeed=3 - P.dropDelay,P.gameEnv.drop=4,4 - elseif D.event==50 then - P:showText(text.awesome,0,-140,100,"appear",.6) - pushSpeed=4 - P.dropDelay,P.gameEnv.drop=3,3 - elseif D.event==75 then - P:showText(text.maxspeed,0,-140,100,"appear",.6) - P.dropDelay,P.gameEnv.drop=2,2 - end - end - end -end -function Event_task.attacker_hard(P) - if not P.control then return end - if P.atkBuffer.sum==0 then - 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 - B[p]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3} - B[p+1]= {pos=rnd(3,8),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4} - else - t=900-10*(D.event-20)--900~600 - B[p]= {pos=rnd(10),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4} - B[p+1]= {pos=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 - if D.event<50 then - D.event=D.event+1 - D.point=int(72e4/t)*.1 - if D.event==20 then - P:showText(text.great,0,-140,100,"appear",.6) - pushSpeed=3 - elseif D.event==50 then - P:showText(text.maxspeed,0,-140,100,"appear",.6) - end - end - end -end -function Event_task.attacker_ultimate(P) - if not P.control then return end - if P.atkBuffer.sum<2 then - local p=#P.atkBuffer+1 - local B,D=P.atkBuffer,P.modeData - local s,t - if D.event<10 then - t=1000-20*D.event--1000~800 - B[p]= {pos=rnd(5,6),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=3} - B[p+1]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=4} - s=22 - elseif D.event<20 then - t=800-20*(D.event-15)--800~600 - B[p]= {pos=rnd(3,8),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4} - B[p+1]= {pos=rnd(4,7),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5} - s=25 - else - t=600-15*(D.event-30)--600~450 - B[p]= {pos=rnd(2)*9-8,amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5} - B[p+1]= {pos=rnd(3,8),amount=16,countdown=t,cd0=t,time=0,sent=false,lv=5} - s=28 - end - B.sum=B.sum+s - P.stat.recv=P.stat.recv+s - if D.event<45 then - D.event=D.event+1 - D.point=int(s*36e3/t)*.1 - if D.event==10 then - P:showText(text.great,0,-140,100,"appear",.6) - pushSpeed=4 - elseif D.event==20 then - P:showText(text.awesome,0,-140,100,"appear",.6) - pushSpeed=5 - elseif D.event==30 then - P:showText(text.maxspeed,0,-140,100,"appear",.6) - end - end - end -end -function Event_task.PC(P) - P.counter=P.counter+1 - if P.counter==21 then - local t=P.stat.pc%2 - for i=1,4 do - local r=getNewRow(0) - for j=1,10 do - r[j]=PCbase[4*t+i][j] - end - ins(P.field,1,r) - ins(P.visTime,1,getNewRow(20)) - end - P.fieldBeneath=P.fieldBeneath+120 - P.curY=P.curY+4 - P:freshgho() - return true - end -end function Event_task.bgmFadeOut(_,id) local v=bgm[id]:getVolume()-.025*setting.bgm*.1 bgm[id]:setVolume(v>0 and v or 0) @@ -761,959 +252,96 @@ function Event_task.bgmFadeIn(_,id) end -------------------------------------------------- --------------------------------------------------- -modes={} -modes.sprint={ - level={"10L","20L","40L","100L","400L","1000L"}, - env={ - { - drop=60,lock=60, - target=10,dropPiece="reach_winCheck", - bg="strap",bgm="race", - }, - { - drop=60,lock=60, - target=20,dropPiece="reach_winCheck", - bg="strap",bgm="race", - }, - { - drop=60,lock=60, - target=40,dropPiece="reach_winCheck", - bg="strap",bgm="race", - }, - { - drop=60,lock=60, - target=100,dropPiece="reach_winCheck", - bg="strap",bgm="race", - }, - { - drop=60,lock=60, - target=400,dropPiece="reach_winCheck", - bg="strap",bgm="push", - }, - { - drop=60,lock=60, - target=1000,dropPiece="reach_winCheck", - bg="strap",bgm="push", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(55) - local r=max(P.gameEnv.target-P.stat.row,0) - mStr(r,-82,265) - if r<21 and r>0 then - gc.setLineWidth(4) - gc.setColor(1,r>10 and 0 or rnd(),.5) - gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy) - end - end, -} -modes.marathon={ - level={"EASY","NORMAL","HARD"}, - env={ - { - drop=60,lock=60,fall=30, - target=200,dropPiece="reach_winCheck", - bg="strap",bgm="way", - }, - { - drop=60,fall=20, - target=10,dropPiece="marathon_update", - bg="strap",bgm="way", - }, - { - _20G=true,fall=15, - target=200,dropPiece="reach_winCheck", - bg="strap",bgm="race", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(45) - mStr(P.stat.row,-82,320) - mStr(P.gameEnv.target,-82,370) - gc.rectangle("fill",-125,375,90,4) - end, -} -modes.master={ - level={"LUNATIC","ULTIMATE","FINAL"}, - env={ - { - _20G=true,lock=rush_lock[1], - wait=rush_wait[1], - fall=rush_fall[1], - dropPiece="master_score", - das=9,arr=3, - freshLimit=15, - bg="strap",bgm="secret8th", - }, - { - _20G=true,lock=death_lock[1], - wait=death_wait[1], - fall=death_fall[1], - dropPiece="master_score", - das=6,arr=1, - freshLimit=15, - bg="game2",bgm="secret7th", - }, - { - _20G=true,lock=12, - wait=10,fall=10, - dropPiece="master_score_hard", - das=5,arr=1, - freshLimit=15, - easyFresh=false,bone=true, - bg="none",bgm="shining terminal", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(45) - mStr(P.modeData.point,-82,320) - mStr((P.modeData.event+1)*100,-82,370) - gc.rectangle("fill",-125,375,90,4) - end, -} -modes.classic={ - level={"CTWC"}, - env={ - { - das=16,arr=6,sddas=2,sdarr=2, - ghost=false,center=false, - drop=3,lock=3,wait=10,fall=25, - next=1,hold=false, - sequence="rnd", - freshLimit=0, - target=10,dropPiece="classic_reach", - bg="rgb",bgm="rockblock", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - 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),-82,210) - mDraw(drawableText.speedLV,-82,290) - setFont(45) - mStr(P.stat.row,-82,320) - mStr(P.gameEnv.target,-82,370) - gc.rectangle("fill",-125,375,90,4) - end, -} -modes.zen={ - level={"NORMAL"}, - env={ - { - drop=1e99,lock=1e99, - oncehold=false, - dropPiece="reach_winCheck", - bg="strap",bgm="infinite", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(70) - mStr(max(200-P.stat.row,0),-82,280) - end, -} -modes.infinite={ - level={"NORMAL","EXTRA"}, - env={ - { - drop=1e99,lock=1e99, - oncehold=false, - bg="glow",bgm="infinite", - }, - { - drop=1e99,lock=1e99, - oncehold=false, - dropPiece="infinite_check", - bg="glow",bgm="infinite", - }, - }, - load=function() - newPlayer(1,340,15) - if curMode.lv==2 then - pushSpeed=1 - for _=1,5 do - players[1]:garbageRise(10,1,rnd(10)) - end - end - end, - mesDisp=function(P,dx,dy) - setFont(45) - mStr(P.stat.atk,-82,310) - mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) - mDraw(drawableText.atk,-82,363) - mDraw(drawableText.eff,-82,475) - end, -} -modes.solo={ - level={"EASY","EASY+","NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+","ULTIMATE","ULTIMATE+"}, - env={ - { - drop=60,lock=60, - freshLimit=15, - bg="game2",bgm="race", - }, - }, - load=function() - newPlayer(1,340,15) - if curMode.lv==1 then - newPlayer(2,965,360,.5,AITemplate("9S",3)) - elseif curMode.lv==2 then - newPlayer(2,965,360,.5,AITemplate("CC",3,2,false,10000)) - elseif curMode.lv==3 then - newPlayer(2,965,360,.5,AITemplate("9S",5)) - elseif curMode.lv==4 then - newPlayer(2,965,360,.5,AITemplate("CC",5,2,true,20000)) - elseif curMode.lv==5 then - newPlayer(2,965,360,.5,AITemplate("9S",7)) - elseif curMode.lv==6 then - newPlayer(2,965,360,.5,AITemplate("CC",8,3,true,30000)) - elseif curMode.lv==7 then - newPlayer(2,965,360,.5,AITemplate("9S",8)) - elseif curMode.lv==8 then - newPlayer(2,965,360,.5,AITemplate("CC",9,3,true,40000)) - elseif curMode.lv==9 then - newPlayer(2,965,360,.5,AITemplate("9S",9)) - elseif curMode.lv==10 then - newPlayer(2,965,360,.5,AITemplate("CC",10,4,true,80000)) - end - end, - mesDisp=function(P,dx,dy) +modes={ + {"sprint_10", id=1, x=0, y=0, shape=1,size=35,unlock={2,3}}, + {"sprint_20", id=2, x=-300, y=0, shape=1,size=45,unlock={73,74,75}}, + {"sprint_40", id=3, x=0, y=-400, shape=1,size=55,unlock={4,9}}, + {"sprint_100", id=4, x=-200, y=-400, shape=1,size=45,unlock={5,7}}, + {"sprint_400", id=5, x=-400, y=-400, shape=1,size=35,unlock={6}}, + {"sprint_1000", id=6, x=-600, y=-400, shape=1,size=35,unlock={}}, + {"drought_normal", id=7, x=-400, y=-200, shape=1,size=35,unlock={8}}, + {"drought_lunatic", id=8, x=-600, y=-200, shape=1,size=35,unlock={}}, + {"marathon_normal", id=9, x=0, y=-600, shape=1,size=55,unlock={10,11,22,31,36,37,48,68,71,72}}, + {"marathon_hard", id=10, x=0, y=-800, shape=1,size=45,unlock={27}}, + {"solo_1", id=11, x=-300, y=-1000, shape=1,size=35,unlock={12}}, + {"solo_2", id=12, x=-500, y=-1000, shape=1,size=35,unlock={13}}, + {"solo_3", id=13, x=-700, y=-1000, shape=1,size=35,unlock={14,16}}, + {"solo_4", id=14, x=-900, y=-1000, shape=1,size=35,unlock={15}}, + {"solo_5", id=15, x=-1100, y=-1000, shape=1,size=35,unlock={}}, + {"techmino49_easy", id=16, x=-900, y=-1200, shape=1,size=35,unlock={17,19}}, + {"techmino49_hard", id=17, x=-900, y=-1400, shape=1,size=35,unlock={18}}, + {"techmino49_ultimate", id=18, x=-900, y=-1600, shape=1,size=35,unlock={}}, - end, -} -modes.round={ - level={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"}, - env={ - { - drop=1e99,lock=1e99, - oncehold=false, - dropPiece="round_check", - bg="game2",bgm="push", - }, - }, - load=function() - newPlayer(1,340,15) - if curMode.lv==1 then - newPlayer(2,965,360,.5,AITemplate("9S",10)) - elseif curMode.lv==2 then - newPlayer(2,965,360,.5,AITemplate("CC",10,2,false,10000)) - elseif curMode.lv==3 then - newPlayer(2,965,360,.5,AITemplate("CC",10,3,true,30000)) - elseif curMode.lv==4 then - newPlayer(2,965,360,.5,AITemplate("CC",10,4,true,60000)) - elseif curMode.lv==5 then - newPlayer(2,965,360,.5,AITemplate("CC",10,6,true,100000)) - end - garbageSpeed=1e4 - end, - mesDisp=function(P,dx,dy) + {"techmino99_easy", id=19, x=-1100, y=-1400, shape=1,size=35,unlock={20}}, + {"techmino99_hard", id=20, x=-1100, y=-1600, shape=1,size=35,unlock={21}}, + {"techmino99_ultimate", id=21, x=-1100, y=-1800, shape=1,size=35,unlock={}}, + {"round_1", id=22, x=-300, y=-800, shape=1,size=35,unlock={23}}, + {"round_2", id=23, x=-500, y=-800, shape=1,size=35,unlock={24}}, + {"round_3", id=24, x=-700, y=-800, shape=1,size=35,unlock={25}}, + {"round_4", id=25, x=-900, y=-800, shape=1,size=35,unlock={26}}, + {"round_5", id=26, x=-1100, y=-800, shape=1,size=35,unlock={}}, - end, -} -modes.tsd={ - level={"NORMAL","HARD"}, - env={ - { - oncehold=false, - drop=1e99,lock=1e99, - dropPiece="tsd_reach", - ospin=false, - bg="matrix",bgm="reason", - }, - { - drop=60,lock=60, - freshLimit=15, - dropPiece="tsd_reach", - ospin=false, - bg="matrix",bgm="reason", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(75) - mStr(P.modeData.event,-82,330) - mDraw(drawableText.tsd,-82,407) - end, -} -modes.blind={ - level={"EASY","HARD","HARD+","LUNATIC","ULTIMATE","GM"}, - env={ - { - drop=30,lock=45, - freshLimit=10, - visible="time", - bg="glow",bgm="newera", - }, - { - drop=15,lock=45, - freshLimit=10, - visible="fast", - freshLimit=10, - bg="glow",bgm="reason", - }, - { - drop=15,lock=45, - fall=10,lock=60, - center=false, - visible="none", - freshLimit=15, - bg="rgb",bgm="secret7th", - }, - { - drop=10,lock=45, - fall=5,lock=60, - center=false,ghost=false, - visible="none", - freshLimit=15, - bg="rgb",bgm="secret8th", - }, - { - drop=30,lock=60, - fall=5, - block=false, - center=false,ghost=false, - visible="none", - freshLimit=15, - bg="rgb",bgm="secret7th", - }, - { - _20G=true, - drop=0,lock=15, - wait=10,fall=15, - next=3, - visible="fast", - freshLimit=15, - dropPiece="GM_score", - arr=1, - bg="game3",bgm="shining terminal", - }, - }, - load=function() - newPlayer(1,340,15) - if curMode.lv==6 then - players[1].modeData.event="M7" - end - end, - mesDisp=function(P,dx,dy) - mDraw(drawableText.line,-82,300) - mDraw(drawableText.techrash,-82,420) - if curMode.lv==6 then - mDraw(drawableText.grade,-82,170) - setFont(55) - mStr(P.modeData.event,-82,110) - end - setFont(75) - mStr(P.stat.row,-82,220) - mStr(P.stat.clear_4,-82,340) - end, -} -modes.dig={ - level={"NORMAL","LUNATIC"}, - env={ - { - drop=60,lock=120, - fall=20, - freshLimit=15, - task="dig_normal", - bg="game2",bgm="push", - }, - { - drop=10,lock=30, - freshLimit=15, - task="dig_lunatic", - bg="game2",bgm="secret7th", - }, - }, - load=function() - newPlayer(1,340,15) - pushSpeed=1 - end, - mesDisp=function(P,dx,dy) - setFont(65) - mStr(P.modeData.event,-82,310) - mDraw(drawableText.wave,-82,375) - end, -} -modes.survivor={ - level={"EASY","NORMAL","HARD","LUNATIC","ULTIMATE"}, - env={ - { - drop=60,lock=120, - fall=30, - freshLimit=15, - task="survivor_easy", - bg="game2",bgm="push", - }, - { - drop=30,lock=60, - fall=20, - freshLimit=15, - task="survivor_normal", - bg="game2",bgm="newera", - }, - { - drop=10,lock=60, - fall=15, - freshLimit=15, - task="survivor_hard", - bg="game2",bgm="secret8th", - }, - { - drop=6,lock=60, - fall=10, - freshLimit=15, - task="survivor_lunatic", - bg="game3",bgm="secret7th", - }, - { - drop=5,lock=60, - fall=10, - freshLimit=15, - task="survivor_ultimate", - bg="rgb",bgm="secret7th", - }, - }, - load=function() - newPlayer(1,340,15) - pushSpeed=curMode.lv>2 and 2 or 1 - end, - mesDisp=function(P,dx,dy) - setFont(65) - mStr(P.modeData.event,-82,310) - mDraw(drawableText.wave,-82,375) - end, -} -modes.defender={ - level={"NORMAL","LUNATIC"}, - env={ - { - drop=30,lock=60, - fall=10, - freshLimit=15, - task="defender_normal", - bg="game3",bgm="way", - }, - { - drop=5,lock=60, - fall=6, - freshLimit=15, - task="defender_lunatic", - bg="game4",bgm="way", - }, - }, - load=function() - newPlayer(1,340,15) - if curMode.lv==1 then - pushSpeed=1 - elseif curMode.lv==2 then - pushSpeed=2 - end - end, - mesDisp=function(P,dx,dy) - setFont(55) - mStr(P.modeData.event,-82,200) - mStr(P.modeData.point,-82,320) - mDraw(drawableText.wave,-82,260) - mDraw(drawableText.rpm,-82,380) - end, -} -modes.attacker={ - level={"HARD","ULTIMATE"}, - env={ - { - drop=30,lock=60, - fall=12, - freshLimit=15, - task="attacker_hard", - bg="game3",bgm="push", - }, - { - drop=5,lock=60, - fall=8, - freshLimit=15, - task="attacker_ultimate", - bg="game4",bgm="shining terminal", - }, - }, - load=function() - newPlayer(1,340,15) - if curMode.lv==1 then - pushSpeed=2 - end - end, - mesDisp=function(P,dx,dy) - setFont(55) - mStr(P.modeData.event,-82,200) - mStr( - curMode.lv==1 and 24 - or P.modeData.event<10 and 22 - or P.modeData.event<20 and 25 - or 28,-82,320) - mDraw(drawableText.wave,-82,260) - mDraw(drawableText.nextWave,-82,380) - end, -} -modes.tech={ - level={"NORMAL","NORMAL+","HARD","HARD+","LUNATIC","LUNATIC+","ULTIMATE","ULTIMATE+"}, - env={ - { - oncehold=false, - drop=1e99,lock=1e99, - dropPiece="tech_reach_easy", - bg="matrix",bgm="newera", - }, - { - oncehold=false, - drop=1e99,lock=1e99, - dropPiece="tech_reach_ultimate", - bg="matrix",bgm="newera", - }, - { - drop=10,lock=60, - freshLimit=15, - dropPiece="tech_reach_easy", - bg="matrix",bgm="secret8th", - }, - { - drop=30,lock=60, - freshLimit=15, - dropPiece="tech_reach_ultimate", - bg="matrix",bgm="secret8th", - }, - { - _20G=true,lock=60, - freshLimit=15, - dropPiece="tech_reach_hard", - bg="matrix",bgm="secret7th", - }, - { - _20G=true,lock=60, - freshLimit=15, - dropPiece="tech_reach_ultimate", - bg="matrix",bgm="secret7th", - }, - { - drop=1e99,lock=60, - freshLimit=15, - fine=true,fineKill=true, - dropPiece="tech_reach_hard", - bg="flink",bgm="infinite", - }, - { - drop=1e99,lock=60, - freshLimit=15, - fine=true,fineKill=true, - dropPiece="tech_reach_ultimate", - bg="flink",bgm="infinite", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(45) - mStr(P.stat.atk,-82,310) - mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) - mDraw(drawableText.atk,-82,363) - mDraw(drawableText.eff,-82,475) - end, -} -modes.c4wtrain={ - level={"NORMAL","LUNATIC"}, - env={ - { - drop=30,lock=60, - oncehold=false, - freshLimit=15, - dropPiece="c4w_reach", - ospin=false, - bg="rgb",bgm="newera", - }, - { - drop=5,lock=30, - freshLimit=15, - dropPiece="c4w_reach", - ospin=false, - bg="rgb",bgm="newera", - }, - }, - load=function() - newPlayer(1,340,15) - local P=players[1] - local F=P.field - for i=1,24 do - F[i]=getNewRow(10) - P.visTime[i]=getNewRow(20) - for x=4,7 do F[i][x]=0 end - end - local r=rnd(6) - if r==1 then F[1][5],F[1][4],F[2][4]=10,10,10 - elseif r==2 then F[1][6],F[1][7],F[2][7]=10,10,10 - elseif r==3 then F[1][4],F[2][4],F[2][5]=10,10,10 - elseif r==4 then F[1][7],F[2][7],F[2][6]=10,10,10 - elseif r==5 then F[1][4],F[1][5],F[1][6]=10,10,10 - elseif r==6 then F[1][7],F[1][6],F[1][5]=10,10,10 - end - end, - mesDisp=function(P,dx,dy) - setFont(45) - mStr(P.combo,-82,310) - mStr(P.modeData.point,-82,400) - mDraw(drawableText.combo,-82,358) - mDraw(drawableText.mxcmb,-82,450) - end, -} -modes.pctrain={ - level={"NORMAL","EXTRA"}, - env={ - { - next=4, - hold=false, - drop=150,lock=150, - fall=20, - sequence="none", - dropPiece="newPC", - ospin=false, - bg="rgb",bgm="newera", - }, - { - next=4, - hold=false, - drop=60,lock=60, - fall=20, - sequence="none", - freshLimit=15, - dropPiece="newPC", - ospin=false, - bg="rgb",bgm="newera", - }, - }, - load=function() - newPlayer(1,340,15) - Event.newPC(players[1]) - end, - mesDisp=function(P,dx,dy) - setFont(75) - mStr(P.stat.pc,-82,330) - mDraw(drawableText.pc,-82,412) - end, -} -modes.pcchallenge={ - level={"NORMAL","HARD","LUNATIC"}, - env={ - { - oncehold=false, - drop=300,lock=1e99, - target=100,dropPiece="reach_winCheck", - ospin=false, - bg="rgb",bgm="newera", - }, - { - drop=60,lock=120, - fall=10, - target=100,dropPiece="reach_winCheck", - freshLimit=15, - ospin=false, - bg="rgb",bgm="infinite", - }, - { - drop=20,lock=60, - fall=20, - target=100,dropPiece="reach_winCheck", - freshLimit=15, - ospin=false, - bg="rgb",bgm="infinite", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(45) - mStr(max(100-P.stat.row,0),-82,250) + {"master_beginner", id=27, x=0, y=-1000, shape=1,size=35,unlock={28}}, + {"master_adavnce", id=28, x=0, y=-1200, shape=1,size=35,unlock={29,30}}, + {"master_final", id=29, x=0, y=-1400, shape=1,size=35,unlock={}}, + {"GM", id=30, x=150, y=-1500, shape=1,size=35,unlock={}}, - setFont(75) - mStr(P.stat.pc,-82,350) - mDraw(drawableText.pc,-82,432) + {"blind_easy", id=31, x=150, y=-700, shape=1,size=35,unlock={32}}, + {"blind_normal", id=32, x=150, y=-800, shape=1,size=35,unlock={33}}, + {"blind_hard", id=33, x=150, y=-900, shape=1,size=35,unlock={34}}, + {"blind_lunatic", id=34, x=150, y=-1000, shape=1,size=35,unlock={35}}, + {"blind_ultimate", id=35, x=150, y=-1100, shape=1,size=35,unlock={}}, - gc.setColor(.5,.5,.5) - if frame>179 then - local y=72*(7-(P.stat.piece+(P.hd.id>0 and 2 or 1))%7)-36 - gc.line(320,y,442,y) - end - end, -} -modes.techmino49={ - level={"EASY","HARD","ULTIMATE"}, - env={ - { - drop=60,lock=60, - fall=20, - royaleMode=true, - Fkey=Fkey_func.royale, - royalePowerup={2,5,10,20}, - royaleRemain={30,20,15,10,5}, - pushSpeed=2, - freshLimit=15, - bg="game3",bgm="rockblock", - }, - }, - load=function() - newPlayer(1,340,15) - local LV=curMode.lv - if LV==3 then players[1].gameEnv.drop=15 end - local L={}for i=1,49 do L[i]=true end - local t=system~="Windows"and 0 or 2*LV - while t>0 do - local r=rnd(2,49) - if L[r]then L[r],t=false,t-1 end - end - local min,max - if LV==1 then min,max=4,6 - elseif LV==2 then min,max=4,8 - elseif LV==3 then min,max=8,10 - end - local n=2 - for i=1,4 do for j=1,6 do - if L[n]then - newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(min,max))) - else - newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(min,max)-1,LV+1,true,LV*10000)) - end - n=n+1 - end end - for i=9,12 do for j=1,6 do - if L[n]then - newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(min,max))) - else - newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(min,max)-1,LV+1,true,LV*10000)) - end - n=n+1 - end end - end, - mesDisp=function(P,dx,dy) - setFont(35) - mStr(#players.alive.."/49",-82,175) - mStr(P.ko,-70,215) - gc.draw(drawableText.ko,-127,225) - setFont(20) - gc.setColor(1,.5,0,.6) - gc.print(P.badge,-47,227) - gc.setColor(1,1,1) - setFont(25) - gc.print(powerUp[P.strength],-132,290) - for i=1,P.strength do - gc.draw(badgeIcon,16*i-138,260) - end - end, -} -modes.techmino99={ - level={"EASY","HARD","ULTIMATE"}, - env={ - { - drop=60,lock=60, - fall=20, - royaleMode=true, - Fkey=Fkey_func.royale, - royalePowerup={2,6,14,30}, - royaleRemain={75,50,35,20,10}, - pushSpeed=2, - freshLimit=15, - bg="game3",bgm="rockblock", - }, - }, - load=function() - newPlayer(1,340,15) - local LV=curMode.lv - if LV==3 then players[1].gameEnv.drop=15 end - local L={}for i=1,100 do L[i]=true end - local t=system~="Windows"and 0 or 1+3*LV - while t>0 do - local r=rnd(2,99) - if L[r]then L[r],t=false,t-1 end - end - local min,max - if LV==1 then min,max=4,6 - elseif LV==2 then min,max=4,8 - elseif LV==3 then min,max=8,10 - end - local n=2 - for i=1,7 do for j=1,7 do - if L[n]then - newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(min,max))) - else - newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(min,max)-1,LV+1,true,LV*10000)) - end - n=n+1 - end end - for i=15,21 do for j=1,7 do - if L[n]then - newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(min,max))) - else - newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(min,max)-1,LV+1,true,LV*10000)) - end - n=n+1 - end end - end, - mesDisp=function(P,dx,dy) - setFont(35) - mStr(#players.alive.."/99",-82,175) - mStr(P.ko,-70,215) - gc.draw(drawableText.ko,-127,225) - setFont(20) - gc.setColor(1,.5,0,.6) - gc.print(P.badge,-47,227) - gc.setColor(1,1,1) - setFont(25) - gc.print(powerUp[P.strength],-132,290) - for i=1,P.strength do - gc.draw(badgeIcon,16*i-138,260) - end - end, -} -modes.drought={ - level={"NORMAL","MESS"}, - env={ - { - drop=20,lock=60, - sequence="drought1", - target=100,dropPiece="reach_winCheck", - ospin=false, - freshLimit=15, - bg="glow",bgm="reason", - }, - { - drop=20,lock=60, - sequence="drought2", - target=100,dropPiece="reach_winCheck", - ospin=false, - freshLimit=15, - bg="glow",bgm="reason", - }, - }, - load=function() - newPlayer(1,340,15) - end, - mesDisp=function(P,dx,dy) - setFont(70) - mStr(max(100-P.stat.row,0),-82,280) - end, -} -modes.hotseat={ - level={"2P","3P","4P",}, - env={ - { - drop=60,lock=60, - freshLimit=15, - bg="none",bgm="way", - }, - }, - load=function() - if curMode.lv==1 then - newPlayer(1,20,15) - newPlayer(2,650,15) - elseif curMode.lv==2 then - newPlayer(1,20,100,.65) - newPlayer(2,435,100,.65) - newPlayer(3,850,100,.65) - elseif curMode.lv==3 then - newPlayer(1,25,160,.5) - newPlayer(2,335,160,.5) - newPlayer(3,645,160,.5) - newPlayer(4,955,160,.5) - end - end, - mesDisp=function(P,dx,dy) + {"classic_fast", id=36, x=-300, y=-1200, shape=1,size=35,unlock={}}, + + {"survivor_easy", id=37, x=300, y=-600, shape=1,size=35,unlock={38}}, + {"survivor_normal", id=38, x=500, y=-600, shape=1,size=35,unlock={39,42,44,46}}, + {"survivor_hard", id=39, x=700, y=-600, shape=1,size=35,unlock={40}}, + {"survivor_lunatic", id=40, x=900, y=-600, shape=1,size=35,unlock={41}}, + {"survivor_ultimate", id=41, x=1100, y=-600, shape=1,size=35,unlock={}}, + {"attacker_hard", id=42, x=300, y=-800, shape=1,size=35,unlock={43}}, + {"attacker_ultimate", id=43, x=300, y=-1000, shape=1,size=35,unlock={}}, - end, + {"defender_normal", id=44, x=500, y=-800, shape=1,size=35,unlock={45}}, + {"defender_lunatic", id=45, x=500, y=-1000, shape=1,size=35,unlock={}}, + + {"dig_hard", id=46, x=700, y=-800, shape=1,size=35,unlock={47}}, + {"dig_ultimate", id=47, x=700, y=-1000, shape=1,size=35,unlock={}}, + + {"bigbang", id=48, x=400, y=-400, shape=1,size=55,unlock={49,51,56}}, + {"c4wtrain_normal", id=49, x=700, y=-400, shape=1,size=35,unlock={50}}, + {"c4wtrain_lunatic", id=50, x=900, y=-400, shape=1,size=35,unlock={}}, + + {"pctrain_normal", id=51, x=700, y=-200, shape=1,size=35,unlock={52,53}}, + {"pctrain_lunatic", id=52, x=900, y=-200, shape=1,size=35,unlock={}}, + {"pcchallenge_normal", id=53, x=800, y=-100, shape=1,size=35,unlock={54}}, + {"pcchallenge_hard", id=54, x=1000, y=-100, shape=1,size=35,unlock={55}}, + {"pcchallenge_lunatic", id=55, x=1200, y=-100, shape=1,size=35,unlock={}}, + {"tech_normal", id=56, x=400, y=-100, shape=1,size=35,unlock={57,58}}, + {"tech_normal+", id=57, x=650, y=150, shape=1,size=35,unlock={64,67}}, + {"tech_hard", id=58, x=400, y=50, shape=1,size=35,unlock={59,60}}, + {"tech_hard+", id=59, x=250, y=50, shape=1,size=35,unlock={}}, + {"tech_lunatic", id=60, x=400, y=200, shape=1,size=35,unlock={61,62}}, + {"tech_lunatic+", id=61, x=250, y=200, shape=1,size=35,unlock={}}, + {"tech_ultimate", id=62, x=400, y=350, shape=1,size=35,unlock={63}}, + {"tech_ultimate+", id=63, x=250, y=350, shape=1,size=35,unlock={}}, + {"tsd_easy", id=64, x=800, y=200, shape=1,size=35,unlock={65}}, + {"tsd_hard", id=65, x=1000, y=200, shape=1,size=35,unlock={66}}, + {"tsd_ultimate", id=66, x=1200, y=200, shape=1,size=35,unlock={}}, + + {"ultra", id=67, x=650, y=400, shape=1,size=35,unlock={}}, + {"zen", id=68, x=-900, y=-600, shape=1,size=35,unlock={69,70}}, + {"infinite", id=69, x=-900, y=-400, shape=1,size=35,unlock={}}, + {"infinite_dig", id=70, x=-1100, y=-600, shape=1,size=35,unlock={}}, + {"custom_clear", id=71, x=200, y=-350, shape=2,size=45,unlock={}}, + {"custom_puzzle", id=72, x=200, y=-200, shape=2,size=45,unlock={}}, + {"hotseat_2P", id=73, x=-300, y=200, shape=2,size=45,unlock={}}, + {"hotseat_3P", id=74, x=-450, y=200, shape=2,size=45,unlock={}}, + {"hotseat_4P", id=75, x=-600, y=200, shape=2,size=45,unlock={}}, } -modes.custom={ - level={"Normal","Puzzle"}, - env={ - { - dropPiece="reach_winCheck", - }, - { - Fkey=Fkey_func.puzzle,puzzle=true, - dropPiece="puzzleCheck", - }, - }, - load=function() - for i=1,#customID do - local k=customID[i] - modeEnv[k]=customRange[k][customSel[i]] - end - modeEnv._20G=modeEnv.drop==0 - modeEnv.oncehold=customSel[6]==1 - if curMode.lv==2 then - modeEnv.target=0 - end - newPlayer(1,340,15) - local L=modeEnv.opponent - if L~=0 then - modeEnv.target=nil - if L<10 then - newPlayer(2,965,360,.5,AITemplate("9S",2*L)) - else - newPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),modeEnv.hold,15000+5000*(L-10))) - end - end - preField.h=20 - repeat - for i=1,10 do - if preField[preField.h][i]>0 or curMode.lv==2 and preField[preField.h][i]==-1 then - goto L - end - end - preField.h=preField.h-1 - until preField.h==0 - ::L:: - if curMode.lv==1 then - for _,P in next,players.alive do - local t=P.showTime*3 - for y=1,preField.h do - P.field[y]=getNewRow(0) - P.visTime[y]=getNewRow(t) - for x=1,10 do P.field[y][x]=preField[y][x]end - end - end - end - modeEnv.bg=customRange.bg[customSel[12]] - modeEnv.bgm=customRange.bgm[customSel[13]] - end, - mesDisp=function(P,dx,dy) - setFont(55) - if P.gameEnv.puzzle or P.gameEnv.target>1e10 then - mStr(P.stat.row,-82,225) - mDraw(drawableText.line,-82,290) - else - mStr(max(P.gameEnv.target-P.stat.row,0),-82,240) - end - if P.gameEnv.puzzle and P.modeData.event==0 then - local m=puzzleMark - for y=1,preField.h do for x=1,10 do - local T=preField[y][x] - if T~=0 then - gc.draw(m[T],30*x-30+dx,600-30*y+dy) - end - end end - end - end, -} --------------------------------------------------- \ No newline at end of file +modeRanks={} +for i=1,#modes do + modeRanks[i]=false + assert(i==modes[i].id,"ModeID error:"..i) +end +modeRanks[1]=0 \ No newline at end of file diff --git a/document.txt b/document.txt index 1ca472c4..951ef8bd 100644 --- a/document.txt +++ b/document.txt @@ -1,21 +1,31 @@ 游戏方法: - 控制系统提供的一个个方块,每填满场地的一行就会将其消除,根据消除方式会给对手攻击(如果有对手的话) - 完成当前游戏模式中的目标或者是活到最后即算胜利. + 控制系统提供的一个个四联方块(左右移动和旋转90,180,270度),每填满场地的一行就会将其消除,根据消除方式会给对手攻击(如果有对手的话) + 活到最后或者完成目标即胜利. 旋转系统: - 使用Techmino专属旋转系统,细节不赘述 + 使用Techmino专属旋转系统 + 细节不赘述 spin判定: - 结合了不可移动判定和三角判定,是否为mini也与这二者有关,细节不赘述 + 结合了不可移动判定和三角判定,是否为mini也与判定过程数据有关 + 细节不赘述 攻击系统: 消1/2/3/4攻击0/1/2/4 spin1/2/3攻击2/4/6,若mini则减半 B2B:增加1~2(techrash)/1~3(spin)攻击 B3B:满B2B效果+1额外抵挡 - PC:其它攻击与6~8(本局内递增)取高+2额外抵挡 + PC:将其它的伤害之和开根号后向上取整,再+6~10(本局内递增)+2额外抵挡 连击:0,0,1,1,2,2,3,3,4,4,3…… +攻击延迟: + 消2/3的攻击生效最快,消四其次,spin攻击生效较慢,高连击生效最慢 + B2B或者B3B增加攻击力的同时也会减缓一点生效速度,mini大幅减缓生效速度 + +抵消逻辑: + 发动攻击时,若缓冲条有攻击则先用额外抵挡再用攻击力1:1抵消最先受到的攻击 + 没有用上的额外抵挡会被丢弃,最后剩下的攻击力会发送给对手 + back to back(B2B)点数说明: B2B点数的范围在0~1200 在40及以上特殊消除时B2B,在1000以上特殊消除时B3B,1200封顶 @@ -25,65 +35,15 @@ back to back(B2B)点数说明: 普通消除-250 1000以上空放一块-40(不减到低于1000) -攻击延迟: - 消2/3的攻击生效最快,消四其次,spin攻击生效较慢,高连击生效最慢 - B2B或者B3B增加攻击力的同时也会减缓一点生效速度,mini大幅减缓生效速度 +混战模式说明: + 许多玩家同时进行一局游戏(对手都是AI,不是真人).随着玩家数量的减少,方块下落/垃圾生效速度/垃圾升起速度都会增加.淘汰其它玩家后可以获得一个徽章和该玩家持有的徽章,增强自己的攻击力. + 玩家可选四个攻击模式: + 1.随机:每次攻击后10%随机挑选一个玩家锁定 + 2.最多徽章:攻击后或者锁定玩家死亡时锁定徽章最多的玩家 + 3.最高:攻击后或者锁定玩家死亡时锁定场地最高的玩家(每秒刷新) + 4.反击:攻击所有锁定自己的玩家(攻击AOE),若未被任何人锁定则伏击随机玩家 + 坚持到最后的玩家就是胜利者. -抵消逻辑: - 发动攻击时,若缓冲条有攻击则先用额外抵挡再用攻击力1:1抵消最先受到的攻击 - 没有用上的额外抵挡会被丢弃,最后剩下的攻击力会发送给对手 - - -模式说明: - 竞速: - 用你最快的速度消除40行(据难度而定)吧! - 马拉松: - 根据总消行数,速度会逐渐加快,消除两百行吧!(easy和hard就是normal开始和结束的速度,消除200行不加速) - 大师: - 马拉松进化版,如果觉得马拉松太简单了久玩这个吧,每一个难度都是一层境界,L难度和U难度攒到500点数通关,final难度为上级者专属游戏模式,不建议游玩. - 经典: - 使用低速控制设置在高速下落时尽可能消除更多的行,没有通关目标.(到90有"彩蛋") - 禅: - 闲得无聊,只是想单纯地打打块地时候可以玩此模式,无重力消除200行. - 无尽: - 无尽模式,边上会显示玩家的消行数和攻击效率,适合科研(术语). - 单挑: - 和一个电脑玩家单挑,带加号的和最后一个模式是超强机器人(仅限Windows平台),试试你能稳定打败多难的对手吧! - 回合制: - 玩法同单挑模式,只不过只有当一个人放下一个方块后另一个人才能放下一块. - 仅TSD: - 这个模式中,玩家必须用TSD(T spin double)的方式消除,否则直接判负,你能连续打出多少个TSD呢? - 隐形: - 根据不同难度,场地内(甚至当前方块)会隐形,看看你能活多久吧!(GM难度为类似TGM3的GM Roll,用于上级者练习) - 挖掘: - 每隔一定时间,系统会向场地的低端添加一行垃圾行,间隔会随着波数增加而越来越短,你能顶住几波呢? - 生存: - 每隔一定时间,系统会向玩家的垃圾缓冲槽中添加垃圾行,释放速度和间隔会随着波数增加而越来越短,玩家可以将其抵消也可以让其释放,尽可能活更久的时间. - 防守: - 系统会向玩家的垃圾缓冲槽中添加难消除的垃圾行,释放速度和间隔会随着波数增加而越来越短,玩家要尽量抵消他们来让自己存活更久. - 进攻: - 当玩家的攻击缓冲槽空时,系统会向玩家的垃圾缓冲槽中添加大量的垃圾行(高难度下后期甚至会远超过20),释放速度和间隔都会随着波数增加而越来越短,垃圾上涨速度也会提升.赶紧在其释放之前将攻击抵消到不会一下致命的量! - 科研: - 玩家只被允许做特殊消除(spin/全消/消四),在带+的难度中不允许消四,U难度下玩家甚至只被允许每一个方块都使用最简操作控制,任何违反规则的行为都会判负. - C4W练习:(或者说是4w练习) - 系统直接提供给玩家"留4列"的场地,玩家可以自由练习4w消除,该技巧在某些时候实战很有用.(需要学会spin,否则意义不是很大) - 全清训练: - 系统会连续给玩家提供"标准开局PC套路"的场地和四个方块(不允许使用hold),玩家需要一直完成PC,否则判负. - 全清挑战: - 在消除一百行的限制内,你能全清几次? - 49人混战: - 许多玩家同时进行一局游戏(其它的是AI,不是真人).随着玩家数量的减少,方块下落/垃圾生效速度/垃圾升起速度都会增加.淘汰其它玩家后可以获得一个徽章和该玩家持有的徽章,增强自己的攻击力. - 玩家可选四个攻击模式: - 1.随机:每次攻击后10%随机挑选一个玩家锁定 - 2.最多徽章:攻击后或者锁定玩家死亡时锁定徽章最多的玩家 - 3.最高:攻击后或者锁定玩家死亡时锁定场地最高的玩家(每秒刷新) - 4.反击:攻击所有锁定自己的玩家(AOE),若无则伏击随机玩家 - 坚持到最后的玩家就是胜利者. - 99人混战: - 同49人混战,只是增加到了99名玩家,难度系数也有调整,对设备的要求也较高. - 干旱: - 系统提供的方块序列变得奇怪了!你能消除100行不死吗,或者,多快? - 多人: - 使用键盘或者多个手柄(也许?) - 自定义: - 玩家可以自由调整下落速度等等几乎大多数设置(不包括上述各种游戏模式的特殊效果),也可以画一个场地去消除或者是作为提示模板来玩方块拼图.在拼图模式下,按功能键切换是否显示提示模板.其中打"X"的格子不允许有方块,空的格子可以是任何状态,玩家能获得的七种普通方块必须完全符合,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利. \ No newline at end of file +自定义模式说明: + 玩家可以自由调整大多数参数(不包括上述各种游戏模式的特殊效果),也可以画一个场地去消除或者是作为提示模板来进行拼图模式. + 在拼图模式下,按功能键切换是否展示提示.其中打"X"的格子不允许有方块,空的格子可以是任何状态,普通的七种彩色方块必须颜色对应,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利. \ No newline at end of file diff --git a/font.ttf b/font.ttf index 35567c92..d7b363c8 100644 Binary files a/font.ttf and b/font.ttf differ diff --git a/language/chi.lua b/language/chi.lua index 52260ab8..e600d5ee 100644 --- a/language/chi.lua +++ b/language/chi.lua @@ -77,43 +77,22 @@ return{ setting_sound="声音设置", musicRoom="音乐室", nowPlaying="正在播放:", + recSavingError="纪录保存失败:", + settingSaved="设置已保存", + settingSavingError="设置保存失败:", + statSavingError="数据保存失败:", + copySuccess="已复制到剪切板", + dataCorrupted="数据损坏", VKTchW="触摸点权重", VKOrgW="原始点权重", VKCurW="当前点权重", + noScore="暂无成绩", + highScore="最佳成绩", + newRecord="打破纪录", actName=actName, - modeName={ - [0]="自定义", - "竞速","马拉松","大师","经典","禅","无尽","单挑","回合制","仅TSD","隐形", - "挖掘","生存","防守","进攻","科研", - "C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人", - }, - modeInfo={ - sprint="挑战世界纪录", - marathon="尝试坚持到最后", - master="成为方块大师", - classic="高速经典", - zen="无重力消除200行", - infinite="科研沙盒", - solo="打败AI", - round="下棋", - tsd="尽可能做TSD", - blind="最强大脑", - dig="核能挖掘机", - survivor="你能存活多久?", - defender="防守练习", - attacker="进攻练习", - tech="尽可能不要普通消除", - c4wtrain="无 限 连 击", - pctrain="熟悉全清定式的组合", - pcchallenge="100行内尽可能多PC", - techmino49="49人混战", - techmino99="99人混战", - drought="异常序列", - hotseat="友尽模式", - }, - load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing",}, + load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing","加载模式ing","加载乱七八糟的东西ing"}, tips={ "不是动画,真的在加载!", "大满贯10连击消四全清!", @@ -133,7 +112,7 @@ return{ "20G本质是一套全新的游戏规则", "不要在上课时玩游戏!", "本游戏难度上限很高,做好心理准备", - "方块可以不是个休闲游戏", + "本游戏可不是休闲游戏", "调到特殊的日期也不会发生什么的", "3.1415926535897932384", "2.7182818284590452353", @@ -171,7 +150,7 @@ return{ }, help={ "好像也没啥好帮助的吧?就当是关于了", - "这只是一个方块游戏,请勿过度解读和随意联想", + "这只是一个普通的方块游戏,请勿称此游戏为某某某方块", "不过就当成TOP/C2/KOS/TGM3/JS玩好了", "游戏还在测试阶段,请 勿 外 传", "", @@ -196,7 +175,6 @@ return{ WidgetText={ main={ lang="言/A", - qplay="快速开始", play="开始", setting="设置", music="音乐室", @@ -205,12 +183,9 @@ return{ quit="退出", }, mode={ - up="↑", - down="↓", - left="←", - right="→", + draw="画图(Q)", + setting="参数(E)", start="开始", - custom="自定义(C)", back=BK, }, music={ @@ -225,9 +200,6 @@ return{ down="↓", left="←", right="→", - start1="消除开始", - start2="拼图开始", - draw="画图(D)", set1="40行(1)", set2="1v1(2)", set3="无尽(3)", @@ -251,6 +223,9 @@ return{ gb5="■", space="×", clear="清除", + demo="演示模式", + copy="复制", + paste="粘贴", back=BK, }, play={ diff --git a/language/chi_full.lua b/language/chi_full.lua index bbc95b56..a8df9f8f 100644 --- a/language/chi_full.lua +++ b/language/chi_full.lua @@ -77,43 +77,22 @@ return{ setting_sound="声音设置", musicRoom="音乐室", nowPlaying="正在播放:", + recSavingError="纪录保存失败:", + settingSaved="设置已保存", + settingSavingError="设置保存失败:", + statSavingError="数据保存失败:", + copySuccess="已复制到剪切板", + dataCorrupted="数据损坏", VKTchW="触摸点权重", VKOrgW="原始点权重", VKCurW="当前点权重", + noScore="暂无成绩", + highScore="最佳成绩", + newRecord="打破纪录", actName=actName, - modeName={ - [0]="自定义", - "竞速","马拉松","大师","经典","禅","无尽","单挑","回合制","仅TSD","隐形", - "挖掘","生存","防守","进攻","科研", - "C4W练习","全清训练","全清挑战","49人混战","99人混战","干旱","多人", - }, - modeInfo={ - sprint="挑战世界纪录", - marathon="尝试坚持到最后", - master="成为方块大师", - classic="高速经典", - zen="无重力消除200行", - infinite="科研沙盒", - solo="打败AI", - round="下棋", - tsd="尽可能做T旋双清", - blind="最强大脑", - dig="核能挖掘机", - survivor="你能存活多久?", - defender="防守练习", - attacker="进攻练习", - tech="尽可能不要普通消除!", - c4wtrain="无 限 连 击", - pctrain="熟悉全清定式的组合", - pcchallenge="100行内尽可能多全清", - techmino49="49人混战", - techmino99="99人混战", - drought="异常序列", - hotseat="友尽模式", - }, - load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing",}, + load={[0]="加载完成","加载语音ing","加载音乐ing","加载音效ing","加载模式ing","加载乱七八糟的东西ing"}, tips={ "不是动画,真的在加载!", "大满贯10连击消四全清!", @@ -133,7 +112,7 @@ return{ "20G本质是一套全新的游戏规则", "不要在上课时玩游戏!", "本游戏难度上限很高,做好心理准备", - "方块可以不是个休闲游戏", + "本游戏可不是休闲游戏", "调到特殊的日期也不会发生什么的", "3.1415926535897932384", "2.7182818284590452353", @@ -171,7 +150,7 @@ return{ }, help={ "好像也没啥好帮助的吧?就当是关于了", - "这只是一个方块游戏,请勿过度解读和随意联想", + "这只是一个普通的方块游戏,请勿称此游戏为某某某方块", "不过就当成TOP/C2/KOS/TGM3/JS玩好了", "游戏还在测试阶段,请 勿 外 传", "", @@ -196,7 +175,6 @@ return{ WidgetText={ main={ lang="言/A", - qplay="快速开始", play="开始", setting="设置", music="音乐室", @@ -205,12 +183,9 @@ return{ quit="退出", }, mode={ - up="↑", - down="↓", - left="←", - right="→", + draw="画图(Q)", + setting="参数(E)", start="开始", - custom="自定义(C)", back=BK, }, music={ @@ -225,9 +200,6 @@ return{ down="↓", left="←", right="→", - start1="消除开始", - start2="拼图开始", - draw="画图(D)", set1="40行(1)", set2="1v1(2)", set3="无尽(3)", @@ -251,6 +223,9 @@ return{ gb5="■", space="×", clear="清除", + demo="演示模式", + copy="复制", + paste="粘贴", back=BK, }, play={ diff --git a/language/eng.lua b/language/eng.lua index 7ce0cb87..adb3138c 100644 --- a/language/eng.lua +++ b/language/eng.lua @@ -75,43 +75,22 @@ return{ setting_sound="Sound setting", musicRoom="Music Room", nowPlaying="Now Playing:", + recSavingError="Failed to save record:", + settingSaved="Setting saved", + settingSavingError="Failed to save setting:", + statSavingError="Failed to save stat:", + copySuccess="Copy Success", + dataCorrupted="Data Corrupted", VKTchW="Touch weight", VKOrgW="Origion weight", VKCurW="CurPos weight", + noScore="No Score Yet", + highScore="Highscore", + newRecord="New Rocord", actName=actName, - modeName={ - [0]="Custom", - "Sprint","Marathon","Master","Classic","Zen","Infinite","1v1","Round","TSD-only","Blind", - "Dig","Survivor","Defender","Attacker","Tech", - "C4W Train","PC Train","PC Challenge","Techmino49","Techmino99","Drought","Hotseat", - }, - modeInfo={ - sprint="Speed run", - marathon="Survive and reach target", - master="To be Grand Master", - classic="Vintage car drag racing", - zen="Clear 200 Lines without gravity", - infinite="Infinite game,infinite happiness", - solo="Beat AI", - round="Chess?", - tsd="Make more T-spin-doubles", - blind="Invisible board", - dig="Downstack!", - survivor="Survive Longer!", - defender="Hand them!", - attacker="Attacking better then defending", - tech="Don't do normal clear", - c4wtrain="Infinite combo", - pctrain="Let's learn some PCs", - pcchallenge="Make PCs in 100 Lines", - techmino49="Melee fight with 48 AIs", - techmino99="Melee fight with 98 AIs", - drought="ERRSEQ flood attack", - hotseat="", - }, - - load={[0]="Finished","Loading VOICE","Loading BGM","Loading SFX",}, + + load={[0]="Finished","Loading VOICE","Loading BGM","Loading SFX","Loading modes","Loading other things"}, tips={ "Not animation,real loading!", "Back to Back 10 combo Techrash PC!", @@ -170,7 +149,7 @@ return{ }, help={ "I don't think you need \"help\".", - "THIS IS ONLY A BLOCK GAME", + "THIS IS ONLY A BLOCK GAME,not T****s", "But just play like playing TOP/C2/KOS/TGM3", "Game is not public now,so DO NOT DISTIRBUTE", "", @@ -195,7 +174,6 @@ Lib used: WidgetText={ main={ lang="言/A", - qplay="Qplay", play="Play", setting="Settings", music="Music room", @@ -204,12 +182,9 @@ Lib used: quit="Quit", }, mode={ - up="↑", - down="↓", - left="←", - right="→", + draw="Draw(Q)", + setting="Setting(E)", start="Start", - custom="Custom(C)", back=BK, }, music={ @@ -224,9 +199,6 @@ Lib used: down="↓", left="←", right="→", - start1="Clear Start", - start2="Puzzle Start", - draw="Draw(D)", set1="40L(1)", set2="1v1(2)", set3="infinite(3)", @@ -250,6 +222,9 @@ Lib used: gb5="■", space="×", clear="Clear", + demo="Demo", + copy="Copy", + paste="Paste", back=BK, }, play={ diff --git a/list.lua b/list.lua index b12e6b3f..ae4af514 100644 --- a/list.lua +++ b/list.lua @@ -1,4 +1,3 @@ -local mobile=system=="Android"or system=="iOS" actName={ "moveLeft","moveRight", "rotRight","rotLeft","rotFlip", @@ -34,8 +33,10 @@ color={ darkGrey={.3,.3,.3}, white={1,1,1}, + bronze={.7,.4,0}, orange={1,.6,0}, lightOrange={1,.7,.3}, + darkOrange={.6,.4,0}, purple={.5,0,1}, lightPurple={.8,.4,1}, darkPurple={.3,0,.6}, @@ -57,6 +58,7 @@ blockColor={ } sfx={ "welcome", + "click", "error","error_long", --Stereo sfxs(cannot set position) "button","swipe", @@ -89,7 +91,7 @@ bgm={ "shining terminal", "end", } -voiceBank={} +voiceBank={}--{{srcs1},{srcs2},...} voiceName={ "zspin","sspin","lspin","jspin","tspin","ospin","ispin", "single","double","triple","techrash", @@ -174,422 +176,4 @@ customRange={ } RCPB={10,33,200,33,105,5,105,60} -snapLevelValue={1,10,20,40,60,80} -modeID={ - [0]="custom", - "sprint","marathon","master","classic","zen","infinite","solo","round","tsd","blind", - "dig","survivor","defender","attacker","tech", - "c4wtrain","pctrain","pcchallenge","techmino49","techmino99","drought","hotseat", -} -local O,_=true,false -blocks={ - {[0]={{_,O,O},{O,O,_}},{{O,_},{O,O},{_,O}}}, - {[0]={{O,O,_},{_,O,O}},{{_,O},{O,O},{O,_}}}, - {[0]={{O,O,O},{_,_,O}},{{O,O},{O,_},{O,_}},{{O,_,_},{O,O,O}},{{_,O},{_,O},{O,O}}}, - {[0]={{O,O,O},{O,_,_}},{{O,_},{O,_},{O,O}},{{_,_,O},{O,O,O}},{{O,O},{_,O},{_,O}}}, - {[0]={{O,O,O},{_,O,_}},{{O,_},{O,O},{O,_}},{{_,O,_},{O,O,O}},{{_,O},{O,O},{_,O}}}, - {[0]={{O,O},{O,O}},{{O,O},{O,O}}}, - {[0]={{O,O,O,O}},{{O},{O},{O},{O}}}, -} -local l={1,2,6,7}for i=1,4 do blocks[l[i]][2],blocks[l[i]][3]=blocks[l[i]][0],blocks[l[i]][1]end -for i=1,7 do blocks[i+7]=blocks[i]end - -local virtualkeySet={ - { - {1, 80, 720-200, 80},--moveLeft - {2, 320, 720-200, 80},--moveRight - {3, 1280-80, 720-200, 80},--rotRight - {4, 1280-200, 720-80, 80},--rotLeft - {5, 1280-200, 720-320, 80},--rotFlip - {6, 200, 720-320, 80},--hardDrop - {7, 200, 720-80, 80},--softDrop - {8, 1280-320, 720-200, 80},--hold - {9, 1280-80, 280, 80},--func - {10,80, 280, 80},--restart - },--Farter's set,thanks - { - {1, 1280-320, 720-200, 80},--moveLeft - {2, 1280-80, 720-200, 80},--moveRight - {3, 200, 720-80, 80},--rotRight - {4, 80, 720-200, 80},--rotLeft - {5, 200, 720-320, 80},--rotFlip - {6, 1280-200, 720-320, 80},--hardDrop - {7, 1280-200, 720-80, 80},--softDrop - {8, 320, 720-200, 80},--hold - {9, 80, 280, 80},--func - {10,1280-80, 280, 80},--restart - },--Mirrored farter's set,sknaht - { - {1, 80, 720-80, 80},--moveLeft - {2, 240, 720-80, 80},--moveRight - {3, 1280-240, 720-80, 80},--rotRight - {4, 1280-400, 720-80, 80},--rotLeft - {5, 1280-240, 720-240, 80},--rotFlip - {6, 1280-80, 720-80, 80},--hardDrop - {7, 1280-80, 720-240, 80},--softDrop - {8, 1280-80, 720-400, 80},--hold - {9, 80, 360, 80},--func - {10,80, 80, 80},--restart - },--Author's set,not recommend - { - {1, 1280-400, 720-80, 80},--moveLeft - {2, 1280-80, 720-80, 80},--moveRight - {3, 240, 720-80, 80},--rotRight - {4, 80, 720-80, 80},--rotLeft - {5, 240, 720-240, 80},--rotFlip - {6, 1280-240, 720-240, 80},--hardDrop - {7, 1280-240, 720-80, 80},--softDrop - {8, 1280-80, 720-240, 80},--hold - {9, 80, 720-240, 80},--func - {10,80, 320, 80},--restart - },--Keyboard set - { - {10,70, 50,30},--restart - {9, 130, 50,30},--func - {4, 190, 50,30},--rotLeft - {3, 250, 50,30},--rotRight - {5, 310, 50,30},--rotFlip - {1, 370, 50,30},--moveLeft - {2, 430, 50,30},--moveRight - {8, 490, 50,30},--hold - {7, 550, 50,30},--softDrop1 - {6, 610, 50,30},--hardDrop - {11,670, 50,30},--insLeft - {12,730, 50,30},--insRight - {13,790, 50,30},--insDown - {14,850, 50,30},--down1 - {15,910, 50,30},--down4 - {16,970, 50,30},--down10 - {17,1030, 50,30},--dropLeft - {18,1090, 50,30},--dropRight - {19,1150, 50,30},--addLeft - {20,1210, 50,30},--addRight - },--PC key feedback(top&in a row) -} -local customSet={ - {20,20,1,1,7,1,1,1,3,4,1,2,3}, - {18,20,1,1,7,1,1,1,8,3,8,3,3}, - {22,22,1,1,7,3,1,1,8,4,1,7,7}, - {20,20,1,1,7,1,1,3,8,3,1,7,8}, - {1,11,8,11,4,1,2,1,8,3,1,4,9}, -} -local function useDefaultSet(n) - for i=1,#customSet[n]do - customSel[i]=customSet[n][i] - end - curBG=customRange.bg[customSel[12]] - BGM(customRange.bgm[customSel[13]]) -end - ---λFuncs for widgets -local function SETdisp(k) - return function() - return setting[k] - end -end -local function SETsto(k) - return function(i)setting[k]=i end -end -local function SETrev(k) - return function() - setting[k]=not setting[k] - end -end -local function pressKey(k) - return function() - love.keypressed(k) - end -end -local function setPen(i) - return function() - sceneTemp.pen=i - end -end -local function VKAdisp(n) - return function() - return VK_org[n].ava - end -end -local function VKAcode(n) - return function() - VK_org[n].ava=not VK_org[n].ava - end -end -local C=color -local skinName={ - "Normal(MrZ)", - "Jelly(Miya)", - "Plastic(MrZ)", - "Glow(MrZ)", - "Pure(MrZ)", - "Text Bone(MrZ)", - "Colored Bone(MrZ)", - "white Bone(MrZ)", -} --- T1,T2=0,0 -Widget={ - load={},intro={},quit={}, - main={ - play= newButton(150,280,200,160,C.lightRed, 55,function()scene.push()scene.swapTo("mode")end, nil,"setting"), - setting=newButton(370,280,200,160,C.lightBlue, 45,function()scene.push()scene.swapTo("setting_game")end, nil,"music"), - music= newButton(590,280,200,160,C.lightPurple,32,function()scene.push()scene.swapTo("music")end, nil,"help"), - help= newButton(150,460,200,160,C.lightYellow, 50,function()scene.push()scene.swapTo("help")end, nil,"stat"), - stat= newButton(370,460,200,160,C.lightCyan, 43,function()scene.push()scene.swapTo("stat")end, nil,"qplay"), - qplay= newButton(540,415,100,70,C.lightOrange, 23,function()scene.push()loadGame(modeSel,levelSel)end, nil,"lang"), - lang= newButton(590,505,200,70,C.lightRed, 45,function() - setting.lang=setting.lang%#langName+1 - swapLanguage(setting.lang) - TEXT(text.lang,795,500,50,"appear",1.6) - end,nil,"quit"), - -- S1= newSlider(520,550,380,10,10,nil,function()return T1 end,function(i)T1=i end), - -- S2= newSlider(520,590,380,10,10,nil,function()return T2 end,function(i)T2=i end), - quit= newButton(370,620,280,100,C.lightGrey, 55,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"play"), - }, - mode={ - up= newButton(1000, 210,200,140,C.white, 75,pressKey("up"), function()return modeSel==1 end), - down= newButton(1000, 430,200,140,C.white, 75,pressKey("down"), function()return modeSel==#modeID end), - left= newButton(190, 150,100,80, C.white, 35,pressKey("left"), function()return levelSel==1 end), - right= newButton(350, 150,100,80, C.white, 35,pressKey("right"), function()return levelSel==#modes[modeID[modeSel]].level end), - start= newButton(1000, 600,250,100,C.lightGreen, 45,function()scene.push()loadGame(modeSel,levelSel)end), - custom= newButton(275, 460,200,90, C.lightYellow, 35,function()scene.push()scene.swapTo("custom")end), - back= newButton(640, 630,230,90, C.white, 40,scene.back), - }, - music={ - bgm= newSlider(760, 80,400,10,35,nil,SETdisp("bgm"),function(i)setting.bgm=i;BGM(bgmPlaying)end), - up= newButton(1100, 200,120,120,C.white,55,pressKey("up")), - play= newButton(1100, 340,120,120,C.white,35,pressKey("space"),function()return setting.bgm==0 end), - down= newButton(1100, 480,120,120,C.white,55,pressKey("down")), - back= newButton(640, 630,230,90, C.white,40,scene.back), - }, - custom={ - up= newButton(1000, 220,100,100,C.white, 45,function()sceneTemp=(sceneTemp-2)%#customID+1 end), - down= newButton(1000, 460,100,100,C.white, 45,function()sceneTemp=sceneTemp%#customID+1 end), - left= newButton(880, 340,100,100,C.white, 45,pressKey("left")), - right= newButton(1120, 340,100,100,C.white, 45,pressKey("right")), - start1= newButton(880, 580,220,70, C.lightGreen, 35,function()scene.push()loadGame(0,1)end), - start2= newButton(1120, 580,220,70, C.lightPurple, 35,function()scene.push()loadGame(0,2)end), - draw= newButton(1000, 90, 190,85, C.lightCyan, 35,function()scene.push()scene.swapTo("draw")end), - set1= newButton(640, 160,240,75, C.lightYellow, 35,function()useDefaultSet(1)end), - set2= newButton(640, 250,240,75, C.lightYellow, 35,function()useDefaultSet(2)end), - set3= newButton(640, 340,240,75, C.lightYellow, 35,function()useDefaultSet(3)end), - set4= newButton(640, 430,240,75, C.lightYellow, 35,function()useDefaultSet(4)end), - set5= newButton(640, 520,240,75, C.lightYellow, 35,function()useDefaultSet(5)end), - back= newButton(640, 630,180,60, C.white, 35,scene.back), - }, - draw={ - block1= newButton(920, 80, 120,120,C.red, 60,setPen(1)), - block2= newButton(1060, 80, 120,120,C.green, 60,setPen(2)), - block3= newButton(1200, 80, 120,120,C.orange, 60,setPen(3)), - block4= newButton(920, 220,120,120,C.blue, 60,setPen(4)), - block5= newButton(1060, 220,120,120,C.magenta, 60,setPen(5)), - block6= newButton(1200, 220,120,120,C.yellow, 60,setPen(6)), - block7= newButton(920, 360,120,120,C.cyan, 60,setPen(7)), - gb1= newButton(1060, 360,120,120,C.darkGrey, 60,setPen(9)), - gb2= newButton(1200, 360,120,120,C.grey, 60,setPen(10)), - gb3= newButton(920, 500,120,120,C.darkPurple, 60,setPen(11)), - gb4= newButton(1060, 500,120,120,C.darkRed, 60,setPen(12)), - gb5= newButton(1200, 500,120,120,C.darkGreen, 60,setPen(13)), - clear= newButton(780, 80, 120,120,C.white, 40,pressKey("delete")), - any= newButton(780, 220,120,120,C.lightGrey, 40,setPen(0)), - space= newButton(780, 360,120,120,C.grey, 65,setPen(-1)), - back= newButton(1200, 640,120,120,C.white, 35,scene.back), - }, - play={ - pause= newButton(1235,45,80,80,C.white,25,pauseGame), - }, - pause={ - resume= newButton(640,290,240,100,C.white,45,resumeGame), - restart=newButton(640,445,240,100,C.white,45,function() - clearTask("play") - updateStat() - resetGameData() - scene.swapTo("play","none") - end), - sfx= newSlider(950,60,280,10,35,function()SFX("blip_1")end, SETdisp("sfx"),SETsto("sfx")), - bgm= newSlider(950,120,280,10,35,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"),SETsto("bgm")), - quit= newButton(640,600,240,100,C.white,45,scene.back), - }, - setting_game={ - graphic=newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end,nil,"sound"), - sound= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"dasD"), - dasD= newButton(180,230,50,50,C.white,40,function() - setting.das=(setting.das-1)%31 - if setting.arr>setting.das then - setting.arr=setting.das - Widget.setting_game.arrD:FX() - SFX("blip_1",.4) - end - end,nil,"dasU"), - dasU= newButton(400,230,50,50,C.white,40,function() - setting.das=(setting.das+1)%31 - if setting.arr>setting.das then - setting.das=setting.arr - Widget.setting_game.arrD:FX() - SFX("blip_1",.4) - end - end,nil,"arrD"), - arrD= newButton(500,230,50,50,C.white,40,function() - setting.arr=(setting.arr-1)%16 - if setting.arr>setting.das then - setting.das=setting.arr - Widget.setting_game.dasU:FX() - SFX("blip_1",.4) - end - end,nil,"arrU"), - arrU= newButton(720,230,50,50,C.white,40,function() - setting.arr=(setting.arr+1)%16 - if setting.arr>setting.das then - setting.das=setting.arr - Widget.setting_game.dasU:FX() - SFX("blip_1",.4) - end - end,nil,"sddasD"), - sddasD= newButton(180,340,50,50,C.white,40, function()setting.sddas=(setting.sddas-1)%11 end, nil,"sddasU"), - sddasU= newButton(400,340,50,50,C.white,40, function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"), - sdarrD= newButton(500,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"), - sdarrU= newButton(720,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"), - quickR= newSwitch(580,430,35,SETdisp("quickR"), SETrev("quickR"), nil,"swap"), - swap= newSwitch(580,510,20,SETdisp("swap"), SETrev("swap"), nil,"fine"), - fine= newSwitch(580,590,20,SETdisp("fine"), SETrev("fine"), nil,"ctrl"), - ctrl= newButton(1020,230,320,80,C.white,35,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"), - touch= newButton(1020,340,320,80,C.white,35,function()scene.push()scene.swapTo("setting_touch")end,nil,"back"), - back= newButton(1160,600,160,160,C.white,50,scene.back,nil,"graphic"), - }, - setting_graphic={ - sound= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"game"), - game= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"ghost"), - ghost= newSwitch(310,180,35,SETdisp("ghost"), SETrev("ghost"), nil,"center"), - center= newSwitch(580,180,35,SETdisp("center"), SETrev("center"), nil,"smo"), - smo= newSwitch(310,260,25,SETdisp("smo"), SETrev("smo"), nil,"grid"), - grid= newSwitch(580,260,30,SETdisp("grid"), SETrev("grid"), nil,"dropFX"), - dropFX= newSlider(310,350,373,5,35,nil,SETdisp("dropFX"), SETsto("dropFX"), nil,"shakeFX"), - shakeFX=newSlider(310,430,373,5,35,nil,SETdisp("shakeFX"), SETsto("shakeFX"), nil,"atkFX"), - atkFX= newSlider(310,510,373,5,35,nil,SETdisp("atkFX"), SETsto("atkFX"), nil,"frame"), - frame= newSlider(310,590,373,10,35,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"fullscreen"), - fullscreen=newSwitch(990,180,40,SETdisp("fullscreen"),function() - setting.fullscreen=not setting.fullscreen - love.window.setFullscreen(setting.fullscreen) - if not setting.fullscreen then - love.resize(love.graphics.getWidth(),love.graphics.getHeight()) - end - end,nil,"bg"), - bg= newSwitch(990,250,35,SETdisp("bg"),SETrev("bg"),nil,"bgblock"), - bgblock=newSwitch(990,330,35,SETdisp("bgblock"),SETrev("bgblock"),nil,"skin"),--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end - skin= newButton(810,420,120,60,C.white,35,function() - local _=setting.skin%8+1 - setting.skin=_ - changeBlockSkin(_) - TEXT(skinName[_],850,475,28,"appear") - end,nil,"back"), - back= newButton(1160,600,160,160,C.white,50,scene.back,nil,"sound"), - }, - setting_sound={ - game= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"graphic"), - graphic=newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end, nil,"sfx"), - sfx= newSlider(180,250,400,10,35,function()SFX("blip_1")end, SETdisp("sfx"), SETsto("sfx"), nil,"bgm"), - bgm= newSlider(750,250,400,10,35,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"), SETsto("bgm"), nil,"vib"), - vib= newSlider(180,440,400,5 ,35,function()VIB(1)end, SETdisp("vib"), SETsto("vib"), nil,"voc"), - voc= newSlider(750,440,400,10,35,function()VOICE("nya")end, SETdisp("voc"), SETsto("voc"), nil,"stereo"), - stereo= newSlider(180,630,400,10,35,function()SFX("move",1,-1)SFX("lock",1,1)end, SETdisp("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"back"), - back=newButton(1160,600,160,160,C.white,50,scene.back,nil,"game"), - }, - setting_key={ - back=newButton(1140,650,200,80,C.white,45,scene.back), - }, - setting_touch={ - default=newButton(520,80,170,80,C.white,35,function() - local D=virtualkeySet[sceneTemp.default] - for i=1,#VK_org do - VK_org[i].ava=false - end - for n=1,#D do - local T=D[n] - if T[1]then - local B=VK_org[n] - B.ava=true - B.x,B.y,B.r=T[2],T[3],T[4] - end - end--Replace keys - sceneTemp.default=sceneTemp.default%5+1 - sceneTemp.sel=nil - end), - snap= newButton(760,80,170,80,C.white,35,function() - sceneTemp.snap=sceneTemp.snap%6+1 - end), - option= newButton(520,180,170,80,C.white,40,function() - scene.push() - scene.swapTo("setting_touchSwitch") - end), - back= newButton(760,180,170,80,C.white,40,scene.back), - size= newSlider(450,265,460,14,40,nil,function() - return VK_org[sceneTemp.sel].r/10-1 - end, - function(v) - if sceneTemp.sel then - VK_org[sceneTemp.sel].r=10+v*10 - end - end, - function()return not sceneTemp.sel end), - }, - setting_touchSwitch={ - b1= newSwitch(280,80, 35,VKAdisp(1),VKAcode(1)), - b2= newSwitch(280,140, 35,VKAdisp(2),VKAcode(2)), - b3= newSwitch(280,200, 35,VKAdisp(3),VKAcode(3)), - b4= newSwitch(280,260, 35,VKAdisp(4),VKAcode(4)), - b5= newSwitch(280,320, 35,VKAdisp(5),VKAcode(5)), - b6= newSwitch(280,380, 35,VKAdisp(6),VKAcode(6)), - b7= newSwitch(280,440, 35,VKAdisp(7),VKAcode(7)), - b8= newSwitch(280,500, 35,VKAdisp(8),VKAcode(8)), - b9= newSwitch(280,560, 35,VKAdisp(9),VKAcode(9)), - b10= newSwitch(280,620, 35,VKAdisp(10),VKAcode(10)), - b11= newSwitch(620,80, 35,VKAdisp(11),VKAcode(11)), - b12= newSwitch(620,140, 35,VKAdisp(12),VKAcode(12)), - b13= newSwitch(620,200, 35,VKAdisp(13),VKAcode(13)), - b14= newSwitch(620,260, 35,VKAdisp(14),VKAcode(14)), - b15= newSwitch(620,320, 35,VKAdisp(15),VKAcode(15)), - b16= newSwitch(620,380, 35,VKAdisp(16),VKAcode(16)), - b17= newSwitch(620,440, 35,VKAdisp(17),VKAcode(17)), - b18= newSwitch(620,500, 35,VKAdisp(18),VKAcode(18)), - b19= newSwitch(620,560, 35,VKAdisp(19),VKAcode(19)), - b20= newSwitch(620,620, 35,VKAdisp(20),VKAcode(20)), - norm= newButton(840,100,240,80,C.white,45,function()for i=1,20 do VK_org[i].ava=i<11 end end), - pro= newButton(1120,100,240,80,C.white,35,function()for i=1,20 do VK_org[i].ava=true end end), - hide= newSwitch(1170,200,40,SETdisp("VKSwitch"),SETrev("VKSwitch")), - track= newSwitch(1170,300,35,SETdisp("VKTrack"),SETrev("VKTrack")), - icon= newSwitch(850,300,40,SETdisp("VKIcon"),SETrev("VKIcon")), - tkset= newButton(1120,400,240,80,C.white,32,function() - scene.push() - scene.swapTo("setting_trackSetting") - end,function()return not setting.VKTrack end), - alpha= newSlider(840,490,400,10,40,nil,SETdisp("VKAlpha"),SETsto("VKAlpha")), - back= newButton(1100,600,240,80,C.white,45,scene.back), - }, - setting_trackSetting={ - VKDodge=newSwitch(400,200, 35,SETdisp("VKDodge"),SETrev("VKDodge")), - VKTchW= newSlider(140,310,1000,10,35,nil,SETdisp("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end), - VKCurW= newSlider(140,370,1000,10,35,nil,SETdisp("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end), - back= newButton(1080,600,240,80,C.white,45,scene.back), - }, - help={ - his= newButton(1050,520,230,60,C.white,35,function()scene.push()scene.swapTo("history")end,nil,"back"), - qq= newButton(1050,600,230,60,C.white,35,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"), - back= newButton(640, 600,180,60,C.white,35,scene.back,nil,"qq"), - }, - history={ - prev= newButton(1155,170,180,180,C.white,65,pressKey("up"),function()return sceneTemp==1 end), - next= newButton(1155,400,180,180,C.white,65,pressKey("down"),function()return sceneTemp==#updateLog-22 end), - back= newButton(1155,600,180,90,C.white,35,scene.back), - }, - stat={ - path= newButton(980,620,250,60,C.white,25,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"), - back= newButton(640,620,180,60,C.white,35,scene.back,nil,"path"), - }, -} -for _,L in next,Widget do - for _,W in next,L do - if W.next then - W.next,L[W.next].prev=L[W.next],W - end - end -end -widget_sel=nil--selected widget object \ No newline at end of file +snapLevelValue={1,10,20,40,60,80} \ No newline at end of file diff --git a/main.lua b/main.lua index 441a6381..1411a2c3 100644 --- a/main.lua +++ b/main.lua @@ -8,22 +8,38 @@ local gc,sys=love.graphics,love.system local Timer=love.timer.getTime local int,rnd,max,min=math.floor,math.random,math.max,math.min local rem=table.remove + +package.path="?.lua" NULL=function()end +--Libs ------------------------------------------------------------- system=sys.getOS() local xOy=love.math.newTransform() local mx,my,mouseShow=-20,-20,false -local touching--第一触摸ID +local touching=nil--第一触摸ID +local touchDist=nil local devMode=0 -modeSel,levelSel=1,3--初始模式选择(saved in setting) players={alive={},human=0} -scr={x=0,y=0,w=gc.getWidth(),h=gc.getHeight(),k=1} +scr={x=0,y=0,w=nil,h=nil,k=1} local scr=scr +mapCam={ + sel=nil,--selected mode ID + x=0,y=0,k=1,--camera pos/k + x1=0,y1=0,k1=1,--camera pos/k shown + --basic paras + + keyCtrl=false,--if controlling with key + + zoomMethod=nil, + zoomK=nil, + --for auto zooming when enter/leave scene +} curBG="none" bgmPlaying=nil voiceQueue={free=0} texts={} +widget_sel=nil--selected widget object virtualkeyDown,virtualkeyPressTime={},{} for i=1,20 do virtualkeyDown[i]=X @@ -35,20 +51,6 @@ kb.setTextInput(false) ms.setVisible(false) --Application Vars ------------------------------------------------------------- -local Fonts={} -function setFont(s) - if s~=currentFont then - if Fonts[s]then - gc.setFont(Fonts[s]) - else - local t=gc.setNewFont("font.ttf",s) - Fonts[s]=t - gc.setFont(t) - end - currentFont=s - end - return Fonts[s] -end customSel={22,22,1,1,7,3,1,1,8,4,1,1,1} preField={h=20} for i=1,10 do preField[i]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}end @@ -56,6 +58,10 @@ for i=11,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end --Game system Vars ------------------------------------------------------------- +setFont=require("parts/font") +blocks=require("parts/mino") +-- require("parts/light") +-- require("parts/shader") scene=require("scene") require("default_data") require("class") @@ -64,13 +70,12 @@ require("toolfunc") require("sound") require("text") require("list") +require("player") +Widget=require("widgetList") require("dataList") require("texture") -require("light") local Tmr=require("timer") local Pnt=require("paint") -require("player") -require("shader") --Modules ------------------------------------------------------------- local powerInfoCanvas,updatePowerInfo @@ -175,10 +180,12 @@ local function wheelScroll(y) floatWheel=floatWheel+1 end end -local mouseDown,mouseMove,mouseUp,wheelmoved={},{},{},{} +local mouseClick,touchClick={},{} +local mouseDown,mouseMove,mouseUp,wheelMoved={},{},{},{} local touchDown,touchUp,touchMove={},{},{} local keyDown,keyUp={},{} local gamepadDown,gamepadUp={},{} + function mouseDown.intro(x,y,k) if k==2 then VOICE("bye") @@ -202,42 +209,103 @@ function keyDown.intro(key) end end -function wheelmoved.mode(x,y) - wheelScroll(y) - +local function onMode(x,y) + local cam=mapCam + x=(cam.x1-640+x)/cam.k1 + y=(cam.y1-360+y)/cam.k1 + local MM,R=modes,modeRanks + for _=1,#MM do + if R[_]then + local M=MM[_] + local s=M.size + if M.shape==1 then + if x>M.x-s and xM.y-s and y1.5 then k=1.5 + elseif k<.3 then k=.3 + end + t=k/t + if cam.sel then + cam.x=(cam.x-180)*t+180;cam.y=cam.y*t + else + cam.x=cam.x*t;cam.y=cam.y*t + end + cam.k=k + cam.keyCtrl=false +end +function mouseMove.mode(x,y,dx,dy) + if ms.isDown(1)then + mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy + end + mapCam.keyCtrl=false +end +function mouseClick.mode(x,y,k) + local cam=mapCam + local _=cam.sel + if not cam.sel or x<920 then + local __=onMode(x,y) + if __ and _~=__ then + SFX("click") + cam.moving=true + _=modes[__] + cam.x,cam.y=_.x*cam.k+180,_.y*cam.k + end + cam.sel=__ + end + cam.keyCtrl=false +end +function touchMove.mode(id,x,y,dx,dy) + local L=tc.getTouches() + if not L[2]then + mapCam.x,mapCam.y=mapCam.x-dx,mapCam.y-dy + elseif not L[3]then + x,y=xOy:inverseTransformPoint(tc.getPosition(L[1])) + dx,dy=xOy:inverseTransformPoint(tc.getPosition(L[2]))--dx,dy not Δ! + local d=(x-dx)^2+(y-dy)^2 + if d>100 then + d=d^.5 + if touchDist then + wheelMoved.mode(nil,(d-touchDist)*.02) + end + touchDist=d + end + end + mapCam.keyCtrl=false +end +function touchClick.mode(x,y,id) + mouseClick.mode(x,y,1) end function keyDown.mode(key) - if key=="down"then - if modeSel<#modeID then - modeSel=modeSel+1 - levelSel=1 - SFX("move",.4) + if key=="return"then + if mapCam.sel then + mapCam.keyCtrl=false + scene.push()loadGame(mapCam.sel) end - elseif key=="up"then - if modeSel>1 then - modeSel=modeSel-1 - levelSel=1 - SFX("move",.4) - end - elseif key=="left"then - if levelSel>1 then - levelSel=levelSel-1 - end - elseif key=="right"then - if levelSel<#modes[modeID[modeSel]].level then - levelSel=levelSel+1 - end - elseif key=="return"then - scene.push()loadGame(modeSel,levelSel) - elseif key=="c"then - scene.push() - scene.swapTo("custom") elseif key=="escape"then - scene.back() + if mapCam.sel then + mapCam.sel=nil + else + scene.back() + end + elseif mapCam.sel==71 or mapCam.sel==72 then + if key=="q"then + scene.push()scene.swapTo("draw") + elseif key=="e"then + scene.push()scene.swapTo("custom") + end end end -function wheelmoved.music(x,y) +function wheelMoved.music(x,y) if y>0 then keyDown.music("up") elseif y<0 then @@ -280,13 +348,6 @@ function keyDown.custom(key) sceneTemp=sel%#customID+1 elseif key=="up"then sceneTemp=(sel-2)%#customID+1 - elseif key=="d"then - scene.push() - scene.swapTo("draw") - elseif key=="return"then - scene.push()loadGame(0,1) - elseif key=="space"then - scene.push()loadGame(0,2) elseif key=="1"then Widget.custom.set1.code() elseif key=="2"then @@ -314,7 +375,7 @@ function mouseMove.draw(x,y,dx,dy) preField[sy][sx]=ms.isDown(1)and sceneTemp.pen or ms.isDown(2)and -1 or 0 end end -function wheelmoved.draw(x,y) +function wheelMoved.draw(x,y) local pen=sceneTemp.pen if y<0 then pen=pen+1 @@ -371,6 +432,10 @@ function keyDown.draw(key) end elseif key=="escape"then scene.back() + elseif key=="c"then + if kb.isDown("lctrl","rctrl")then copyBoard()end + elseif key=="v"then + if kb.isDown("lctrl","rctrl")then pasteBoard()end else pen=penKey[key]or pen end @@ -631,14 +696,14 @@ function gamepadUp.play(key) end end -function wheelmoved.history(x,y) +function wheelMoved.history(x,y) wheelScroll(y) end function keyDown.history(key) if key=="up"then - sceneTemp=max(sceneTemp-10,1) + sceneTemp[2]=max(sceneTemp[2]-10,1) elseif key=="down"then - sceneTemp=min(sceneTemp+10,#updateLog-22) + sceneTemp[2]=min(sceneTemp[2]+10,#sceneTemp[1]-22) elseif key=="escape"then scene.back() end @@ -722,6 +787,7 @@ local function widgetControl_gamepad(i) end end end +local lastX,lastY--last clickDown pos function love.mousepressed(x,y,k,t,num) if devMode>0 then print(x,y)end if t then return end @@ -736,6 +802,8 @@ function love.mousepressed(x,y,k,t,num) widgetPress(widget_sel,mx,my) end end + lastX=mx + lastY=my mouseShow=true end function love.mousemoved(x,y,dx,dy,t) @@ -764,9 +832,12 @@ function love.mousereleased(x,y,k,t,num) if mouseUp[scene.cur]then mouseUp[scene.cur](mx,my,k) end + if(mx-lastX)^2+(my-lastY)^2<26 and mouseClick[scene.cur]then + mouseClick[scene.cur](mx,my,k) + end end function love.wheelmoved(x,y) - if wheelmoved[scene.cur]then wheelmoved[scene.cur](x,y)end + if wheelMoved[scene.cur]then wheelMoved[scene.cur](x,y)end end function love.touchpressed(id,x,y) @@ -775,8 +846,10 @@ function love.touchpressed(id,x,y) touching=id love.touchmoved(id,x,y,0,0) end + touchDist=nil--reset distance + lastX,lastY=xOy:inverseTransformPoint(x,y) if touchDown[scene.cur]then - touchDown[scene.cur](id,xOy:inverseTransformPoint(x,y)) + touchDown[scene.cur](id,lastX,lastY) end end function love.touchmoved(id,x,y,dx,dy) @@ -811,6 +884,9 @@ function love.touchreleased(id,x,y) if touchUp[scene.cur]then touchUp[scene.cur](id,x,y) end + if(x-lastX)^2+(y-lastY)^2<26 and touchClick[scene.cur]then + touchClick[scene.cur](x,y,k) + end end function love.keypressed(i) mouseShow=false @@ -901,9 +977,6 @@ function love.focus(f) if system~="Android" and not f and scene.cur=="play"then pauseGame()end end function love.update(dt) - -- if players then for k,v in pairs(players[1])do - -- if rawget(_G,k)and k~="next"and k~="hold"and k~="stat"then print(k,_G[v])end - -- end end--check player data flew for i=#sysFX,1,-1 do local S=sysFX[i] S[2]=S[2]+1 @@ -943,8 +1016,10 @@ function love.update(dt) if S.time==S.mid then scene.cur=S.tar scene.init(S.tar) + for _,W in next,Widget[S.tar]do + W:reset() + end--重置控件 widget_sel=nil - texts={} collectgarbage() --此时场景切换 end @@ -967,18 +1042,18 @@ function love.update(dt) if Q.s==0 then--闲置轨,自动删除多余 if i>3 then local _=voiceQueue - for i=i,#_ do + ::L:: _[i]=_[i+1] - end + if _[i]then i=i+1 goto L end end elseif Q.s==1 then--等待转换 Q[1]=getVoice(Q[1]) Q[1]:setVolume(setting.voc*.1) Q[1]:play() Q.s=Q[2]and 2 or 4 - elseif Q.s==2 then--播放1,等待2 + elseif Q.s==2 then--播放1,准备2 if Q[1]:getDuration()-Q[1]:tell()<.08 then - Q[2]=getVoice(Q[2]) + Q[2]=getVoice(Q[2])--Bug:no voice called Q[2](may fixed) Q[2]:setVolume(setting.voc*.1) Q[2]:play() Q.s=3 @@ -991,27 +1066,13 @@ function love.update(dt) Q.s=Q[2]and 2 or 4 end elseif Q.s==4 then--最后播放 - if not Q[1]:isPlaying()then + if not Q[1].isPlaying(Q[1])then--Bug:Q[1] is nil Q[1]=nil Q.s=0 end end - if #Q>0 then - if Q[1]:isPlaying()then - if Q[2]and type(Q[2])=="string"and Q[1]:getDuration()-Q[1]:tell()<.08 then - Q[2]=getVoice(Q[2]) - end - --快放完了,播放下一个 - else - for i=1,#Q do - Q[i]=Q[i+1] - end - --放完了,移除 - end - else - end end - for k,W in next,Widget[scene.cur]do + for _,W in next,Widget[scene.cur]do W:update() end--更新控件 end @@ -1036,7 +1097,7 @@ function love.draw() W:draw() end end--Draw widgets - if mouseShow and not touching then + if mouseShow then local r=Timer()*.5 gc.setColor(1,1,1,min(1-math.abs(1-r%1*2),.3)) r=int(r)%7+1 @@ -1109,7 +1170,7 @@ function love.run() for N,a,b,c,d,e in POLL()do if N=="quit"then destroyPlayers() - saveData() + saveStat() saveSetting() goto END elseif love[N]then @@ -1140,12 +1201,32 @@ function love.run() end ::END:: end - -userData,userSetting=love.filesystem.newFile("userdata"),love.filesystem.newFile("usersetting") -if love.filesystem.getInfo("userdata")then - loadData() +------------------------------------------------------------- +local F=love.filesystem +if F.getInfo("data")then + F.write("data.dat",F.read("data")) + F.remove("data") end -if love.filesystem.getInfo("usersetting")then +if F.getInfo("userdata")then + F.write("data.dat",F.read("userdata")) + F.remove("userdata") +end +if F.getInfo("setting")then + F.write("setting.dat",F.read("setting")) + F.remove("setting") +end +if F.getInfo("usersetting")then + F.write("setting.dat",F.read("usersetting")) + F.remove("usersetting") +end +--NEW FILENAME!!! +FILE={ + data=F.newFile("data.dat"), + setting=F.newFile("setting.dat"), + vk=F.newFile("vk"), +} +if F.getInfo("data.dat")then loadStat()end +if F.getInfo("setting.dat")then loadSetting() elseif system=="Android"or system=="iOS" then setting.swap=false diff --git a/modes/GM.lua b/modes/GM.lua new file mode 100644 index 00000000..16585882 --- /dev/null +++ b/modes/GM.lua @@ -0,0 +1,68 @@ +local int,max,min=math.floor,math.max,math.min +local sectionName={"M7","M8","M9","M","MK","MV","MO","MM","GM"} +local function score(P) + local F=false + if P.modeData.point<70 then--if Less then MM + local R=#P.cleared + if R==4 then R=10 end + P.modeData.point=P.modeData.point+R + P.modeData.event=sectionName[int(P.modeData.point*.1)+1] + end +end + +return{ + name={ + "大师", + "大师", + "GM", + }, + level={ + "", + "", + "", + }, + info={ + "成为方块大师", + "成为方块大师", + "To be Grand Master", + }, + color=color.lightBlue, + env={ + _20G=true, + drop=0,lock=15, + wait=10,fall=15, + next=3, + visible="fast", + freshLimit=15, + dropPiece=score, + task=function(P) + if P.stat.time>=53.5 then + P.modeData.point=min(P.modeData.point+16,80) + P.modeData.event=sectionName[int(P.modeData.point*.1)+1] + Event.win(P,"finish") + end + end, + arr=1, + bg="game3",bgm="shining terminal", +}, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + mDraw(drawableText.grade,-82,170) + setFont(55) + mStr(P.modeData.event,-82,110) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.modeData.point,P.stat.score}end, + 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 + 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 + end, +} \ No newline at end of file diff --git a/modes/attacker_hard.lua b/modes/attacker_hard.lua new file mode 100644 index 00000000..a2675ef9 --- /dev/null +++ b/modes/attacker_hard.lua @@ -0,0 +1,72 @@ +local int,rnd=math.floor,math.random +return{ + name={ + "进攻", + "进攻", + "Attacker", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "进攻练习", + "进攻练习", + "Attacking better then defending", + }, + color=color.magenta, + env={ + drop=30,lock=60, + fall=12, + freshLimit=15, + pushSpeed=2, + task=function(P) + if not P.control then return end + if P.atkBuffer.sum==0 then + 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 + B[p]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=3} + B[p+1]= {pos=rnd(3,8),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=4} + else + t=900-10*(D.event-20)--900~600 + B[p]= {pos=rnd(10),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=4} + B[p+1]= {pos=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 + if D.event<50 then + D.event=D.event+1 + D.point=int(72e4/t)*.1 + if D.event==20 then + P:showText(text.great,0,-140,100,"appear",.6) + P.gameEnv.pushSpeed=3 + elseif D.event==50 then + P:showText(text.maxspeed,0,-140,100,"appear",.6) + end + end + end + end, + bg="game3",bgm="push", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(55) + mStr(P.modeData.event,-82,200) + mStr("24",-82,320) + mDraw(drawableText.wave,-82,260) + mDraw(drawableText.nextWave,-82,380) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]100 and 4 or W>=80 and 3 or W>=50 and 2 or W>=20 and 1 + end, +} \ No newline at end of file diff --git a/modes/attacker_ultimate.lua b/modes/attacker_ultimate.lua new file mode 100644 index 00000000..44fc6873 --- /dev/null +++ b/modes/attacker_ultimate.lua @@ -0,0 +1,85 @@ +local int,rnd=math.floor,math.random +return{ + name={ + "进攻", + "进攻", + "Attacker", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "进攻练习", + "进攻练习", + "Attacking better then defending", + }, + color=color.lightYellow, + env={ + drop=5,lock=60, + fall=8, + freshLimit=15, + task=function(P) + if not P.control then return end + if P.atkBuffer.sum<2 then + local p=#P.atkBuffer+1 + local B,D=P.atkBuffer,P.modeData + local s,t + if D.event<10 then + t=1000-20*D.event--1000~800 + B[p]= {pos=rnd(5,6),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=3} + B[p+1]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=4} + s=22 + elseif D.event<20 then + t=800-20*(D.event-15)--800~600 + B[p]= {pos=rnd(3,8),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4} + B[p+1]= {pos=rnd(4,7),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5} + s=25 + else + t=600-15*(D.event-30)--600~450 + B[p]= {pos=rnd(2)*9-8,amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5} + B[p+1]= {pos=rnd(3,8),amount=16,countdown=t,cd0=t,time=0,sent=false,lv=5} + s=28 + end + B.sum=B.sum+s + P.stat.recv=P.stat.recv+s + if D.event<45 then + D.event=D.event+1 + D.point=int(s*36e3/t)*.1 + if D.event==10 then + P:showText(text.great,0,-140,100,"appear",.6) + P.gameEnv.pushSpeed=4 + elseif D.event==20 then + P:showText(text.awesome,0,-140,100,"appear",.6) + P.gameEnv.pushSpeed=5 + elseif D.event==30 then + P:showText(text.maxspeed,0,-140,100,"appear",.6) + end + end + end + end, + bg="game4",bgm="shining terminal", +}, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(55) + mStr(P.modeData.event,-82,200) + mStr( + P.modeData.event<10 and 22 + or P.modeData.event<20 and 25 + or 28 + ,-82,320) + mDraw(drawableText.wave,-82,260) + mDraw(drawableText.nextWave,-82,380) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]40 and 4 or W>=30 and 3 or W>=20 and 2 or W>=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/bigbang.lua b/modes/bigbang.lua new file mode 100644 index 00000000..7226ab40 --- /dev/null +++ b/modes/bigbang.lua @@ -0,0 +1,53 @@ +local format=string.format +local function getField() + local F={} + return F +end +local function newField(P) + +end +return{ + name={ + "大爆炸", + "大爆炸", + "Big Bang", + }, + level={ + "简单", + "简单", + "EASY", + }, + info={ + "All-spin 入门教程", + "All-spin 入门教程", + "All-spin Tutorial!", + }, + color=color.grey, + env={ + drop=1e99,lock=1e99, + hold=false, + dropPiece=Event.lose, + task=nil, + bg="game1",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(50) + mStr("UNFINISHED",150,100) + end, + score=function(P)return{P.modeData.event,P.stat.extraRate}end, + scoreDisp=function(D)return D[1].."Stage "..format("%.2f",D[2]).."%"end, + comp=function(a,b)return a[1]>b[1]end, + getRank=function(P) + local W=P.modeData.event + return + W>=150 and 5 or + W>=100 and 4 or + W>=70 and 3 or + W>=40 and 2 or + W>=20 and 1 or + 1 + end, +} \ No newline at end of file diff --git a/modes/blind_easy.lua b/modes/blind_easy.lua new file mode 100644 index 00000000..d5c038b8 --- /dev/null +++ b/modes/blind_easy.lua @@ -0,0 +1,54 @@ +return{ + name={ + "隐形", + "隐形", + "Blind", + }, + level={ + "半隐", + "半隐", + "HALF", + }, + info={ + "最强大脑", + "最强大脑", + "Invisible board", + }, + color=color.cyan, + env={ + drop=30,lock=45, + visible="time", + dropPiece=Event.reach_winCheck, + freshLimit=10, + target=200, + bg="glow",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=150 and 3 or + L>=100 and 2 or + L>=40 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/blind_hard.lua b/modes/blind_hard.lua new file mode 100644 index 00000000..8d147077 --- /dev/null +++ b/modes/blind_hard.lua @@ -0,0 +1,56 @@ +return{ + name={ + "隐形", + "隐形", + "Blind", + }, + level={ + "瞬隐", + "瞬隐", + "SUDDEN", + }, + info={ + "最强大脑", + "最强大脑", + "Invisible board", + }, + color=color.magenta, + env={ + drop=15,lock=45, + fall=10,lock=60, + center=false, + visible="none", + dropPiece=Event.reach_winCheck, + freshLimit=15, + target=200, + bg="rgb",bgm="secret7th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=150 and 3 or + L>=90 and 2 or + L>=40 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/blind_lunatic.lua b/modes/blind_lunatic.lua new file mode 100644 index 00000000..56069532 --- /dev/null +++ b/modes/blind_lunatic.lua @@ -0,0 +1,56 @@ +return{ + name={ + "隐形", + "隐形", + "Blind", + }, + level={ + "瞬隐+", + "瞬隐+", + "SUDDEN+", + }, + info={ + "最强大脑", + "最强大脑", + "Invisible board", + }, + color=color.red, + env={ + drop=10,lock=60, + fall=5, + center=false,ghost=false, + visible="none", + dropPiece=Event.reach_winCheck, + freshLimit=15, + target=200, + bg="rgb",bgm="secret8th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=150 and 3 or + L>=100 and 2 or + L>=40 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/blind_normal.lua b/modes/blind_normal.lua new file mode 100644 index 00000000..549ac654 --- /dev/null +++ b/modes/blind_normal.lua @@ -0,0 +1,55 @@ +return{ + name={ + "隐形", + "隐形", + "Blind", + }, + level={ + "全隐", + "全隐", + "ALL", + }, + info={ + "最强大脑", + "最强大脑", + "Invisible board", + }, + color=color.green, + env={ + drop=15,lock=45, + freshLimit=10, + visible="fast", + dropPiece=Event.reach_winCheck, + freshLimit=10, + target=200, + bg="glow",bgm="reason", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=150 and 3 or + L>=100 and 2 or + L>=40 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/blind_ultimate.lua b/modes/blind_ultimate.lua new file mode 100644 index 00000000..eef4f4ae --- /dev/null +++ b/modes/blind_ultimate.lua @@ -0,0 +1,51 @@ +return{ + name={ + "隐形", + "隐形", + "Blind", + }, + level={ + "啥都不剩隐", + "啥都不剩隐", + "NOTHING", + }, + info={ + "最强大脑", + "最强大脑", + "Invisible board", + }, + color=color.red, + env={ + drop=30,lock=60, + fall=5, + block=false, + center=false,ghost=false, + visible="none", + dropPiece=Event.reach_winCheck, + freshLimit=15, + target=200, + bg="rgb",bgm="secret7th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=100 and 4 or + L>=50 and 3 or + L>=26 and 2 or + L>=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/c4wtrain_lunatic.lua b/modes/c4wtrain_lunatic.lua new file mode 100644 index 00000000..de82c236 --- /dev/null +++ b/modes/c4wtrain_lunatic.lua @@ -0,0 +1,86 @@ +local rnd=math.random +local function check_c4w(P) + for i=1,#P.cleared do + P.field[#P.field+1]=getNewRow(10) + P.visTime[#P.visTime+1]=getNewRow(20) + for i=4,7 do P.field[#P.field][i]=0 end + end + if #P.cleared==0 then + Event.lose(P) + else + if P.combo>P.modeData.point then + P.modeData.point=P.combo + end + if P.stat.row>=100 then + Event.win(P,"finish") + end + end +end + +return{ + name={ + "C4W练习", + "中四宽练习", + "C4W Train", + }, + level={ + "疯狂", + "疯狂", + "LUNATIC", + }, + info={ + "无 限 连 击", + "无 限 连 击", + "Infinite combo", + }, + color=color.red, + env={ + drop=5,lock=30, + dropPiece=check_c4w, + freshLimit=15,ospin=false, + bg="rgb",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + local P=players[1] + local F=P.field + for i=1,24 do + F[i]=getNewRow(10) + P.visTime[i]=getNewRow(20) + for x=4,7 do F[i][x]=0 end + end + local r=rnd(6) + if r==1 then F[1][5],F[1][4],F[2][4]=10,10,10 + elseif r==2 then F[1][6],F[1][7],F[2][7]=10,10,10 + elseif r==3 then F[1][4],F[2][4],F[2][5]=10,10,10 + elseif r==4 then F[1][7],F[2][7],F[2][6]=10,10,10 + elseif r==5 then F[1][4],F[1][5],F[1][6]=10,10,10 + elseif r==6 then F[1][7],F[1][6],F[1][5]=10,10,10 + end + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.combo,-82,310) + mStr(P.modeData.point,-82,400) + mDraw(drawableText.combo,-82,358) + mDraw(drawableText.mxcmb,-82,450) + end, + score=function(P)return{P.combo<=100 and P.combo or 100,P.stat.time}end, + scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=70 and 3 or + L>=40 and 2 or + L>=20 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/c4wtrain_normal.lua b/modes/c4wtrain_normal.lua new file mode 100644 index 00000000..b0645ec1 --- /dev/null +++ b/modes/c4wtrain_normal.lua @@ -0,0 +1,84 @@ +local rnd=math.random +local function check_c4w(P) + for i=1,#P.cleared do + P.field[#P.field+1]=getNewRow(10) + P.visTime[#P.visTime+1]=getNewRow(20) + for i=4,7 do P.field[#P.field][i]=0 end + end + if #P.cleared>0 then + if P.combo>P.modeData.point then + P.modeData.point=P.combo + end + if P.stat.row>=100 then + Event.win(P,"finish") + end + end +end + +return{ + name={ + "C4W练习", + "中四宽练习", + "C4W Train", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "无 限 连 击", + "无 限 连 击", + "Infinite combo", + }, + color=color.green, + env={ + drop=30,lock=60,oncehold=false, + dropPiece=check_c4w, + freshLimit=15,ospin=false, + bg="rgb",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + local P=players[1] + local F=P.field + for i=1,24 do + F[i]=getNewRow(10) + P.visTime[i]=getNewRow(20) + for x=4,7 do F[i][x]=0 end + end + local r=rnd(6) + if r==1 then F[1][5],F[1][4],F[2][4]=10,10,10 + elseif r==2 then F[1][6],F[1][7],F[2][7]=10,10,10 + elseif r==3 then F[1][4],F[2][4],F[2][5]=10,10,10 + elseif r==4 then F[1][7],F[2][7],F[2][6]=10,10,10 + elseif r==5 then F[1][4],F[1][5],F[1][6]=10,10,10 + elseif r==6 then F[1][7],F[1][6],F[1][5]=10,10,10 + end + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.combo,-82,310) + mStr(P.modeData.point,-82,400) + mDraw(drawableText.combo,-82,358) + mDraw(drawableText.mxcmb,-82,450) + end, + score=function(P)return{P.modeData.point<=100 and P.modeData.point or 100,P.stat.time}end, + scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=60 and 2 or + L>=30 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/classic_fast.lua b/modes/classic_fast.lua new file mode 100644 index 00000000..3e4618a2 --- /dev/null +++ b/modes/classic_fast.lua @@ -0,0 +1,68 @@ +local gc=love.graphics +local function check_LVup(P) + if P.stat.row>=P.gameEnv.target then + P.gameEnv.target=P.gameEnv.target+10 + if P.gameEnv.target==110 then + P.gameEnv.drop,P.gameEnv.lock=2,2 + elseif P.gameEnv.target==200 then + P.gameEnv.drop,P.gameEnv.lock=1,1 + end + if P.gameEnv.target>100 then + SFX("reach") + end + end +end + +return{ + name={ + "高速经典", + "高速经典", + "Classic", + }, + level={ + "CTWC", + "锦标赛", + "CTWC", + }, + info={ + "高速经典", + "高速经典", + "Vintage car drag racing", + }, + color=color.lightBlue, + env={ + das=16,arr=6,sddas=2,sdarr=2, + ghost=false,center=false, + drop=3,lock=3,wait=10,fall=25, + next=1,hold=false, + sequence="rnd", + freshLimit=0, + target=10,dropPiece=check_LVup, + bg="rgb",bgm="rockblock", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + 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),-82,210) + mDraw(drawableText.speedLV,-82,290) + setFont(45) + mStr(P.stat.row,-82,320) + mStr(P.gameEnv.target,-82,370) + gc.rectangle("fill",-125,375,90,4) + end, + score=function(P)return{P.stat.row,P.stat.score}end, + scoreDisp=function(D)return D[1].." Rows "..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 L=P.stat.row + return + L>=200 and 5 or + L>=191 and 4 or + L>=110 and 3 or + L>=50 and 2 or + L>=2 and 1 + end, +} \ No newline at end of file diff --git a/modes/custom_clear.lua b/modes/custom_clear.lua new file mode 100644 index 00000000..d3fdc0d2 --- /dev/null +++ b/modes/custom_clear.lua @@ -0,0 +1,80 @@ +local gc=love.graphics +local int=math.floor +return{ + name={ + "自定义", + "自定义", + "Custom", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "画点什么然后把它消除!", + "画点什么然后把它消除!", + "Draw something then clear it!", + }, + color=color.white, + env={ + dropPiece=Event.reach_winCheck, + }, + load=function() + for i=1,#customID do + local k=customID[i] + modeEnv[k]=customRange[k][customSel[i]] + end + modeEnv._20G=modeEnv.drop==0 + modeEnv.oncehold=customSel[6]==1 + newPlayer(1,340,15) + local L=modeEnv.opponent + if L~=0 then + modeEnv.target=nil + if L<10 then + newPlayer(2,965,360,.5,AITemplate("9S",2*L)) + else + newPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),modeEnv.hold,15000+5000*(L-10))) + end + end + preField.h=20 + repeat + for i=1,10 do + if preField[preField.h][i]>0 then + goto L + end + end + preField.h=preField.h-1 + until preField.h==0 + ::L:: + for _,P in next,players.alive do + local t=P.showTime*3 + for y=1,preField.h do + P.field[y]=getNewRow(0) + P.visTime[y]=getNewRow(t) + for x=1,10 do P.field[y][x]=preField[y][x]end + end + end + modeEnv.bg=customRange.bg[customSel[12]] + modeEnv.bgm=customRange.bgm[customSel[13]] + end, + mesDisp=function(P,dx,dy) + setFont(55) + if P.gameEnv.puzzle or P.gameEnv.target>1e10 then + mStr(P.stat.row,-82,225) + mDraw(drawableText.line,-82,290) + else + local R=P.gameEnv.target-P.stat.row + mStr(R>=0 and R or 0,-82,240) + end + if P.gameEnv.puzzle and P.modeData.event==0 then + local m=puzzleMark + for y=1,preField.h do for x=1,10 do + local T=preField[y][x] + if T~=0 then + gc.draw(m[T],30*x-30+dx,600-30*y+dy) + end + end end + end + end, +} \ No newline at end of file diff --git a/modes/custom_puzzle.lua b/modes/custom_puzzle.lua new file mode 100644 index 00000000..b6ceaae3 --- /dev/null +++ b/modes/custom_puzzle.lua @@ -0,0 +1,88 @@ +local gc=love.graphics +local int=math.floor +local function puzzleCheck(P) + for y=1,20 do + local L=P.field[y] + for x=1,10 do + local a,b=preField[y][x],L and L[x]or 0 + if a~=0 then + if a==-1 then if b>0 then return end + elseif a<8 then if a~=b then return end + elseif a>7 then if b==0 then return end + end + end + end + end + P.modeData.event=1 + Event.win(P,"finish") +end + +return{ + name={ + "自定义", + "自定义", + "Custom", + }, + level={ + "拼图", + "拼图", + "PUZZLE", + }, + info={ + "画点什么然后把它拼出来吧!", + "画点什么然后把它拼出来吧!", + "Draw something then stack it!", + }, + color=color.white, + env={ + puzzle=true, + Fkey=function(P)P.modeData.event=1-P.modeData.event end, + dropPiece=puzzleCheck, + }, + load=function() + for i=1,#customID do + local k=customID[i] + modeEnv[k]=customRange[k][customSel[i]] + end + modeEnv._20G=modeEnv.drop==0 + modeEnv.oncehold=customSel[6]==1 + modeEnv.target=0 + newPlayer(1,340,15) + local L=modeEnv.opponent + if L~=0 then + modeEnv.target=nil + if L<10 then + newPlayer(2,965,360,.5,AITemplate("9S",2*L)) + else + newPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),modeEnv.hold,15000+5000*(L-10))) + end + end + preField.h=20 + repeat + for i=1,10 do + if preField[preField.h][i]~=0 then + goto L + end + end + preField.h=preField.h-1 + until preField.h==0 + ::L:: + modeEnv.bg=customRange.bg[customSel[12]] + modeEnv.bgm=customRange.bgm[customSel[13]] + end, + mesDisp=function(P) + local dx,dy=P.fieldOff.x,P.fieldOff.y + setFont(55) + mStr(P.stat.row,-82,225) + mDraw(drawableText.line,-82,290) + if P.gameEnv.puzzle and P.modeData.event==0 then + local m=puzzleMark + for y=1,preField.h do for x=1,10 do + local T=preField[y][x] + if T~=0 then + gc.draw(m[T],30*x-30+dx,600-30*y+dy) + end + end end + end + end, +} \ No newline at end of file diff --git a/modes/defender_lunatic.lua b/modes/defender_lunatic.lua new file mode 100644 index 00000000..fc283b71 --- /dev/null +++ b/modes/defender_lunatic.lua @@ -0,0 +1,78 @@ +local int,rnd=math.floor,math.random +return{ + name={ + "防守", + "防守", + "Defender", + }, + level={ + "疯狂", + "疯狂", + "Lunatic", + }, + info={ + "防守练习", + "防守练习", + "Hand them!", + }, + color=color.red, + env={ + drop=5,lock=60, + fall=6, + freshLimit=15, + pushSpeed=2, + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + local t=240-2*P.modeData.event + if P.modeData.counter>=t then + P.modeData.counter=0 + for _=1,4 do + P.atkBuffer[#P.atkBuffer+1]={pos=rnd(10),amount=1,countdown=5*t,cd0=5*t,time=0,sent=false,lv=2} + end + P.atkBuffer.sum=P.atkBuffer.sum+4 + P.stat.recv=P.stat.recv+4 + local D=P.modeData + if D.event<75 then + D.event=D.event+1 + D.point=int(144e3/(240-2*D.event))*.1 + if D.event==25 then + P:showText(text.great,0,-140,100,"appear",.6) + P.gameEnv.pushSpeed=3 + P.dropDelay,P.gameEnv.drop=4,4 + elseif D.event==50 then + P:showText(text.awesome,0,-140,100,"appear",.6) + P.gameEnv.pushSpeed=4 + P.dropDelay,P.gameEnv.drop=3,3 + elseif D.event==75 then + P:showText(text.maxspeed,0,-140,100,"appear",.6) + P.dropDelay,P.gameEnv.drop=2,2 + end + end + end + end, + bg="game4",bgm="way", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(55) + mStr(P.modeData.event,-82,200) + mStr(P.modeData.point,-82,320) + mDraw(drawableText.wave,-82,260) + mDraw(drawableText.rpm,-82,380) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(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 + W>=55 and 3 or + W>=30 and 2 or + W>=20 and 1 + end, +} \ No newline at end of file diff --git a/modes/defender_normal.lua b/modes/defender_normal.lua new file mode 100644 index 00000000..91b69cc5 --- /dev/null +++ b/modes/defender_normal.lua @@ -0,0 +1,78 @@ +local int,rnd=math.floor,math.random +return{ + name={ + "防守", + "防守", + "Defender", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "防守练习", + "防守练习", + "Hand them!", + }, + color=color.green, + env={ + drop=30,lock=60, + fall=10, + freshLimit=15, + pushSpeed=1, + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + local t=360-P.modeData.event*2 + if P.modeData.counter>=t then + P.modeData.counter=0 + for _=1,3 do + P.atkBuffer[#P.atkBuffer+1]={pos=rnd(2,9),amount=1,countdown=2*t,cd0=2*t,time=0,sent=false,lv=1} + end + P.atkBuffer.sum=P.atkBuffer.sum+3 + P.stat.recv=P.stat.recv+3 + local D=P.modeData + if D.event<90 then + D.event=D.event+1 + D.point=int(108e3/(360-D.event*2))*.1 + if D.event==25 then + P:showText(text.great,0,-140,100,"appear",.6) + P.gameEnv.pushSpeed=2 + P.dropDelay,P.gameEnv.drop=20,20 + elseif D.event==50 then + P:showText(text.awesome,0,-140,100,"appear",.6) + P.gameEnv.pushSpeed=3 + P.dropDelay,P.gameEnv.drop=10,10 + elseif D.event==90 then + P.dropDelay,P.gameEnv.drop=5,5 + P:showText(text.maxspeed,0,-140,100,"appear",.6) + end + end + end + end, + bg="game3",bgm="way", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(55) + mStr(P.modeData.event,-82,200) + mStr(P.modeData.point,-82,320) + mDraw(drawableText.wave,-82,260) + mDraw(drawableText.rpm,-82,380) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(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 + W>=70 and 3 or + W>=40 and 2 or + W>=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/dig_hard.lua b/modes/dig_hard.lua new file mode 100644 index 00000000..a25d58f2 --- /dev/null +++ b/modes/dig_hard.lua @@ -0,0 +1,54 @@ +local max,rnd=math.max,math.random +return{ + name={ + "挖掘", + "挖掘", + "Dig", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "挖掘练习", + "挖掘练习", + "Downstack!", + }, + color=color.magenta, + env={ + drop=60,lock=120, + fall=20, + freshLimit=15, + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter>=max(90,180-P.modeData.event)then + P.modeData.counter=0 + P:garbageRise(10,1,rnd(10)) + P.modeData.event=P.modeData.event+1 + end + end, + bg="game2",bgm="push", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(65) + mStr(P.modeData.event,-82,310) + mDraw(drawableText.wave,-82,375) + end, + score=function(P)return{P.modeData.event,P.stat.row}end, + scoreDisp=function(D)return D[1].." Waves "..D[2].." Rows"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 + W>=80 and 3 or + W>=50 and 2 or + W>=20 and 1 + end, +} \ No newline at end of file diff --git a/modes/dig_ultimate.lua b/modes/dig_ultimate.lua new file mode 100644 index 00000000..1d8c770a --- /dev/null +++ b/modes/dig_ultimate.lua @@ -0,0 +1,53 @@ +local max,rnd=math.max,math.random +return{ + name={ + "挖掘", + "挖掘", + "Dig", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "挖掘练习", + "挖掘练习", + "Downstack!", + }, + color=color.lightYellow, + env={ + drop=10,lock=30, + freshLimit=15, + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter>=max(45,80-.3*P.modeData.event)then + P.modeData.counter=0 + P:garbageRise(11+P.modeData.event%3,1,rnd(10)) + P.modeData.event=P.modeData.event+1 + end + end, + bg="game2",bgm="secret7th", +}, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(65) + mStr(P.modeData.event,-82,310) + mDraw(drawableText.wave,-82,375) + end, + score=function(P)return{P.modeData.event,P.stat.row}end, + scoreDisp=function(D)return D[1].." Waves "..D[2].." Rows"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 + W>=80 and 3 or + W>=50 and 2 or + W>=20 and 1 + end, +} \ No newline at end of file diff --git a/modes/drought_lunatic.lua b/modes/drought_lunatic.lua new file mode 100644 index 00000000..eab205b2 --- /dev/null +++ b/modes/drought_lunatic.lua @@ -0,0 +1,47 @@ +return{ + name={ + "干旱", + "干旱", + "Drought", + }, + level={ + "100L", + "100行", + "100L", + }, + info={ + "后 妈 发 牌", + "后 妈 发 牌", + "ERRSEQ flood attack", + }, + color=color.red, + env={ + drop=20,lock=60, + sequence="drought2", + target=100,dropPiece=Event.reach_winCheck, + ospin=false, + freshLimit=15, + bg="glow",bgm="reason", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(70) + local R=100-P.stat.row + mStr(R>=0 and R or 0,-82,280) + end, + score=function(P)return{P.stat.row<=100 and P.stat.row or 100,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=0 and R or 0,-82,280) + end, + score=function(P)return{P.stat.row<=100 and P.stat.row or 100,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]b[1]end, + getRank=function(P) + local L=P.stat.row + return + L>=2600 and 5 or + L>=1500 and 4 or + L>=1000 and 3 or + L>=500 and 2 or + L>=100 and 1 + end, +} \ No newline at end of file diff --git a/modes/infinite_dig.lua b/modes/infinite_dig.lua new file mode 100644 index 00000000..aa0d2fa7 --- /dev/null +++ b/modes/infinite_dig.lua @@ -0,0 +1,63 @@ +local format,rnd=string.format,math.random +local function check_rise(P) + local L=P.cleared + for i=1,#L do + if L[i]<6 then + P:garbageRise(10,1,rnd(10)) + P.modeData.point=P.modeData.point+1 + end + end +end + +return{ + name={ + "无尽:挖掘", + "无尽:挖掘", + "Infinite:dig", + }, + level={ + "时间杀手 III", + "时间杀手 III", + "Time Killer III", + }, + info={ + "挖呀挖呀挖", + "挖呀挖呀挖", + "Dig to Nether?", + }, + color=color.white, + env={ + drop=1e99,lock=1e99, + oncehold=false, + dropPiece=check_rise, + pushSpeed=1, + bg="glow",bgm="infinite", + }, + load=function() + newPlayer(1,340,15) + for _=1,5 do + players[1]:garbageRise(10,1,rnd(10)) + end + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.modeData.point,-82,190) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.line,-82,243) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.modeData.point}end, + scoreDisp=function(D)return D[1].." Rows"end, + comp=function(a,b)return a[1]>b[1]end, + getRank=function(P) + local L=P.modeData.point + return + L>=626 and 5 or + L>=400 and 4 or + L>=200 and 3 or + L>=100 and 2 or + L>=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/marathon_hard.lua b/modes/marathon_hard.lua new file mode 100644 index 00000000..6d45608a --- /dev/null +++ b/modes/marathon_hard.lua @@ -0,0 +1,56 @@ +local gc=love.graphics +local function check(P) + if P.stat.row>=200 then + Event.win(P,"finish") + end +end + +return{ + name={ + "马拉松", + "马拉松", + "Marathon", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "200行20G马拉松", + "200行20G马拉松", + "200L marathon in 20G", + }, + color=color.magenta, + env={ + _20G=true,fall=15, + dropPiece=check, + bg="strap",bgm="race", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.row,-82,320) + mStr(200,-82,370) + gc.rectangle("fill",-125,375,90,4) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=100 and 2 or + L>=50 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/marathon_normal.lua b/modes/marathon_normal.lua new file mode 100644 index 00000000..46e90c59 --- /dev/null +++ b/modes/marathon_normal.lua @@ -0,0 +1,65 @@ +local gc=love.graphics +local marathon_drop={[0]=60,48,40,30,24,18,15,12,10,8,7,6,5,4,3,2,1,1,0,0} +local function check_LVup(P) + local T=P.modeData.point+10 + if P.stat.row>=T then + if T==200 then + Event.win(P,"finish") + else + P.gameEnv.drop=marathon_drop[T/10] + if T==180 then P.gameEnv._20G=true end + SFX("reach") + P.modeData.point=T + end + end +end + +return{ + name={ + "马拉松", + "马拉松", + "Marathon", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "200行变速马拉松", + "200行变速马拉松", + "200L marathon with acceleration", + }, + color=color.green, + env={ + drop=60,fall=20, + target=10,dropPiece=check_LVup, + bg="strap",bgm="way", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.row,-82,320) + mStr(P.modeData.point+10,-82,370) + gc.rectangle("fill",-125,375,90,4) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=150 and 2 or + L>=100 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/master_adavnce.lua b/modes/master_adavnce.lua new file mode 100644 index 00000000..f20bccf4 --- /dev/null +++ b/modes/master_adavnce.lua @@ -0,0 +1,91 @@ +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 c=#P.cleared + if c==0 and P.modeData.point%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 + P.modeData.point=P.modeData.point+s + if P.modeData.point%100==99 then + SFX("blip_1") + elseif P.modeData.point>=100*(P.modeData.event+1)then + local s=P.modeData.event+1;P.modeData.event=s--level up! + local E=P.gameEnv + curBG=s==1 and"game3"or s==2 and"game4"or s==3 and"game5"or s==4 and"game6"or"game5" + E.lock=death_lock[s] + E.wait=death_wait[s] + E.fall=death_fall[s] + E.das=int(6.9-s*.4) + if s==3 then P.gameEnv.bone=true end + if s==5 then + P.modeData.point,P.modeData.event=500,4 + Event.win(P,"finish") + else + P:showText(text.stage(s),0,-120,80,"fly") + end + SFX("reach") + end +end + +return{ + name={ + "大师", + "大师", + "Master", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "进阶20G", + "进阶20G", + "Advanced 20G", + }, + color=color.red, + env={ + _20G=true, + lock=death_lock[1], + wait=death_wait[1], + fall=death_fall[1], + dropPiece=score, + das=6,arr=1, + freshLimit=15, + bg="game2",bgm="secret7th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.modeData.point,-82,320) + mStr((P.modeData.event+1)*100,-82,370) + gc.rectangle("fill",-125,375,90,4) + end, + score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end, + scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end, + comp=function(a,b) + return a[1]>b[1]or(a[1]==b[1]and(a[2]=426 and 3 or + S>=326 and 2 or + S>=226 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/master_beginner.lua b/modes/master_beginner.lua new file mode 100644 index 00000000..faa0cf96 --- /dev/null +++ b/modes/master_beginner.lua @@ -0,0 +1,95 @@ +local gc=love.graphics +local rush_lock={20,18,16,15,14} +local rush_wait={12,10,9,8,7} +local rush_fall={18,16,14,13,12} +local function score(P) + local c=#P.cleared + if c==0 and P.modeData.point%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 + P.modeData.point=P.modeData.point+s + if P.modeData.point%100==99 then + SFX("blip_1") + elseif P.modeData.point>=100*(P.modeData.event+1)then + local s=P.modeData.event+1;P.modeData.event=s--level up! + local E=P.gameEnv + curBG=s==1 and"game1"or s==2 and"game2"or s==3 and"game3"or "game4" + E.lock=rush_lock[s] + E.wait=rush_wait[s] + E.fall=rush_fall[s] + E.das=10-s + if s==2 then + P.gameEnv.arr=2 + elseif s==4 then + P.gameEnv.bone=true + end + + if s==5 then + P.modeData.point,P.modeData.event=500,4 + Event.win(P,"finish") + else + P:showText(text.stage(s),0,-120,80,"fly") + end + SFX("reach") + end +end + +return{ + name={ + "大师", + "大师", + "Master", + }, + level={ + "疯狂", + "疯狂", + "LUNATIC", + }, + info={ + "初心20G", + "初心20G", + "Beginner 20G", + }, + color=color.red, + env={ + _20G=true, + lock=rush_lock[1], + wait=rush_wait[1], + fall=rush_fall[1], + dropPiece=score, + das=9,arr=3, + freshLimit=15, + bg="strap",bgm="secret8th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.modeData.point,-82,320) + mStr((P.modeData.event+1)*100,-82,370) + gc.rectangle("fill",-125,375,90,4) + end, + score=function(P)return{P.modeData.point,P.stat.row,P.stat.time}end, + scoreDisp=function(D)return D[1].."P "..D[2].."L "..toTime(D[3])end, + comp=function(a,b) + return a[1]>b[1]or(a[1]==b[1]and(a[2]=420 and 3 or + S>=250 and 2 or + S>=120 and 1 + end + end, +} \ No newline at end of file diff --git a/modes/master_final.lua b/modes/master_final.lua new file mode 100644 index 00000000..4e71dbf0 --- /dev/null +++ b/modes/master_final.lua @@ -0,0 +1,84 @@ +local gc=love.graphics +local int=math.floor +local function score(P) + local c=#P.cleared + if c==0 and P.modeData.point%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 + local MD=P.modeData + MD.point=MD.point+s + if MD.point%100==99 then SFX("blip_1")end + if int(MD.point*.01)>MD.event then + local s=MD.event+1;MD.event=s--level up! + P:showText(text.stage(s),0,-120,80,"fly") + local E=P.gameEnv + if s<4 then--first 300 + 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 + elseif s<10 then + if s==4 or s==7 then E.das=E.das-1 end + s=s%3 + if s==0 then E.lock=E.lock-1 + elseif s==1 then E.wait=E.wait-1 + elseif s==2 then E.fall=E.fall-1 + end + else + MD.point,MD.event=1000,9 + Event.win(P,"finish") + end + SFX("reach") + end +end + +return{ + name={ + "大师", + "大师", + "Master", + }, + level={ + "终点", + "终点", + "FINAL", + }, + info={ + "究极20G:无法到达的终点", + "究极20G:无法到达的终点", + "Extreme 20G:Unreachable destination", + }, + color=color.lightGrey, + env={ + _20G=true,lock=12, + wait=10,fall=10, + dropPiece=score, + das=5,arr=1, + freshLimit=15, + easyFresh=false,bone=true, + bg="none",bgm="shining terminal", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + local MD=P.modeData + mStr(MD.point,-82,320) + mStr((MD.event+1)*100,-82,370) + gc.rectangle("fill",-125,375,90,4) + end, + score=function(P)return{P.modeData.point,P.stat.time}end, + scoreDisp=function(D)return D[1].."P "..toTime(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 + S>=600 and 3 or + S>=400 and 2 or + S>=200 and 1 + end, +} \ No newline at end of file diff --git a/modes/pcchallenge_hard.lua b/modes/pcchallenge_hard.lua new file mode 100644 index 00000000..ef73cbc6 --- /dev/null +++ b/modes/pcchallenge_hard.lua @@ -0,0 +1,57 @@ +local gc=love.graphics +return{ + name={ + "全清挑战", + "全清挑战", + "PC Challenge", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "100行内刷PC", + "100行内刷全清", + "More PCs in 100L", + }, + color=color.magenta, + env={ + drop=60,lock=120, + fall=10, + target=100,dropPiece=Event.reach_winCheck, + freshLimit=15, + ospin=false, + bg="rgb",bgm="infinite", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + local R=100-P.stat.row + mStr(R>=0 and R or 0,-82,250) + + setFont(75) + mStr(P.stat.pc,-82,350) + mDraw(drawableText.pc,-82,432) + + gc.setColor(.5,.5,.5) + if frame>179 then + local y=72*(7-(P.stat.piece+(P.hd.id>0 and 2 or 1))%7)-36 + gc.line(320,y,442,y) + end + end, + score=function(P)return{P.stat.pc,P.stat.time}end, + scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=16 and 5 or + L>=13 and 4 or + L>=10 and 3 or + L>=7 and 2 or + L>=4 and 1 + end, +} \ No newline at end of file diff --git a/modes/pcchallenge_lunatic.lua b/modes/pcchallenge_lunatic.lua new file mode 100644 index 00000000..96554a8d --- /dev/null +++ b/modes/pcchallenge_lunatic.lua @@ -0,0 +1,57 @@ +local gc=love.graphics +return{ + name={ + "全清挑战", + "全清挑战", + "PC Challenge", + }, + level={ + "疯狂", + "疯狂", + "LUNATIC", + }, + info={ + "100行内刷PC", + "100行内刷全清", + "More PCs in 100L", + }, + color=color.red, + env={ + drop=20,lock=60, + fall=20, + target=100,dropPiece=Event.reach_winCheck, + freshLimit=15, + ospin=false, + bg="rgb",bgm="infinite", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + local R=100-P.stat.row + mStr(R>=0 and R or 0,-82,250) + + setFont(75) + mStr(P.stat.pc,-82,350) + mDraw(drawableText.pc,-82,432) + + gc.setColor(.5,.5,.5) + if frame>179 then + local y=72*(7-(P.stat.piece+(P.hd.id>0 and 2 or 1))%7)-36 + gc.line(320,y,442,y) + end + end, + score=function(P)return{P.stat.pc,P.stat.time}end, + scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=15 and 5 or + L>=12 and 4 or + L>=9 and 3 or + L>=6 and 2 or + L>=3 and 1 + end, +} \ No newline at end of file diff --git a/modes/pcchallenge_normal.lua b/modes/pcchallenge_normal.lua new file mode 100644 index 00000000..7bccf940 --- /dev/null +++ b/modes/pcchallenge_normal.lua @@ -0,0 +1,56 @@ +local gc=love.graphics +return{ + name={ + "全清挑战", + "全清挑战", + "PC Challenge", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "100行内刷PC", + "100行内刷全清", + "More PCs in 100L", + }, + color=color.green, + env={ + oncehold=false, + drop=300,lock=1e99, + target=100,dropPiece=Event.reach_winCheck, + ospin=false, + bg="rgb",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + local R=100-P.stat.row + mStr(R>=0 and R or 0,-82,250) + + setFont(75) + mStr(P.stat.pc,-82,350) + mDraw(drawableText.pc,-82,432) + + gc.setColor(.5,.5,.5) + if frame>179 then + local y=72*(7-(P.stat.piece+(P.hd.id>0 and 2 or 1))%7)-36 + gc.line(320,y,442,y) + end + end, + score=function(P)return{P.stat.pc,P.stat.time}end, + scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=25 and 5 or + L>=20 and 4 or + L>=16 and 3 or + L>=13 and 2 or + L>=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/pctrain_lunatic.lua b/modes/pctrain_lunatic.lua new file mode 100644 index 00000000..fb0e98de --- /dev/null +++ b/modes/pctrain_lunatic.lua @@ -0,0 +1,114 @@ +local int,rnd=math.floor,math.random +local ins=table.insert +local pc_drop={50,45,40,35,30,26,22,18,15,12} +local pc_lock={55,50,45,40,36,32,30} +local pc_fall={18,16,14,12,10,9,8,7,6} +local PCbase=require("parts/PCbase") +local PClist=require("parts/PClist") +local function task_PC(P) + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter==21 then + local t=P.stat.pc%2 + for i=1,4 do + local r=getNewRow(0) + for j=1,10 do + r[j]=PCbase[4*t+i][j] + end + ins(P.field,1,r) + ins(P.visTime,1,getNewRow(20)) + end + P.fieldBeneath=P.fieldBeneath+120 + P.curY=P.curY+4 + P:freshgho() + return true + end +end + +local function newPC(P) + local r=P.field;r=r[#r] + if r then + local c=0 + for i=1,10 do if r[i]>0 then c=c+1 end end + if c<5 then + Event.lose(P) + end + end + if P.stat.piece%4==0 and #P.field==0 then + P.modeData.event=P.modeData.event==0 and 1 or 0 + local r=rnd(#PClist) + local f=P.modeData.event==0 + for i=1,4 do + local b=PClist[r][i] + if f then + if b<3 then b=3-b + elseif b<5 then b=7-b + end + end + P.next[#P.next+1]={bk=blocks[b][0],id=b,color=b,name=b}--P:newNext(b)'s simple version! + end + P.modeData.counter=P.stat.piece==0 and 20 or 0 + newTask(task_PC,P) + local s=P.stat.pc*.5 + if int(s)==s and s>0 then + P.gameEnv.drop=pc_drop[s]or 10 + P.gameEnv.lock=pc_lock[s]or 20 + P.gameEnv.fall=pc_fall[s]or 5 + if s==10 then + P:showText(text.maxspeed,0,-140,100,"appear",.6) + else + P:showText(text.speedup,0,-140,40,"appear",.8) + end + end + end +end + +return{ + name={ + "全清训练", + "全清训练", + "PC Train", + }, + level={ + "疯狂", + "疯狂", + "LUNATIC", + }, + info={ + "简易PC题库,熟悉全清定式的组合", + "简易全清题库,熟悉全清定式的组合", + "Let's learn some PCs", + }, + color=color.red, + env={ + next=4, + hold=false, + drop=60,lock=60, + fall=20, + sequence="none", + freshLimit=15, + dropPiece=newPC, + ospin=false, + bg="rgb",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + newPC(players[1]) + end, + mesDisp=function(P,dx,dy) + setFont(75) + mStr(P.stat.pc,-82,330) + mDraw(drawableText.pc,-82,412) + end, + score=function(P)return{P.stat.pc,P.stat.time}end, + scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=50 and 5 or + L>=40 and 4 or + L>=30 and 3 or + L>=20 and 2 or + L>=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/pctrain_normal.lua b/modes/pctrain_normal.lua new file mode 100644 index 00000000..31409e8b --- /dev/null +++ b/modes/pctrain_normal.lua @@ -0,0 +1,97 @@ +local rnd=math.random +local ins=table.insert +local PCbase=require("parts/PCbase") +local PClist=require("parts/PClist") +local function task_PC(P) + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter==21 then + local t=P.stat.pc%2 + for i=1,4 do + local r=getNewRow(0) + for j=1,10 do + r[j]=PCbase[4*t+i][j] + end + ins(P.field,1,r) + ins(P.visTime,1,getNewRow(20)) + end + P.fieldBeneath=P.fieldBeneath+120 + P.curY=P.curY+4 + P:freshgho() + return true + end +end +local function newPC(P) + local r=P.field;r=r[#r] + if r then + local c=0 + for i=1,10 do if r[i]>0 then c=c+1 end end + if c<5 then + Event.lose(P) + end + end + if P.stat.piece%4==0 and #P.field==0 then + P.modeData.event=P.modeData.event==0 and 1 or 0 + local r=rnd(#PClist) + local f=P.modeData.event==0 + for i=1,4 do + local b=PClist[r][i] + if f then + if b<3 then b=3-b + elseif b<5 then b=7-b + end + end + P.next[#P.next+1]={bk=blocks[b][0],id=b,color=b,name=b}--P:newNext(b)'s simple version! + end + P.modeData.counter=P.stat.piece==0 and 20 or 0 + newTask(task_PC,P) + end +end +return{ + name={ + "全清训练", + "全清训练", + "PC Train", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "简易PC题库,熟悉全清定式的组合", + "简易全清题库,熟悉全清定式的组合", + "Let's learn some PCs", + }, + color=color.green, + env={ + next=4, + hold=false, + drop=150,lock=150, + fall=20, + sequence="none", + dropPiece=newPC, + ospin=false, + bg="rgb",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + newPC(players[1]) + end, + mesDisp=function(P,dx,dy) + setFont(75) + mStr(P.stat.pc,-82,330) + mDraw(drawableText.pc,-82,412) + end, + score=function(P)return{P.stat.pc,P.stat.time}end, + scoreDisp=function(D)return D[1].." PCs "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=100 and 5 or + L>=60 and 4 or + L>=40 and 3 or + L>=25 and 2 or + L>=15 and 1 + end, +} \ No newline at end of file diff --git a/modes/round_1.lua b/modes/round_1.lua new file mode 100644 index 00000000..75f828c7 --- /dev/null +++ b/modes/round_1.lua @@ -0,0 +1,56 @@ +local function update_round(P) + if #players.alive>1 then + P.control=false + local ID=P.id + repeat + ID=ID+1 + if not players[ID]then ID=1 end + until players[ID].alive or ID==P.id + players[ID].control=true + end +end + +return{ + name={ + "回合制", + "回合制", + "Turn-Base", + }, + level={ + "简单", + "简单", + "EASY", + }, + info={ + "下棋模式", + "下棋模式", + "Chess?", + }, + color=color.cyan, + env={ + drop=60,lock=60, + oncehold=false, + dropPiece=update_round, + bg="game2",bgm="push", + }, + load=function() + newPlayer(1,340,15) + newPlayer(2,965,360,.5,AITemplate("9S",10)) + end, + mesDisp=function(P,dx,dy) + end, + score=function(P)return{P.stat.piece,P.stat.time}end, + scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, + comp=function(a,b)return a[1]1 then + P.control=false + local ID=P.id + repeat + ID=ID+1 + if not players[ID]then ID=1 end + until players[ID].alive or ID==P.id + players[ID].control=true + end +end + +return{ + name={ + "回合制", + "回合制", + "Turn-Base", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "下棋模式", + "下棋模式", + "Chess?", + }, + color=color.green, + env={ + drop=60,lock=60, + oncehold=false, + dropPiece=update_round, + bg="game2",bgm="push", + }, + load=function() + newPlayer(1,340,15) + newPlayer(2,965,360,.5,AITemplate("9S",10)) + end, + mesDisp=function(P,dx,dy) + end, + score=function(P)return{P.stat.piece,P.stat.time}end, + scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, + comp=function(a,b)return a[1]1 then + P.control=false + local ID=P.id + repeat + ID=ID+1 + if not players[ID]then ID=1 end + until players[ID].alive or ID==P.id + players[ID].control=true + end +end + +return{ + name={ + "回合制", + "回合制", + "Turn-Base", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "下棋模式", + "下棋模式", + "Chess?", + }, + color=color.magenta, + env={ + drop=60,lock=60, + oncehold=false, + dropPiece=update_round, + bg="game2",bgm="push", + }, + load=function() + newPlayer(1,340,15) + newPlayer(2,965,360,.5,AITemplate("9S",10)) + end, + mesDisp=function(P,dx,dy) + end, + score=function(P)return{P.stat.piece,P.stat.time}end, + scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, + comp=function(a,b)return a[1]1 then + P.control=false + local ID=P.id + repeat + ID=ID+1 + if not players[ID]then ID=1 end + until players[ID].alive or ID==P.id + players[ID].control=true + end +end + +return{ + name={ + "回合制", + "回合制", + "Turn-Base", + }, + level={ + "疯狂", + "疯狂", + "LUNATIC", + }, + info={ + "下棋模式", + "下棋模式", + "Chess?", + }, + color=color.red, + env={ + drop=60,lock=60, + oncehold=false, + dropPiece=update_round, + bg="game2",bgm="push", + }, + load=function() + newPlayer(1,340,15) + newPlayer(2,965,360,.5,AITemplate("9S",10)) + end, + mesDisp=function(P,dx,dy) + end, + score=function(P)return{P.stat.piece,P.stat.time}end, + scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, + comp=function(a,b)return a[1]1 then + P.control=false + local ID=P.id + repeat + ID=ID+1 + if not players[ID]then ID=1 end + until players[ID].alive or ID==P.id + players[ID].control=true + end +end + +return{ + name={ + "回合制", + "回合制", + "Turn-Base", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "下棋模式", + "下棋模式", + "Chess?", + }, + color=color.lightYellow, + env={ + drop=60,lock=60, + oncehold=false, + dropPiece=update_round, + bg="game2",bgm="push", + }, + load=function() + newPlayer(1,340,15) + newPlayer(2,965,360,.5,AITemplate("9S",10)) + end, + mesDisp=function(P,dx,dy) + end, + score=function(P)return{P.stat.piece,P.stat.time}end, + scoreDisp=function(D)return D[1].." Pieces "..toTime(D[2])end, + comp=function(a,b)return a[1]0 then + gc.setLineWidth(4) + gc.setColor(1,r>10 and 0 or rnd(),.5) + gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy) + end + end, + score=function(P)return{P.stat.time,P.stat.piece}end, + scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end, + comp=function(a,b)return a[1]0 then + gc.setLineWidth(4) + gc.setColor(1,r>10 and 0 or rnd(),.5) + gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy) + end + end, + score=function(P)return{P.stat.time,P.stat.piece}end, + scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end, + comp=function(a,b)return a[1]0 then + gc.setLineWidth(4) + gc.setColor(1,r>10 and 0 or rnd(),.5) + gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy) + end + end, + score=function(P)return{P.stat.time,P.stat.piece}end, + scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end, + comp=function(a,b)return a[1]0 then + gc.setLineWidth(4) + gc.setColor(1,r>10 and 0 or rnd(),.5) + gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy) + end + end, + score=function(P)return{P.stat.time,P.stat.piece}end, + scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end, + comp=function(a,b)return a[1]0 then + gc.setLineWidth(4) + gc.setColor(1,r>10 and 0 or rnd(),.5) + gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy) + end + end, + score=function(P)return{P.stat.time,P.stat.piece}end, + scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end, + comp=function(a,b)return a[1]0 then + gc.setLineWidth(4) + gc.setColor(1,r>10 and 0 or rnd(),.5) + gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy) + end + end, + score=function(P)return{P.stat.time,P.stat.piece}end, + scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end, + comp=function(a,b)return a[1]=max(60,150-2*P.modeData.event)and P.atkBuffer.sum<4 then + P.atkBuffer[#P.atkBuffer+1]={pos=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:showText(text.maxspeed,0,-140,100,"appear",.6)end + P.modeData.counter=0 + P.modeData.event=P.modeData.event+1 + end + end, + bg="glow",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(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 + W>=45 and 3 or + W>=30 and 2 or + W>=15 and 1 + end, +} \ No newline at end of file diff --git a/modes/survivor_hard.lua b/modes/survivor_hard.lua new file mode 100644 index 00000000..fe39d8cb --- /dev/null +++ b/modes/survivor_hard.lua @@ -0,0 +1,64 @@ +local max,rnd=math.max,math.random +return{ + name={ + "生存", + "生存", + "Survivor", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "你能存活多久?", + "你能存活多久?", + "Survive Longer!", + }, + color=color.magenta, + env={ + drop=30,lock=45, + freshLimit=10, + visible="time", + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter>=max(60,180-2*P.modeData.event)and P.atkBuffer.sum<15 then + P.atkBuffer[#P.atkBuffer+1]= + P.modeData.event%3<2 and + {pos=rnd(10),amount=1,countdown=0,cd0=0,time=0,sent=false,lv=1} + or + {pos=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) + P.atkBuffer.sum=P.atkBuffer.sum+R + P.stat.recv=P.stat.recv+R + if P.modeData.event==60 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end + P.modeData.counter=0 + P.modeData.event=P.modeData.event+1 + end + end, + bg="glow",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(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 + W>=45 and 3 or + W>=30 and 2 or + W>=15 and 1 + end, +} \ No newline at end of file diff --git a/modes/survivor_lunatic.lua b/modes/survivor_lunatic.lua new file mode 100644 index 00000000..0fba16a7 --- /dev/null +++ b/modes/survivor_lunatic.lua @@ -0,0 +1,60 @@ +local max,rnd=math.max,math.random +return{ + name={ + "生存", + "生存", + "Survivor", + }, + level={ + "疯狂", + "疯狂", + "LUNATIC", + }, + info={ + "你能存活多久?", + "你能存活多久?", + "Survive Longer!", + }, + color=color.red, + env={ + drop=30,lock=45, + freshLimit=10, + visible="time", + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter>=max(60,150-P.modeData.event)and P.atkBuffer.sum<20 then + local t=max(60,90-P.modeData.event) + P.atkBuffer[#P.atkBuffer+1]={pos=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:showText(text.maxspeed,0,-140,100,"appear",.6)end + P.modeData.counter=0 + P.modeData.event=P.modeData.event+1 + end + end, + bg="glow",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(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 + W>=55 and 3 or + W>=30 and 2 or + W>=15 and 1 + end, +} \ No newline at end of file diff --git a/modes/survivor_normal.lua b/modes/survivor_normal.lua new file mode 100644 index 00000000..2349ee08 --- /dev/null +++ b/modes/survivor_normal.lua @@ -0,0 +1,64 @@ +local max,rnd=math.max,math.random +return{ + name={ + "生存", + "生存", + "Survivor", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "你能存活多久?", + "你能存活多久?", + "Survive Longer!", + }, + color=color.green, + env={ + drop=30,lock=45, + freshLimit=10, + visible="time", + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter>=max(90,180-2*P.modeData.event)and P.atkBuffer.sum<8 then + local d=P.modeData.event+1 + P.atkBuffer[#P.atkBuffer+1]= + d%4==0 and{pos=rnd(10),amount=1,countdown=60,cd0=60,time=0,sent=false,lv=1}or + d%4==1 and{pos=rnd(10),amount=2,countdown=70,cd0=70,time=0,sent=false,lv=1}or + d%4==2 and{pos=rnd(10),amount=3,countdown=80,cd0=80,time=0,sent=false,lv=2}or + d%4==3 and{pos=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:showText(text.maxspeed,0,-140,100,"appear",.6)end + P.modeData.counter=0 + P.modeData.event=d + end + end, + bg="glow",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + mDraw(drawableText.line,-82,300) + mDraw(drawableText.techrash,-82,420) + setFont(75) + mStr(P.stat.row,-82,220) + mStr(P.stat.clear_4,-82,340) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(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 + W>=45 and 3 or + W>=30 and 2 or + W>=15 and 1 + end, +} \ No newline at end of file diff --git a/modes/survivor_ultimate.lua b/modes/survivor_ultimate.lua new file mode 100644 index 00000000..7f326cc5 --- /dev/null +++ b/modes/survivor_ultimate.lua @@ -0,0 +1,63 @@ +local max,rnd=math.max,math.random +return{ + name={ + "生存", + "生存", + "Survivor", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "你能存活多久?", + "你能存活多久?", + "Survive Longer!", + }, + color=color.lightYellow, + env={ + drop=5,lock=60, + fall=10, + freshLimit=15, + pushSpeed=2, + task=function(P) + if not P.control then return end + P.modeData.counter=P.modeData.counter+1 + if P.modeData.counter>=max(300,600-10*P.modeData.event)and P.atkBuffer.sum<20 then + local t=max(300,480-12*P.modeData.event) + local p=#P.atkBuffer+1 + P.atkBuffer[p] ={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=2} + P.atkBuffer[p+1]={pos=rnd(10),amount=4,countdown=t,cd0=t,time=0,sent=false,lv=3} + P.atkBuffer[p+2]={pos=rnd(10),amount=6,countdown=1.2*t,cd0=1.2*t,time=0,sent=false,lv=4} + P.atkBuffer[p+3]={pos=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 + P.modeData.counter=0 + if P.modeData.event==31 then P:showText(text.maxspeed,0,-140,100,"appear",.6)end + P.modeData.event=P.modeData.event+1 + end + end, + bg="rgb",bgm="secret7th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(65) + mStr(P.modeData.event,-82,310) + mDraw(drawableText.wave,-82,375) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return D[1].." Waves "..toTime(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 + W>=20 and 3 or + W>=10 and 2 or + W>=5 and 1 + end, +} \ No newline at end of file diff --git a/modes/tech_hard+.lua b/modes/tech_hard+.lua new file mode 100644 index 00000000..09b5c21f --- /dev/null +++ b/modes/tech_hard+.lua @@ -0,0 +1,53 @@ +local function tech_check_ultimate(P) + if #P.cleared>0 and P.lastClear<10 or P.lastClear==74 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "困难+", + "困难+", + "HARD+", + }, + info={ + "仅允许spin与PC", + "仅允许spin与全清", + "Spin&PC only", + }, + color=color.darkMagenta, + env={ + drop=30,lock=60, + freshLimit=15, + target=200, + dropPiece=tech_reach_ultimate, + bg="matrix",bgm="secret8th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 and P.b2b<40 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "禁止断B2B", + "禁止断满贯", + "Keep B2B", + }, + color=color.magenta, + env={ + drop=20,lock=60, + freshLimit=15, + target=200, + dropPiece=tech_reach_easy, + bg="matrix",bgm="secret8th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 and P.lastClear<10 or P.lastClear==74 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "疯狂+", + "疯狂+", + "LUNATIC+", + }, + info={ + "仅允许spin与PC", + "仅允许spin与全清", + "Spin&PC only", + }, + color=color.darkRed, + env={ + _20G=true,lock=60, + freshLimit=15, + target=200, + dropPiece=tech_reach_ultimate, + bg="matrix",bgm="secret7th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 and P.lastClear<10 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "疯狂", + "疯狂", + "LUNATIC", + }, + info={ + "禁止断B2B", + "禁止断满贯", + "Keep B2B", + }, + color=color.red, + env={ + _20G=true,lock=60, + freshLimit=15, + target=200, + dropPiece=tech_reach_hard, + bg="matrix",bgm="secret7th", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 and P.lastClear<10 or P.lastClear==74 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "普通+", + "普通+", + "NORMAL+", + }, + info={ + "仅允许spin与PC", + "仅允许spin与全清", + "Spin&PC only", + }, + color=color.darkGreen, + env={ + oncehold=false, + drop=1e99,lock=1e99, + target=200, + dropPiece=tech_reach_ultimate, + bg="matrix",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 and P.b2b<40 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "普通", + "普通", + "NORMAL", + }, + info={ + "禁止断B2B", + "禁止断B2B", + "Keep B2B", + }, + color=color.green, + env={ + oncehold=false, + drop=1e99,lock=1e99, + target=200, + dropPiece=tech_check_easy, + bg="matrix",bgm="newera", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 and P.lastClear<10 or P.lastClear==74 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "极限+", + "极限+", + "ULTIMATE+", + }, + info={ + "禁止普通消除,强制最简操作", + "禁止普通消除,强制最简操作", + "Don't do normal clear,no finesse error", + }, + color=color.grey, + env={ + drop=1e99,lock=60, + freshLimit=15, + target=200, + fineKill=true, + dropPiece=tech_reach_ultimate, + bg="flink",bgm="infinite", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 and P.lastClear<10 then + Event.lose(P) + end +end + +return{ + name={ + "科研", + "科研", + "Tech", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "仅允许spin与PC,强制最简操作", + "仅允许spin与全清,强制最简操作", + "Don't do normal clear,no finesse error", + }, + color=color.lightYellow, + env={ + drop=1e99,lock=60, + freshLimit=15, + target=200, + fineKill=true, + dropPiece=tech_reach_hard, + bg="flink",bgm="infinite", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(45) + mStr(P.stat.atk,-82,310) + mStr(format("%.2f",P.stat.atk/P.stat.row),-82,420) + mDraw(drawableText.atk,-82,363) + mDraw(drawableText.eff,-82,475) + end, + score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}end, + scoreDisp=function(D)return D[1].." Rows "..toTime(D[2])end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]0 do + local r=rnd(2,49) + if L[r]then L[r],t=false,t-1 end + end + local n=2 + for i=1,4 do for j=1,6 do + if L[n]then + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,6))) + else + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,6)-1,2,true,10000)) + end + n=n+1 + end end + for i=9,12 do for j=1,6 do + if L[n]then + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,6))) + else + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,6)-1,2,true,10000)) + end + n=n+1 + end end + end, + mesDisp=function(P,dx,dy) + setFont(35) + mStr(#players.alive.."/49",-82,175) + mStr(P.ko,-70,215) + gc.draw(drawableText.ko,-127,225) + setFont(20) + gc.setColor(1,.5,0,.6) + gc.print(P.badge,-47,227) + gc.setColor(1,1,1) + setFont(25) + gc.print(powerUp[P.strength],-132,290) + for i=1,P.strength do + gc.draw(badgeIcon,16*i-138,260) + end + end, + score=function(P)return{P.rank,P.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.rank + return + R==1 and 5 or + R<=3 and 4 or + R<=5 and 3 or + R<=10 and 2 or + R<=15 and 1 + end, +} \ No newline at end of file diff --git a/modes/techmino49_hard.lua b/modes/techmino49_hard.lua new file mode 100644 index 00000000..5185bbc2 --- /dev/null +++ b/modes/techmino49_hard.lua @@ -0,0 +1,101 @@ +local gc=love.graphics +local int,rnd=math.floor,math.random +local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} +local function selectTarget(P) + if setting.swap then + for i=1,#P.keyPressing do + if P.keyPressing[i]then + P.keyPressing[i]=false + end + end + P.keyPressing[9]=true + else + P:changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode) + P.swappingAtkMode=30 + end +end + +return{ + name={ + "49人混战", + "49人混战", + "Techmino49", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "49人混战,活到最后", + "49人混战,活到最后", + "49P melee fight", + }, + color=color.magenta, + env={ + drop=60,lock=60, + fall=20, + royaleMode=true, + Fkey=selectTarget, + pushSpeed=2, + freshLimit=15, + bg="game3",bgm="rockblock", + }, + load=function() + royaleData={ + powerUp={2,5,10,20}, + stage={30,20,15,10,5}, + } + newPlayer(1,340,15) + local L={}for i=1,49 do L[i]=true end + local t=system~="Windows"and 0 or 4 + while t>0 do + local r=rnd(2,49) + if L[r]then L[r],t=false,t-1 end + end + local n=2 + for i=1,4 do for j=1,6 do + if L[n]then + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,8))) + else + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,8)-1,3,true,20000)) + end + n=n+1 + end end + for i=9,12 do for j=1,6 do + if L[n]then + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,8))) + else + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,8)-1,3,true,20000)) + end + n=n+1 + end end + end, + mesDisp=function(P,dx,dy) + setFont(35) + mStr(#players.alive.."/49",-82,175) + mStr(P.ko,-70,215) + gc.draw(drawableText.ko,-127,225) + setFont(20) + gc.setColor(1,.5,0,.6) + gc.print(P.badge,-47,227) + gc.setColor(1,1,1) + setFont(25) + gc.print(powerUp[P.strength],-132,290) + for i=1,P.strength do + gc.draw(badgeIcon,16*i-138,260) + end + end, + score=function(P)return{P.rank,P.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.rank + return + R==1 and 5 or + R==2 and 4 or + R<=4 and 3 or + R<=6 and 2 or + R<=8 and 1 + end, +} \ No newline at end of file diff --git a/modes/techmino49_ultimate.lua b/modes/techmino49_ultimate.lua new file mode 100644 index 00000000..18afa6b2 --- /dev/null +++ b/modes/techmino49_ultimate.lua @@ -0,0 +1,101 @@ +local gc=love.graphics +local int,rnd=math.floor,math.random +local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} +local function selectTarget(P) + if setting.swap then + for i=1,#P.keyPressing do + if P.keyPressing[i]then + P.keyPressing[i]=false + end + end + P.keyPressing[9]=true + else + P:changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode) + P.swappingAtkMode=30 + end +end + +return{ + name={ + "49人混战", + "49人混战", + "Techmino49", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "49人混战,活到最后", + "49人混战,活到最后", + "49P melee fight", + }, + color=color.lightYellow, + env={ + drop=15,lock=60, + fall=20, + royaleMode=true, + Fkey=selectTarget, + pushSpeed=2, + freshLimit=15, + bg="game3",bgm="rockblock", + }, + load=function() + royaleData={ + powerUp={2,5,10,20}, + stage={30,20,15,10,5}, + } + newPlayer(1,340,15) + local L={}for i=1,49 do L[i]=true end + local t=system~="Windows"and 0 or 6 + while t>0 do + local r=rnd(2,49) + if L[r]then L[r],t=false,t-1 end + end + local n=2 + for i=1,4 do for j=1,6 do + if L[n]then + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(8,10))) + else + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(8,10)-1,4,true,30000)) + end + n=n+1 + end end + for i=9,12 do for j=1,6 do + if L[n]then + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(8,10))) + else + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(8,10)-1,4,true,30000)) + end + n=n+1 + end end + end, + mesDisp=function(P,dx,dy) + setFont(35) + mStr(#players.alive.."/49",-82,175) + mStr(P.ko,-70,215) + gc.draw(drawableText.ko,-127,225) + setFont(20) + gc.setColor(1,.5,0,.6) + gc.print(P.badge,-47,227) + gc.setColor(1,1,1) + setFont(25) + gc.print(powerUp[P.strength],-132,290) + for i=1,P.strength do + gc.draw(badgeIcon,16*i-138,260) + end + end, + score=function(P)return{P.rank,P.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.rank + return + R==1 and 5 or + R==2 and 4 or + R==3 and 3 or + R==4 and 2 or + R<=6 and 1 + end, +} \ No newline at end of file diff --git a/modes/techmino99_easy.lua b/modes/techmino99_easy.lua new file mode 100644 index 00000000..2cf0cacc --- /dev/null +++ b/modes/techmino99_easy.lua @@ -0,0 +1,101 @@ +local gc=love.graphics +local int,rnd=math.floor,math.random +local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} +local function selectTarget(P) + if setting.swap then + for i=1,#P.keyPressing do + if P.keyPressing[i]then + P.keyPressing[i]=false + end + end + P.keyPressing[9]=true + else + P:changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode) + P.swappingAtkMode=30 + end +end + +return{ + name={ + "99人混战", + "99人混战", + "Techmino99", + }, + level={ + "简单", + "简单", + "EASY", + }, + info={ + "99人混战,活到最后", + "99人混战,活到最后", + "99P melee fight", + }, + color=color.cyan, + env={ + drop=60,lock=60, + fall=20, + royaleMode=true, + Fkey=selectTarget, + pushSpeed=2, + freshLimit=15, + bg="game3",bgm="rockblock", + }, + load=function() + royaleData={ + powerUp={2,6,14,30}, + stage={75,50,35,20,10}, + } + newPlayer(1,340,15) + local L={}for i=1,100 do L[i]=true end + local t=system~="Windows"and 0 or 4 + while t>0 do + local r=rnd(2,99) + if L[r]then L[r],t=false,t-1 end + end + local n=2 + for i=1,7 do for j=1,7 do + if L[n]then + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,8))) + else + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,8)-1,2,true,10000)) + end + n=n+1 + end end + for i=15,21 do for j=1,7 do + if L[n]then + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,8))) + else + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,8)-1,2,true,10000)) + end + n=n+1 + end end + end, + mesDisp=function(P,dx,dy) + setFont(35) + mStr(#players.alive.."/99",-82,175) + mStr(P.ko,-70,215) + gc.draw(drawableText.ko,-127,225) + setFont(20) + gc.setColor(1,.5,0,.6) + gc.print(P.badge,-47,227) + gc.setColor(1,1,1) + setFont(25) + gc.print(powerUp[P.strength],-132,290) + for i=1,P.strength do + gc.draw(badgeIcon,16*i-138,260) + end + end, + score=function(P)return{P.rank,P.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.rank + return + R==1 and 5 or + R<=3 and 4 or + R<=6 and 3 or + R<=10 and 2 or + R<=20 and 1 + end, +} \ No newline at end of file diff --git a/modes/techmino99_hard.lua b/modes/techmino99_hard.lua new file mode 100644 index 00000000..60d26b97 --- /dev/null +++ b/modes/techmino99_hard.lua @@ -0,0 +1,101 @@ +local gc=love.graphics +local int,rnd=math.floor,math.random +local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} +local function selectTarget(P) + if setting.swap then + for i=1,#P.keyPressing do + if P.keyPressing[i]then + P.keyPressing[i]=false + end + end + P.keyPressing[9]=true + else + P:changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode) + P.swappingAtkMode=30 + end +end + +return{ + name={ + "99人混战", + "99人混战", + "Techmino99", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "99人混战,活到最后", + "99人混战,活到最后", + "99P melee fight", + }, + color=color.magenta, + env={ + drop=60,lock=60, + fall=20, + royaleMode=true, + Fkey=selectTarget, + pushSpeed=2, + freshLimit=15, + bg="game3",bgm="rockblock", + }, + load=function() + royaleData={ + powerUp={2,6,14,30}, + stage={75,50,35,20,10}, + } + newPlayer(1,340,15) + local L={}for i=1,100 do L[i]=true end + local t=system~="Windows"and 0 or 4 + while t>0 do + local r=rnd(2,99) + if L[r]then L[r],t=false,t-1 end + end + local n=2 + for i=1,7 do for j=1,7 do + if L[n]then + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,6))) + else + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,3,true,20000)) + end + n=n+1 + end end + for i=15,21 do for j=1,7 do + if L[n]then + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,6))) + else + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,3,true,20000)) + end + n=n+1 + end end + end, + mesDisp=function(P,dx,dy) + setFont(35) + mStr(#players.alive.."/99",-82,175) + mStr(P.ko,-70,215) + gc.draw(drawableText.ko,-127,225) + setFont(20) + gc.setColor(1,.5,0,.6) + gc.print(P.badge,-47,227) + gc.setColor(1,1,1) + setFont(25) + gc.print(powerUp[P.strength],-132,290) + for i=1,P.strength do + gc.draw(badgeIcon,16*i-138,260) + end + end, + score=function(P)return{P.rank,P.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.rank + return + R==1 and 5 or + R<=3 and 4 or + R<=6 and 3 or + R<=8 and 2 or + R<=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/techmino99_ultimate.lua b/modes/techmino99_ultimate.lua new file mode 100644 index 00000000..4e2a5c51 --- /dev/null +++ b/modes/techmino99_ultimate.lua @@ -0,0 +1,101 @@ +local gc=love.graphics +local int,rnd=math.floor,math.random +local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} +local function selectTarget(P) + if setting.swap then + for i=1,#P.keyPressing do + if P.keyPressing[i]then + P.keyPressing[i]=false + end + end + P.keyPressing[9]=true + else + P:changeAtkMode(P.atkMode<3 and P.atkMode+2 or 5-P.atkMode) + P.swappingAtkMode=30 + end +end + +return{ + name={ + "99人混战", + "99人混战", + "Techmino99", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "99人混战,活到最后", + "99人混战,活到最后", + "99P melee fight", + }, + color=color.lightYellow, + env={ + drop=15,lock=60, + fall=20, + royaleMode=true, + Fkey=selectTarget, + pushSpeed=2, + freshLimit=15, + bg="game3",bgm="rockblock", + }, + load=function() + royaleData={ + powerUp={2,6,14,30}, + stage={75,50,35,20,10}, + } + newPlayer(1,340,15) + local L={}for i=1,100 do L[i]=true end + local t=system~="Windows"and 0 or 4 + while t>0 do + local r=rnd(2,99) + if L[r]then L[r],t=false,t-1 end + end + local n=2 + for i=1,7 do for j=1,7 do + if L[n]then + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,6))) + else + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,LV+1,true,LV*10000)) + end + n=n+1 + end end + for i=15,21 do for j=1,7 do + if L[n]then + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,6))) + else + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,LV+1,true,LV*10000)) + end + n=n+1 + end end + end, + mesDisp=function(P,dx,dy) + setFont(35) + mStr(#players.alive.."/99",-82,175) + mStr(P.ko,-70,215) + gc.draw(drawableText.ko,-127,225) + setFont(20) + gc.setColor(1,.5,0,.6) + gc.print(P.badge,-47,227) + gc.setColor(1,1,1) + setFont(25) + gc.print(powerUp[P.strength],-132,290) + for i=1,P.strength do + gc.draw(badgeIcon,16*i-138,260) + end + end, + score=function(P)return{P.rank,P.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.rank + return + R==1 and 5 or + R==2 and 4 or + R==3 and 3 or + R<=5 and 2 or + R<=7 and 1 + end, +} \ No newline at end of file diff --git a/modes/tsd_easy.lua b/modes/tsd_easy.lua new file mode 100644 index 00000000..82ca7462 --- /dev/null +++ b/modes/tsd_easy.lua @@ -0,0 +1,55 @@ +local function check_tsd(P) + if #P.cleared>0 then + if P.lastClear~=52 then + Event.lose(P) + elseif #P.cleared>0 then + P.modeData.event=P.modeData.event+1 + end + end +end + +return{ + name={ + "TSD挑战", + "T旋双清挑战", + "TSD Challenge", + }, + level={ + "简单", + "简单", + "EASY", + }, + info={ + "你能连续做几个TSD?", + "你能连续做几个T旋双清?", + "T-spin-doubles only", + }, + color=color.green, + env={ + drop=1e99,lock=1e99, + oncehold=false, + dropPiece=check_tsd, + ospin=false, + bg="matrix",bgm="reason", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(75) + mStr(P.modeData.event,-82,330) + mDraw(drawableText.tsd,-82,407) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return"NO."..D[1]" KO:"..D[2]end, + comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]=23 and 5 or + T>=20 and 4 or + T>=15 and 3 or + T>=10 and 2 or + T>=6 and 1 + end, +} \ No newline at end of file diff --git a/modes/tsd_hard.lua b/modes/tsd_hard.lua new file mode 100644 index 00000000..b5290db6 --- /dev/null +++ b/modes/tsd_hard.lua @@ -0,0 +1,55 @@ +local function check_tsd(P) + if #P.cleared>0 then + if P.lastClear~=52 then + Event.lose(P) + elseif #P.cleared>0 then + P.modeData.event=P.modeData.event+1 + end + end +end + +return{ + name={ + "TSD挑战", + "T旋双清挑战", + "TSD Challenge", + }, + level={ + "困难", + "困难", + "HARD", + }, + info={ + "你能连续做几个TSD?", + "你能连续做几个T旋双清?", + "T-spin-doubles only", + }, + color=color.magenta, + env={ + drop=60,lock=60, + freshLimit=15, + dropPiece=check_tsd, + ospin=false, + bg="matrix",bgm="reason", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(75) + mStr(P.modeData.event,-82,330) + mDraw(drawableText.tsd,-82,407) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return"NO."..D[1]" KO:"..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 + T>=16 and 3 or + T>=13 and 2 or + T>=10 and 1 + end, +} \ No newline at end of file diff --git a/modes/tsd_ultimate.lua b/modes/tsd_ultimate.lua new file mode 100644 index 00000000..3f01d54a --- /dev/null +++ b/modes/tsd_ultimate.lua @@ -0,0 +1,55 @@ +local function check_tsd(P) + if #P.cleared>0 then + if P.lastClear~=52 then + Event.lose(P) + elseif #P.cleared>0 then + P.modeData.event=P.modeData.event+1 + end + end +end + +return{ + name={ + "TSD挑战", + "T旋双清挑战", + "TSD Challenge", + }, + level={ + "极限", + "极限", + "ULTIMATE", + }, + info={ + "你能连续做几个TSD?", + "你能连续做几个T旋双清?", + "T-spin-doubles only", + }, + color=color.lightYellow, + env={ + drop=60,lock=60, + freshLimit=15, + dropPiece=check_tsd, + ospin=false, + bg="matrix",bgm="reason", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(75) + mStr(P.modeData.event,-82,330) + mDraw(drawableText.tsd,-82,407) + end, + score=function(P)return{P.modeData.event,P.stat.time}end, + scoreDisp=function(D)return"NO."..D[1]" KO:"..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 + T>=16 and 3 or + T>=14 and 2 or + T>=12 and 1 + end, +} \ No newline at end of file diff --git a/modes/ultra.lua b/modes/ultra.lua new file mode 100644 index 00000000..cb423f11 --- /dev/null +++ b/modes/ultra.lua @@ -0,0 +1,42 @@ +return{ + name={ + "限时打分", + "限时打分", + "Ultra", + }, + level={ + "挑战", + "挑战", + "EXTRA", + }, + info={ + "在两分钟内尽可能拿到最多的分数", + "在两分钟内尽可能拿到最多的分数", + "Score attack in 120s", + }, + color=color.grey, + env={ + drop=1e99,lock=1e99, + task=function(P) + if P.stat.time>=120 then + Event.win(P,"finish") + end + end, + bg="matrix",bgm="infinite", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + gc.circle("line",-30,100,40) + gc.setColor(1,0,0) + gc.arc("fill",-40,100,50,0,1) + end, + score=function(P)return{P.score}end, + scoreDisp=function(D)return D[1]end, + comp=function(a,b)return a[1]>b[1]end, + getRank=function(P) + local T=P.stat.score + return 1 + end, +} \ No newline at end of file diff --git a/modes/zen.lua b/modes/zen.lua new file mode 100644 index 00000000..45b80589 --- /dev/null +++ b/modes/zen.lua @@ -0,0 +1,44 @@ +return{ + name={ + "禅", + "禅", + "Zen", + }, + level={ + "时间杀手 I", + "时间杀手 I", + "Time Killer I", + }, + info={ + "不限时200行", + "不限时200行", + "200 lines without any limits", + }, + color=color.lightGrey, + env={ + drop=1e99,lock=1e99, + oncehold=false,target=200, + dropPiece=Event.reach_winCheck, + bg="strap",bgm="infinite", + }, + load=function() + newPlayer(1,340,15) + end, + mesDisp=function(P,dx,dy) + setFont(70) + local R=200-P.stat.row + mStr(R>=0 and R or 0,-82,280) + end, + score=function(P)return{P.stat.score}end, + scoreDisp=function(D)return D[1]end, + comp=function(a,b)return a[1]>b[1]end, + getRank=function(P) + local T=P.stat.score + return + T>=1e5 and 5 or + T>=8e4 and 4 or + T>=5e4 and 3 or + T>=2e4 and 2 or + T>=1e4 and 1 + end, +} \ No newline at end of file diff --git a/paint.lua b/paint.lua index 5fc4d0fd..e2916af2 100644 --- a/paint.lua +++ b/paint.lua @@ -5,82 +5,15 @@ local format=string.format local Timer=love.timer.getTime local scr=scr -local modeLevelColor={ - EASY=color.cyan, - NORMAL=color.green, - HARD=color.magenta, - LUNATIC=color.red, - EXTRA=color.lightMagenta, - ULTIMATE=color.lightYellow, - FINAL=color.lightGrey, - ["EASY+"]=color.darkCyan, - ["NORMAL+"]=color.darkGreen, - ["HARD+"]=color.darkMagenta, - ["LUNATIC+"]=color.darkRed, - ["ULTIMATE+"]=color.grey, - - MESS=color.lightGrey, - GM=color.blue, - DEATH=color.lightRed, - CTWC=color.lightBlue, - ["10L"]=color.cyan, - ["20L"]=color.lightBlue, - ["40L"]=color.green, - ["100L"]=color.orange, - ["400L"]=color.red, - ["1000L"]=color.lightGrey, +local modeRankColor={ + [0]=color.darkGrey, --Not pass + color.bronze, --Rank1 + color.lightGrey, --Rank2 + color.lightYellow, --Rank3 + color.lightMagenta, --Rank4 + color.lightCyan, --Rank5 + color.purple, --Special } -local dataOptL={"key","rotate","hold",nil,nil,nil,"send","recv","pend"} -local function dataOpt(i) - local stat=players[1].stat - if i==4 then - return stat.piece.." "..(int(stat.piece/stat.time*100)*.01).."PPS" - elseif i==5 then - return stat.row.." "..(int(stat.row/stat.time*600)*.1).."LPM" - elseif i==6 then - return stat.atk.." "..(int(stat.atk/stat.time*600)*.1).."APM" - elseif i<10 then - return stat[dataOptL[i]] - elseif i==10 then - return stat.clear_1.."/"..stat.clear_2.."/"..stat.clear_3.."/"..stat.clear_4 - elseif i==11 then - return "["..stat.spin_0.."]/"..stat.spin_1.."/"..stat.spin_2.."/"..stat.spin_3 - elseif i==12 then - return stat.b2b.."[+"..stat.b3b.."]" - elseif i==13 then - return stat.pc - elseif i==14 then - return format("%0.2f",stat.atk/stat.row) - elseif i==15 then - return stat.extraPiece - elseif i==16 then - return max(100-int(stat.extraRate/stat.piece*10000)*.01,0).."%" - end -end -local statOptL={ - "run","game",nil, - "key","rotate","hold","piece","row", - "atk","send","recv","pend", -} -local function statOpt(i) - if i<13 and i~=3 then - return stat[statOptL[i]] - elseif i==3 then - return format("%0.1fHr",stat.time*2.78e-4) - elseif i==13 then - return stat.clear_1.."/"..stat.clear_2.."/"..stat.clear_3.."/"..stat.clear_4 - elseif i==14 then - return "["..stat.spin_0.."]/"..stat.spin_1.."/"..stat.spin_2.."/"..stat.spin_3 - elseif i==15 then - return stat.b2b.."[+"..stat.b3b.."]" - elseif i==16 then - return stat.pc - elseif i==17 then - return format("%0.2f",stat.atk/stat.row) - elseif i==18 then - return stat.extraPiece.."["..(int(stat.extraRate/stat.piece*10000)*.01).."%]" - end -end local miniTitle_rect={ {2,0,5,1},{4,1,1,6}, {9,0,4,1},{9,3,4,1},{9,6,4,1},{8,0,1,7}, @@ -98,7 +31,8 @@ local function stencil_miniTitle() end end -FX_BGblock={tm=150,next=7,ct=0,list={{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},}}--Falling tetrominos on background +FX_BGblock={tm=150,next=7,ct=0,list={}}--Falling tetrominos on background +for _=1,16 do FX_BGblock.list[_]={v=0}end FX_attack={}--Attack beam FX_badge={}--Badge thrown sysFX={} @@ -265,33 +199,82 @@ function Pnt.main() setFont(30) gc.print(gameVersion,70,125) gc.print(system,610,100) - gc.print(modes[modeID[modeSel]].level[levelSel],600,373) - setFont(25) - gc.print(text.modeName[modeSel],600,414) players[1]:draw() end function Pnt.mode() - gc.setColor(1,1,1) - gc.draw(titleImage,830,30) - setFont(35) - local lv=modes[modeID[modeSel]].level[levelSel] - gc.setColor(modeLevelColor[lv]or color.white) - mStr(lv,270,200) - setFont(25) - gc.setColor(color.white) - mStr(text.modeInfo[modeID[modeSel]],270,240) - - setFont(75) - gc.setColor(color.grey) - mStr(text.modeName[modeSel],643,273) - for i=modeSel-2,modeSel+2 do - if i>=1 and i<=#modeID then - local f=75-abs(i-modeSel)*20 - gc.setColor(i==modeSel and color.white or abs(i-modeSel)==1 and color.grey or color.darkGrey) - setFont(f) - mStr(text.modeName[i],640,310+70*(i-modeSel)-f*.5) + local cam=mapCam + gc.push("transform") + gc.translate(640,360) + gc.scale(cam.zoomK) + gc.translate(-cam.x1,-cam.y1) + gc.scale(cam.k1) + local MM,R=modes,modeRanks + for _=1,#MM do + local M=MM[_] + if R[_]then + gc.setLineWidth(8) + gc.setColor(1,1,1,.15) + for _=1,#M.unlock do + local m=M.unlock[_] + if R[m]then + m=MM[m] + gc.line(M.x,M.y,m.x,m.y) + end + end + + local S=M.size + local d=((M.x-(cam.x1-180)/cam.k1)^2+(M.y-cam.y1/cam.k1)^2)^.5 + if d<600 then S=S*(1.3-d*0.0005) end + gc.setColor(modeRankColor[modeRanks[M.id]]) + if M.shape==1 then--Rectangle + gc.rectangle("fill",M.x-S,M.y-S,2*S,2*S) + if cam.sel==_ then + gc.setColor(1,1,1) + gc.setLineWidth(10) + gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10) + end + elseif M.shape==2 then--Octagon + gc.circle("fill",M.x,M.y,S,8) + if cam.sel==_ then + gc.setColor(1,1,1) + gc.setLineWidth(10) + gc.circle("line",M.x,M.y,S-5,8) + end + end end end + gc.pop() + if cam.sel then + local M=MM[cam.sel] + local lang=setting.lang + gc.setColor(.6,.6,.6,.5) + gc.rectangle("fill",920,0,360,720)--Info board + gc.setColor(M.color) + setFont(40) + mStr(M.name[lang],1030,5) + setFont(30) + mStr(M.level[lang],1030,50) + gc.setColor(1,1,1) + setFont(30) + gc.printf(M.info[lang],1100-180,130,360,"center") + local L=M.records + if L[1]then + mDraw(drawableText.highScore,1100,240) + gc.setColor(.3,.3,.3,.8) + gc.rectangle("fill",940,290,320,280)--Highscore board + gc.setColor(1,1,1) + setFont(23) + for i=1,#L do + gc.print(M.scoreDisp(L[i]),955,275+25*i) + end + elseif M.score then + mDraw(drawableText.noScore,1100,370) + end + end + if cam.keyCtrl then + gc.setColor(1,1,1) + gc.draw(mapCross,460-20,360-20) + end end function Pnt.music() gc.setColor(1,1,1,.3+sin(Timer()*5)*.2) @@ -350,7 +333,7 @@ function Pnt.draw() local B=preField[y][x] if B>0 then gc.draw(blockSkin[B],30*x-30,600-30*y) - elseif B==-1 then + elseif B==-1 and not sceneTemp.demo then gc.draw(cross,30*x-30,600-30*y) end end end @@ -449,11 +432,11 @@ function Pnt.pause() end for i=1,8 do gc.print(text.stat[i+3],110,30*i+270) - gc.print(dataOpt(i),305,30*i+270) + gc.print(sceneTemp[i],305,30*i+270) end for i=9,16 do gc.print(text.stat[i+3],860,30*i+30) - gc.print(dataOpt(i),1050,30*i+30) + gc.print(sceneTemp[i],1050,30*i+30) end setFont(35) if system~="Android"then @@ -485,12 +468,12 @@ function Pnt.setting_sound() local _=sceneTemp.jump local x,y=800,340+10*sin(t*.5)+(_-10)*_*.3 gc.translate(x,y) - gc.draw(miya_ch,0,0) + gc.draw(miya.ch,0,0) gc.setColor(1,1,1,.7) - gc.draw(miya_f1,4,47+4*sin(t*.9)) - gc.draw(miya_f2,42,107+5*sin(t)) - gc.draw(miya_f3,93,126+3*sin(t*.7)) - gc.draw(miya_f4,129,98+3*sin(t*.7)) + gc.draw(miya.f1,4,47+4*sin(t*.9)) + gc.draw(miya.f2,42,107+5*sin(t)) + gc.draw(miya.f3,93,126+3*sin(t*.7)) + gc.draw(miya.f4,129,98+3*sin(t*.7)) gc.translate(-x,-y) end function Pnt.setting_key() @@ -592,7 +575,7 @@ function Pnt.stat() gc.setColor(1,1,1) for i=1,18 do gc.print(text.stat[i],400,30*i-5) - gc.print(statOpt(i),720,30*i-5) + gc.print(sceneTemp[i],720,30*i-5) end gc.draw(titleImage,260,600,.2+.07*sin(Timer()*3),nil,nil,206,35) end @@ -603,8 +586,9 @@ function Pnt.history() gc.setLineWidth(4) gc.rectangle("line",30,45,1000,632) setFont(20) - for i=0,min(22,#updateLog-sceneTemp)do - gc.print(updateLog[sceneTemp+i],40,50+27*(i)) + local _=sceneTemp + for i=0,min(22,#_[1]-_[2])do + gc.print(_[1][_[2]+i],40,50+27*(i)) end end return Pnt \ No newline at end of file diff --git a/parts/PCbase.lua b/parts/PCbase.lua new file mode 100644 index 00000000..8885e881 --- /dev/null +++ b/parts/PCbase.lua @@ -0,0 +1,10 @@ +return{ + {3,3,3,0,0,0,0,0,2,2}, + {3,6,6,0,0,0,0,2,2,5}, + {4,6,6,0,0,0,1,1,5,5}, + {4,4,4,0,0,0,0,1,1,5}, + {1,1,0,0,0,0,0,4,4,4}, + {5,1,1,0,0,0,0,6,6,4}, + {5,5,2,2,0,0,0,6,6,3}, + {5,2,2,0,0,0,0,3,3,3}, +} \ No newline at end of file diff --git a/parts/PClist.lua b/parts/PClist.lua new file mode 100644 index 00000000..af2a7e4f --- /dev/null +++ b/parts/PClist.lua @@ -0,0 +1,11 @@ +return{ + {7,7,4,5},{7,7,6,4},{7,7,2,4},{7,7,1,3},{7,7,5,6},{7,7,5,2},{7,7,5,4},{7,7,5,3}, + {7,4,1,2},{7,3,5,7},{7,5,4,3},{7,5,1,2},{7,1,4,2},{7,4,2,5},{7,6,4,5},{7,5,4,2}, + {7,5,6,4},{7,5,3,6},{7,2,5,6},{7,2,6,4},{7,2,1,3},{7,5,2,7},{7,5,7,2},{7,5,2,3}, + {7,5,3,2},{7,6,5,4},{7,3,1,5},{7,3,2,5},{7,4,1,5},{7,4,5,2},{7,7,3,6},{7,3,7,6}, + {7,3,6,2},{7,3,7,1},{7,6,4,2},{3,2,7,6},{3,2,6,7},{7,7,4,5},{7,5,3,4},{7,3,6,5}, + {7,3,2,5},{7,4,6,5},{7,5,2,3},{7,3,5,7},{7,3,2,5},{7,3,5,1},{7,5,2,3},{3,6,2,5}, + {3,1,2,5},{3,1,1,5},{3,1,5,2},{3,1,5,1},{3,5,1,2},{4,5,3,2},{4,2,6,5},{6,5,3,2}, + {1,4,2,5},{1,5,3,6},{5,2,6,3},{5,2,1,3},{5,2,7,4},{2,4,1,5},{2,4,5,1},{2,1,4,5}, + {2,5,4,3},{2,5,6,7},{7,5,4,2},{4,5,3,5}, +} \ No newline at end of file diff --git a/parts/font.lua b/parts/font.lua new file mode 100644 index 00000000..5bfb60cb --- /dev/null +++ b/parts/font.lua @@ -0,0 +1,17 @@ +local new=love.graphics.setNewFont +local set=love.graphics.setFont +local F,cur={} +return function(s) + local f=F[s] + if s~=cur then + if f then + set(f) + else + f=new("font.ttf",s) + F[s]=f + set(f) + end + cur=s + end + return f +end \ No newline at end of file diff --git a/light.lua b/parts/light.lua similarity index 89% rename from light.lua rename to parts/light.lua index 87793e07..700dddba 100644 --- a/light.lua +++ b/parts/light.lua @@ -3,8 +3,8 @@ --https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows local gc=love.graphics local C=gc.clear -local shadowMapShader=gc.newShader("shadowMapShader.cs")--Shader for caculating the 1D shadow map. -local lightRenderShader=gc.newShader("lightRenderShader.cs")--Shader for rendering blurred lights and shadows. +local shadowMapShader=gc.newShader("parts/shader/shadowMap.cs")--Shader for caculating the 1D shadow map. +local lightRenderShader=gc.newShader("parts/shader/lightRender.cs")--Shader for rendering blurred lights and shadows. Lights={}--Lightsource objects local Lights=Lights --Private-- diff --git a/parts/mino.lua b/parts/mino.lua new file mode 100644 index 00000000..bae4f921 --- /dev/null +++ b/parts/mino.lua @@ -0,0 +1,37 @@ +local O,_=true,false +local L={ + {{_,O,O},{O,O,_}}, --Z + {{O,O,_},{_,O,O}}, --S + {{O,O,O},{_,_,O}}, --L + {{O,O,O},{O,_,_}}, --J + {{O,O,O},{_,O,_}}, --T + {{O,O},{O,O}}, --O + {{O,O,O,O}}, --I +} +local function RotCW(B) + local N={} + local r,c=#B,#B[1]--row,col + for x=1,c do + N[x]={} + for y=1,r do + N[x][y]=B[y][c-x+1] + end + end + return N +end + +-- [1,1,1] +-- [0,0,1]--r=2,c=3 +-- ↓ (Y inv) +-- [1,1] +-- [1,0] +-- [1,0] + +for i=1,#L do + local B=L[i] + L[i]={[0]=B} + B=RotCW(B)L[i][1]=B + B=RotCW(B)L[i][2]=B + B=RotCW(B)L[i][3]=B +end +return L \ No newline at end of file diff --git a/parts/shader.lua b/parts/shader.lua new file mode 100644 index 00000000..de99f13b --- /dev/null +++ b/parts/shader.lua @@ -0,0 +1,2 @@ +gc=love.graphics +shader_glow=gc.newShader("parts/shader/glow.cs") \ No newline at end of file diff --git a/shader/glow.cs b/parts/shader/glow.cs similarity index 100% rename from shader/glow.cs rename to parts/shader/glow.cs diff --git a/lightRenderShader.cs b/parts/shader/lightRender.cs similarity index 95% rename from lightRenderShader.cs rename to parts/shader/lightRender.cs index a1b24c4f..5f0d9491 100644 --- a/lightRenderShader.cs +++ b/parts/shader/lightRender.cs @@ -10,7 +10,7 @@ vec4 effect(vec4 color,Image texture,vec2 texture_coords,vec2 screen_coords){ float r=length(norm); vec2 tc=vec2((atan(norm.y,norm.x)+PI)/(2.*PI),0.); //根据离光源距离放大模糊系数,模拟影子淡出 - float blur=(1./xresolution)*smoothstep(0.,1.,r); + float blur=(1./xresolution)*smoothstep(0.,1.,r); //简易高斯模糊 float sum= diff --git a/shadowMapShader.cs b/parts/shader/shadowMap.cs similarity index 94% rename from shadowMapShader.cs rename to parts/shader/shadowMap.cs index 2214c7d0..1dca3529 100644 --- a/shadowMapShader.cs +++ b/parts/shader/shadowMap.cs @@ -5,7 +5,7 @@ vec4 effect(vec4 color,Image texture,vec2 texture_coords,vec2 screen_coords){ for(float y=0.;y------------------------- -local int,ceil,abs,rnd,max,min=math.floor,math.ceil,math.abs,math.random,math.max,math.min -local ins,rem=table.insert,table.remove local gc=love.graphics local Timer=love.timer.getTime +local int,ceil,abs,rnd,max,min=math.floor,math.ceil,math.abs,math.random,math.max,math.min +local ins,rem=table.insert,table.remove local format=string.format local scr=scr--screen camera -------------------------------------------------- @@ -20,12 +20,13 @@ local gameEnv0={ next=6,hold=true,oncehold=true, sequence="bag7", + pushSpeed=3, block=true, visible="show",--keepVisible=visile~="show" Fkey=NULL,puzzle=false,ospin=true, freshLimit=1e99,easyFresh=true, fine=false,fineKill=false, - target=1e99,dropPiece="null", + target=1e99,dropPiece=NULL, bg="none",bgm="race" } local renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else @@ -260,486 +261,7 @@ local function drawDial(x,y,speed) gc.setColor(1,1,1,.6) gc.draw(dialNeedle,x,y,2.094+(speed<=175 and .02094*speed or 4.712-52.36/(speed-125)),nil,nil,5,4) end ---------------Used in draw player↑ - -player={}local player=player -function newDemoPlayer(id,x,y,size) - local P={id=id}players[id]=P - P.invincible=true - for k,v in next,player do P[k]=v end - players.alive[#players.alive+1]=P - P.x,P.y,P.size=x,y,size - P.fieldOff={x=0,y=0,vx=0,vy=0} - P.small,P.keyRec=false,false - P.draw=P.draw_demo - - P.centerX,P.centerY=P.x+300*P.size,P.y+600*P.size - P.absFieldX=P.x+150*P.size - P.absFieldY=P.y+60*P.size - - P.alive=true - P.control=true - P.timing=false - P.stat={ - time=0,score=0, - key=0,extraPiece=0,extraRate=0, - rotate=0,hold=0,piece=0,row=0, - atk=0,send=0,recv=0,pend=0, - clear_1=0,clear_2=0,clear_3=0,clear_4=0, - spin_0=0,spin_1=0,spin_2=0,spin_3=0, - pc=0,b2b=0,b3b=0, - } - P.modeData={point=0,event=0} - P.keyTime={}for i=1,10 do P.keyTime[i]=-1e5 end P.keySpeed=0 - P.dropTime={}for i=1,10 do P.dropTime[i]=-1e5 end P.dropSpeed=0 - - P.atker={} - P.strength=0 - - P.field,P.visTime={},{} - P.atkBuffer={sum=0} - P.gameEnv={ - das=5,arr=2, - sddas=2,sdarr=2, - _20G=false,bone=false, - drop=1e99,lock=1e99, - wait=10,fall=20, - next=6,hold=true,oncehold=true, - sequence="bag7", - - block=true, - visible="show", - Fkey=NULL,puzzle=false,ospin=true, - freshLimit=1e99,easyFresh=true, - target=1e99,dropPiece="null", - } - P.cur={bk={{}},id=0,color=0,name=0} - P.sc,P.dir,P.r,P.c={0,0},0,0,0 - P.curX,P.curY,P.y_img=0,0,0 - P.hd={bk={{}},id=0,color=0,name=0} - P.holded=false - P.next={} - - P.dropDelay,P.lockDelay=1e99,1e99 - P.freshTime=0 - P.spinLast,P.lastClear=false,nil - P.spinSeq=0 - P.ctrlCount=0 - - local bag1={1,2,3,4,5,6,7} - for _=1,7 do - P:newNext(rem(bag1,rnd(#bag1))) - end - P.freshNext=freshMethod.bag7 - if P.gameEnv.sequence==1 then P.bag={}--Bag7 - elseif P.gameEnv.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end--History4 - elseif P.gameEnv.sequence==3 then--Pure random - end - - P.human=false - P.AI_mode="CC" - P.AI_stage=1 - P.AI_needFresh=false - P.AI_keys={} - P.AI_delay,P.AI_delay0=3,3 - P.AIdata={next=5,hold=true,_20G=false,bag7=true,node=80000} - if not BOT then P.AI_mode="9S"end - if P.AI_mode=="CC"then - P.RS=AIRS - local opt,wei=BOT.getConf() - BOT.setHold(opt,P.AIdata.hold) - BOT.set20G(opt,P.AIdata._20G) - BOT.setBag(opt,P.AIdata.bag7) - BOT.setNode(opt,P.AIdata.node) - P.AI_bot=BOT.new(opt,wei) - BOT.free(opt)BOT.free(wei) - local CCBID={4,3,5,6,1,2,0} - for i=1,5 do - BOT.addNext(P.AI_bot,CCBID[P.next[i].id]) - end - elseif P.AI_mode=="9S"then - P.RS=TRS - end - P.showTime=1e99 - P.keepVisible=true - P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end - P.moving,P.downing=0,0 - P.waiting,P.falling=-1,-1 - P.clearing,P.cleared={},{} - P.combo,P.b2b=0,0 - P.fieldBeneath=0 - P.shade={} - P.score1,P.b2b1=0,0 - P.bonus={}--texts - - P:resetblock() - PTC.dust[1]=PTC.dust0:clone() -end -function newPlayer(id,x,y,size,AIdata) - players[id]={id=id} - local P=players[id] - for k,v in next,player do P[k]=v end--Class function - players.alive[#players.alive+1]=P - P.x,P.y,P.size=x,y,size or 1 - P.fieldOff={x=0,y=0,vx=0,vy=0}--for shake FX - P.small=P.size<.1--if draw in small mode - P.keyRec=not P.small--if calculate keySpeed - if P.small then - P.centerX,P.centerY=P.x+300*P.size,P.y+600*P.size - P.canvas=love.graphics.newCanvas(60,120) - P.frameWait=rnd(30,120) - P.draw=P.draw_small - else - P.centerX,P.centerY=P.x+300*P.size,P.y+370*P.size - P.absFieldX=P.x+150*P.size - P.absFieldY=P.y+60*P.size - P.draw=P.draw_norm - end - - P.alive=true - P.control=false - P.timing=false - P.stat={ - time=0,score=0, - key=0,extraPiece=0,extraRate=0, - rotate=0,hold=0,piece=0,row=0, - atk=0,send=0,recv=0,pend=0, - clear_1=0,clear_2=0,clear_3=0,clear_4=0, - spin_0=0,spin_1=0,spin_2=0,spin_3=0, - pc=0,b2b=0,b3b=0, - }--Current gamestat - P.modeData={point=0,event=0}--data use by mode - P.keyTime={}for i=1,10 do P.keyTime[i]=-1e5 end P.keySpeed=0 - P.dropTime={}for i=1,10 do P.dropTime[i]=-1e5 end P.dropSpeed=0 - - P.field,P.visTime={},{} - P.atkBuffer={sum=0} - - P.ko,P.badge,P.strength=0,0,0 - P.atkMode,P.swappingAtkMode=1,20 - P.atker,P.atking,P.lastRecv={} - --Royale-related - - P.gameEnv={}--Current game setting environment - for k,v in next,gameEnv0 do - if modeEnv[k]~=nil then - P.gameEnv[k]=modeEnv[k] - elseif setting[k]~=nil then - P.gameEnv[k]=setting[k] - else - P.gameEnv[k]=v - end - end--reset current game settings - P.cur={bk={{}},id=0,color=0,name=0} - P.sc,P.dir,P.r,P.c={0,0},0,0,0 - P.curX,P.curY,P.y_img=0,0,0 - P.hd={bk={{}},id=0,color=0,name=0} - P.holded=false - P.next={} - - P.dropDelay,P.lockDelay=P.gameEnv.drop,P.gameEnv.lock - P.freshTime=0 - P.spinLast,P.lastClear=false,nil - P.spinSeq=0--for Ospin,each digit mean a spin - P.ctrlCount=0--key press time,for finesse check - - P.his={rnd(7),rnd(7),rnd(7),rnd(7)} - local s=P.gameEnv.sequence - if s=="bag7"or s=="his4"then - local bag1={1,2,3,4,5,6,7} - for _=1,7 do - P:newNext(rem(bag1,rnd(#bag1))) - end - elseif s=="rnd"then - for _=1,6 do - local r=rnd(7) - P:newNext(r) - end - elseif s=="drought1"then - local bag1={1,2,3,4,5,6} - for _=1,6 do - P:newNext(rem(bag1,rnd(#bag1))) - end - elseif s=="drought2"then - local bag1={1,2,3,4,6,6} - for _=1,6 do - P:newNext(rem(bag1,rnd(#bag1))) - end - end - - P.freshNext=freshMethod[P.gameEnv.sequence] - if P.gameEnv.sequence==1 then P.bag={}--Bag7 - elseif P.gameEnv.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end--History4 - elseif P.gameEnv.sequence==3 then--Pure random - end - - if AIdata then - P.human=false - P.AI_mode=AIdata.type - P.AI_stage=1 - P.AI_needFresh=false - P.AI_keys={} - P.AI_delay=min(int(P.gameEnv.drop*.8),2*AIdata.delta) - P.AI_delay0=AIdata.delta - P.AIdata={ - next=AIdata.next, - hold=AIdata.hold, - _20G=P.gameEnv._20G, - bag7=AIdata.bag7=="bag7", - node=AIdata.node, - } - if not BOT then P.AI_mode="9S"end - if P.AI_mode=="CC"then - P.RS=AIRS - local opt,wei=BOT.getConf() - BOT.setHold(opt,P.AIdata.hold) - BOT.set20G(opt,P.AIdata._20G) - BOT.setBag(opt,P.AIdata.bag7) - BOT.setNode(opt,P.AIdata.node) - P.AI_bot=BOT.new(opt,wei) - BOT.free(opt)BOT.free(wei) - for i=1,AIdata.next do - BOT.addNext(P.AI_bot,CCblockID[P.next[i].id]) - end - elseif P.AI_mode=="9S"then - P.RS=TRS - P.AI_keys={} - end - else - P.human=true - P.RS=TRS - players.human=players.human+1 - end - - P.showTime=visible_opt[P.gameEnv.visible] - P.keepVisible=P.gameEnv.visible=="show" - P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end - P.moving,P.downing=0,0 - P.waiting,P.falling=-1,-1 - P.clearing,P.cleared={},{} - P.combo,P.b2b=0,0 - P.fieldBeneath=0 - - P.shade={} - P.score1,P.b2b1=0,0 - P.bonus={}--texts - - P.endCounter=0--used after gameover - P.counter=0--many usage - P.result=nil--string:win/lose -end -function player.update(P,dt) - if P.timing then P.stat.time=P.stat.time+dt end - if P.alive then - if P.keyRec then - local v=0 - for i=2,10 do v=v+i*(i-1)*7.2/(frame-P.keyTime[i])end P.keySpeed=P.keySpeed*.99+v*.1 - v=0 - for i=2,10 do v=v+i*(i-1)*7.2/(frame-P.dropTime[i])end P.dropSpeed=P.dropSpeed*.99+v*.1 - --Update speeds - if modeEnv.royaleMode then - if P.keyPressing[9]then - P.swappingAtkMode=min(P.swappingAtkMode+2,30) - else - P.swappingAtkMode=P.swappingAtkMode+((#P.field>15 and P.swappingAtkMode>4 or P.swappingAtkMode>8)and -1 or 1) - end - end - end - - if not P.human and P.control and P.waiting==-1 then - local C=P.AI_keys - P.AI_delay=P.AI_delay-1 - if not C[1]then - P.AI_stage=AI_think[P.AI_mode][P.AI_stage](P,C) - elseif P.AI_delay<=0 then - P:pressKey(C[1])P:releaseKey(C[1]) - local k=#C for i=1,k do C[i]=C[i+1]end--table.remove(C,1) - P.AI_delay=P.AI_delay0*2 - end - end - if not P.keepVisible then - for j=1,#P.field do for i=1,10 do - if P.visTime[j][i]>0 then P.visTime[j][i]=P.visTime[j][i]-1 end - end end - end--Fresh visible time - if P.moving<0 then - if P.keyPressing[1]then - if -P.moving<=P.gameEnv.das then - P.moving=P.moving-1 - elseif P.waiting==-1 then - local x=P.curX - if P.gameEnv.arr>0 then - P.act.moveLeft(P,true) - else - P.act.insLeft(P,true) - end - if x~=P.curX then - P.moving=P.moving+P.gameEnv.arr-1 - elseif not P.small then - P.fieldOff.vx=-setting.shakeFX*.5 - end - end - else - P.moving=0 - end - elseif P.moving>0 then - if P.keyPressing[2]then - if P.moving<=P.gameEnv.das then - P.moving=P.moving+1 - elseif P.waiting==-1 then - local x=P.curX - if P.gameEnv.arr>0 then - P.act.moveRight(P,true) - else - P.act.insRight(P,true) - end - if x~=P.curX then - P.moving=P.moving-P.gameEnv.arr+1 - elseif not P.small then - P.fieldOff.vx=setting.shakeFX*.5 - end - end - else - P.moving=0 - end - end - if P.keyPressing[7]and not P.keyPressing[9]then - local d=P.downing-P.gameEnv.sddas - P.downing=P.downing+1 - if d>1 then - if P.gameEnv.sdarr>0 then - if d%P.gameEnv.sdarr==0 then - P.act.down1(P) - end - else - P.act.insDown(P) - end - if not P.small then - P.fieldOff.vy=setting.shakeFX*.3 - end - end - else - P.downing=0 - end - if P.falling>=0 then - P.falling=P.falling-1 - if P.falling>=0 then - goto stop - else - local L=#P.clearing - if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end - P.clearing,P.cleared={},{} - end - end - if not P.control then goto stop end - if P.waiting>=0 then - P.waiting=P.waiting-1 - if P.waiting==-1 then P:resetblock()end - goto stop - end - if P.curY~=P.y_img then - if P.dropDelay>=0 then - P.dropDelay=P.dropDelay-1 - if P.dropDelay>0 then goto stop end - end - P.curY=P.curY-1 - P.spinLast=false - if P.y_img~=P.curY then - P.dropDelay=P.gameEnv.drop - elseif P.AI_mode=="CC"then - P.AI_needFresh=true - if not P.AIdata._20G and P.gameEnv.drop=0 then goto stop end - P:drop() - if P.AI_mode=="CC"then - P.AI_needFresh=true - end - end - ::stop:: - if P.b2b1==P.b2b then - elseif P.b2b1=0 then - P.falling=P.falling-1 - if P.falling>=0 then - goto stop - else - local L=#P.clearing - if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end - P.clearing,P.cleared={},{} - end - end::stop:: - if P.endCounter<40 then - for j=1,#P.field do for i=1,10 do - if P.visTime[j][i]<20 then P.visTime[j][i]=P.visTime[j][i]+.5 end - end end--Make field visible - end - if P.b2b1>0 then P.b2b1=max(0,P.b2b1*.92-1)end - --Dead - end - if P.stat.score>P.score1 then - if P.stat.score-P.score1<10 then - P.score1=P.score1+1 - else - P.score1=int(min(P.score1*.9+P.stat.score*.1+1)) - end - end - for i=#P.shade,1,-1 do - local S=P.shade[i] - S[1]=S[1]-1+setting.dropFX*.15 - if S[1]<=0 then - rem(P.shade,i) - end - end - - if setting.shakeFX>0 then - local O=P.fieldOff - O.vx,O.vy=O.vx*.8-abs(O.x)^1.2*(O.x>0 and .1 or -.1),O.vy*.8-abs(O.y)^1.2*(O.y>0 and .1 or -.1) - O.x,O.y=O.x+O.vx,O.y+O.vy - if abs(O.x)<1 then O.x=0 end - if abs(O.y)<1 then O.y=0 end - end--field shaking - updateText(P.bonus) - for i=#P.atkBuffer,1,-1 do - local A=P.atkBuffer[i] - A.time=A.time+1 - if not A.sent then - if A.countdown>0 then - A.countdown=max(A.countdown-garbageSpeed,0) - end - else - if A.time>20 then - rem(P.atkBuffer,i) - end - end - end - if P.fieldBeneath>0 then P.fieldBeneath=max(P.fieldBeneath-pushSpeed,0)end - if not P.small then - PTC.dust[P.id]:update(dt) - end -end -function player.draw_norm(P) +function Pdraw_norm(P) gc.push("transform") gc.translate(P.x,P.y)gc.scale(P.size) --Camera @@ -832,7 +354,7 @@ function player.draw_norm(P) if P.cur.bk[i][j]then gc.rectangle("fill",30*(j+P.curX-1)-33,597-30*(i+P.curY-1),36,36) end - end end--BlockShade(lockdelay indicator) + end end--White Boarder(indicate lockdelay) gc.setColor(1,1,1) for i=1,P.r do for j=1,P.c do if P.cur.bk[i][j]then @@ -854,7 +376,7 @@ function player.draw_norm(P) ::E:: gc.setScissor()--In-playField things gc.setColor(1,1,1) - gc.draw(PTC.dust[P.id]) + gc.draw(P.dust) gc.translate(0,-P.fieldBeneath) gc.setBlendMode("replace","alphamultiply")--SPEED UPUP(?) gc.setLineWidth(2) @@ -954,7 +476,7 @@ function player.draw_norm(P) gc.draw(drawableText.kpm,344,583) --Speed dials gc.setColor(1,1,1) - modes[curMode.id].mesDisp(P,P.fieldOff.x,P.fieldOff.y)--Other messages + curMode.mesDisp(P)--Other messages if modeEnv.royaleMode then if P.atkMode then gc.setColor(1,.8,0,P.swappingAtkMode*.02) @@ -965,7 +487,7 @@ function player.draw_norm(P) end gc.pop() end -function player.draw_small(P) +function Pdraw_small(P) P.frameWait=P.frameWait-1 if P.frameWait==0 then P.frameWait=8 @@ -1007,8 +529,9 @@ function player.draw_small(P) gc.setColor(1,0,0,min(P.endCounter,25)*.04) gc.circle("line",P.centerX,P.centerY,(840-20*min(P.endCounter,30))*P.size) end + setFont(30) end -function player.draw_demo(P) +function Pdraw_demo(P) gc.push("transform") gc.translate(P.x,P.y)gc.scale(P.size)gc.translate(P.fieldOff.x,P.fieldOff.y) --Camera @@ -1084,11 +607,224 @@ function player.draw_demo(P) end --Next gc.setColor(1,1,1) - gc.draw(PTC.dust[P.id]) + gc.draw(P.dust) gc.translate(-P.fieldOff.x,-P.fieldOff.y) drawTexts(P.bonus) gc.pop() end +--------------Used in draw player↑ +player={}local player=player +function player.update(P,dt) + if P.timing then P.stat.time=P.stat.time+dt end + if P.alive then + if P.keyRec then + local v=0 + for i=2,10 do v=v+i*(i-1)*7.2/(frame-P.keyTime[i])end P.keySpeed=P.keySpeed*.99+v*.1 + v=0 + for i=2,10 do v=v+i*(i-1)*7.2/(frame-P.dropTime[i])end P.dropSpeed=P.dropSpeed*.99+v*.1 + --Update speeds + if modeEnv.royaleMode then + if P.keyPressing[9]then + P.swappingAtkMode=min(P.swappingAtkMode+2,30) + else + P.swappingAtkMode=P.swappingAtkMode+((#P.field>15 and P.swappingAtkMode>4 or P.swappingAtkMode>8)and -1 or 1) + end + end + end + + if not P.human and P.control and P.waiting==-1 then + local C=P.AI_keys + P.AI_delay=P.AI_delay-1 + if not C[1]then + P.AI_stage=AI_think[P.AI_mode][P.AI_stage](P,C) + elseif P.AI_delay<=0 then + P:pressKey(C[1])P:releaseKey(C[1]) + local k=#C for i=1,k do C[i]=C[i+1]end--table.remove(C,1) + P.AI_delay=P.AI_delay0*2 + end + end + if not P.keepVisible then + for j=1,#P.field do for i=1,10 do + if P.visTime[j][i]>0 then P.visTime[j][i]=P.visTime[j][i]-1 end + end end + end--Fresh visible time + if P.moving<0 then + if P.keyPressing[1]then + if -P.moving<=P.gameEnv.das then + P.moving=P.moving-1 + elseif P.waiting==-1 then + local x=P.curX + if P.gameEnv.arr>0 then + P.act.moveLeft(P,true) + else + P.act.insLeft(P,true) + end + if x~=P.curX then + P.moving=P.moving+P.gameEnv.arr-1 + elseif not P.small then + P.fieldOff.vx=-setting.shakeFX*.5 + end + end + else + P.moving=0 + end + elseif P.moving>0 then + if P.keyPressing[2]then + if P.moving<=P.gameEnv.das then + P.moving=P.moving+1 + elseif P.waiting==-1 then + local x=P.curX + if P.gameEnv.arr>0 then + P.act.moveRight(P,true) + else + P.act.insRight(P,true) + end + if x~=P.curX then + P.moving=P.moving-P.gameEnv.arr+1 + elseif not P.small then + P.fieldOff.vx=setting.shakeFX*.5 + end + end + else + P.moving=0 + end + end + if P.keyPressing[7]and not P.keyPressing[9]then + local d=P.downing-P.gameEnv.sddas + P.downing=P.downing+1 + if d>1 then + if P.gameEnv.sdarr>0 then + if d%P.gameEnv.sdarr==0 then + P.act.down1(P) + end + else + P.act.insDown(P) + end + if not P.small then + P.fieldOff.vy=setting.shakeFX*.3 + end + end + else + P.downing=0 + end + if P.falling>=0 then + P.falling=P.falling-1 + if P.falling>=0 then + goto stop + else + local L=#P.clearing + if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end + P.clearing={} + end + end + if not P.control then goto stop end + if P.waiting>=0 then + P.waiting=P.waiting-1 + if P.waiting==-1 then P:resetblock()end + goto stop + end + if P.curY~=P.y_img then + if P.dropDelay>=0 then + P.dropDelay=P.dropDelay-1 + if P.dropDelay>0 then goto stop end + end + P.curY=P.curY-1 + P.spinLast=false + if P.y_img~=P.curY then + P.dropDelay=P.gameEnv.drop + elseif P.AI_mode=="CC"then + P.AI_needFresh=true + if not P.AIdata._20G and P.gameEnv.drop=0 then goto stop end + P:drop() + if P.AI_mode=="CC"then + P.AI_needFresh=true + end + end + ::stop:: + if P.b2b1==P.b2b then + elseif P.b2b1=0 then + P.falling=P.falling-1 + if P.falling>=0 then + goto stop + else + local L=#P.clearing + if P.human and P.gameEnv.fall>0 and #P.field+L>P.clearing[L]then SFX("fall")end + P.clearing={} + end + end::stop:: + if P.endCounter<40 then + for j=1,#P.field do for i=1,10 do + if P.visTime[j][i]<20 then P.visTime[j][i]=P.visTime[j][i]+.5 end + end end--Make field visible + end + if P.b2b1>0 then P.b2b1=max(0,P.b2b1*.92-1)end + --Dead + end + if P.stat.score>P.score1 then + if P.stat.score-P.score1<10 then + P.score1=P.score1+1 + else + P.score1=int(min(P.score1*.9+P.stat.score*.1+1)) + end + end + for i=#P.shade,1,-1 do + local S=P.shade[i] + S[1]=S[1]-1+setting.dropFX*.15 + if S[1]<=0 then + rem(P.shade,i) + end + end + + if setting.shakeFX>0 then + local O=P.fieldOff + O.vx,O.vy=O.vx*.8-abs(O.x)^1.2*(O.x>0 and .1 or -.1),O.vy*.8-abs(O.y)^1.2*(O.y>0 and .1 or -.1) + O.x,O.y=O.x+O.vx,O.y+O.vy + if abs(O.x)<1 then O.x=0 end + if abs(O.y)<1 then O.y=0 end + end--field shaking + updateText(P.bonus) + for i=#P.atkBuffer,1,-1 do + local A=P.atkBuffer[i] + A.time=A.time+1 + if not A.sent then + if A.countdown>0 then + A.countdown=max(A.countdown-garbageSpeed,0) + end + else + if A.time>20 then + rem(P.atkBuffer,i) + end + end + end + if P.fieldBeneath>0 then P.fieldBeneath=max(P.fieldBeneath-P.gameEnv.pushSpeed,0)end + if not P.small then + P.dust:update(dt) + end +end -------------------------------------------------- local textFX=textFX function player.showText(P,text,dx,dy,font,style,spd,stop) @@ -1194,7 +930,7 @@ local function checkrow(P,start,height)--(cy,r) removeRow(P.visTime,h) c=c+1 if not P.small then - local S=PTC.dust[P.id] + local S=P.dust for _=1,100 do S:setPosition(rnd(300),630-30*(h+c)+rnd(30)) S:emit(2) @@ -1324,14 +1060,11 @@ function player.changeAtkMode(P,m) P.atkMode=m if m==1 then P:changeAtk(randomTarget(P)) - elseif m==2 then - P:freshTarget() - elseif m==3 then + elseif m==2 or m==3 then P:freshTarget() elseif m==4 then P:changeAtk() end - ::L:: end function player.changeAtk(P,R) -- if not P.human then R=players[1]end--Delete first "--" to enable 1vALL mode @@ -1340,11 +1073,10 @@ function player.changeAtk(P,R) for i=1,#K do if K[i]==P then rem(K,i) - goto L + break end end end - ::L:: if R then P.atking=R R.atker[#R.atker+1]=P @@ -1619,6 +1351,7 @@ function player.resetblock(P) end function player.drop(P)--Place piece P.dropTime[11]=ins(P.dropTime,1,frame)--update speed dial + if P.cleared[1]then P.cleared={}end P.waiting=P.gameEnv.wait local dospin=0 if P.spinLast then @@ -1802,9 +1535,14 @@ function player.drop(P)--Place piece end end send=send+(renATK[P.combo]or 3) + sendTime=sendTime+25*P.combo + if P.combo>2 then + P:showText(text.cmb[min(P.combo,20)],0,25,15+min(P.combo,25)*3,P.combo<10 and"appear"or"flicker") + cscore=cscore+min(20*P.combo,300)*cc + end if #P.field==0 then P:showText(text.PC,0,-80,50,"flicker") - send=min(send,3)+min(6+P.stat.pc,10) + send=ceil(send^.5)+min(6+P.stat.pc,10) exblock=exblock+2 sendTime=sendTime+60 if P.stat.row>4 then @@ -1820,11 +1558,6 @@ function player.drop(P)--Place piece VOICE("pc",CHN) end end - if P.combo>2 then - P:showText(text.cmb[min(P.combo,20)],0,25,15+min(P.combo,25)*3,P.combo<10 and"appear"or"flicker") - cscore=cscore+min(20*P.combo,300)*cc - end - sendTime=sendTime+25*P.combo if P.human then SFX(clear_n[cc]) SFX(ren_n[min(P.combo,11)]) @@ -1839,14 +1572,13 @@ function player.drop(P)--Place piece send=send+reAtk[i] exblock=exblock+reDef[i] end - end--Counter attack + end--Bonus atk/def when focused if send>0 then - P.stat.atk=P.stat.atk+send + P.stat.atk=P.stat.atk+int(send) --ATK statistics if exblock then exblock=int(exblock*(1+P.strength*.25))end - send=send*(1+P.strength*.25) - send=int(send) + send=int(send*(1+P.strength*.25)) --Badge Buff if send==0 then goto L end P:showText(send,0,80,35,"zoomout") @@ -1937,7 +1669,10 @@ function player.drop(P)--Place piece end P.stat.score=P.stat.score+cscore P.stat.piece,P.stat.row=P.stat.piece+1,P.stat.row+cc - Event[P.gameEnv.dropPiece](P) + local _=P.gameEnv.dropPiece + if _ then + _(P) + end if P.human then SFX("lock",nil,getBlockDirection(P))end end function player.pressKey(P,i) @@ -2193,4 +1928,272 @@ function player.act.addRight(P) P.act.insLeft(P) P.act.hardDrop(P) end --------------------------------------------------- \ No newline at end of file +-------------------------------------------------- +function newDemoPlayer(id,x,y,size) + local P={id=id}players[id]=P + P.invincible=true + for k,v in next,player do P[k]=v end + players.alive[#players.alive+1]=P + P.x,P.y,P.size=x,y,size + P.fieldOff={x=0,y=0,vx=0,vy=0} + P.small,P.keyRec=false,false + P.draw=Pdraw_demo + + P.centerX,P.centerY=P.x+300*P.size,P.y+600*P.size + P.absFieldX=P.x+150*P.size + P.absFieldY=P.y+60*P.size + + P.alive=true + P.control=true + P.timing=false + P.stat={ + time=0,score=0, + key=0,extraPiece=0,extraRate=0, + rotate=0,hold=0,piece=0,row=0, + atk=0,send=0,recv=0,pend=0, + clear_1=0,clear_2=0,clear_3=0,clear_4=0, + spin_0=0,spin_1=0,spin_2=0,spin_3=0, + pc=0,b2b=0,b3b=0, + } + P.modeData={point=0,event=0,counter=0} + P.keyTime={}for i=1,10 do P.keyTime[i]=-1e5 end P.keySpeed=0 + P.dropTime={}for i=1,10 do P.dropTime[i]=-1e5 end P.dropSpeed=0 + + P.atker={} + P.strength=0 + + P.field,P.visTime={},{} + P.atkBuffer={sum=0} + P.gameEnv={ + das=5,arr=2, + sddas=2,sdarr=2, + _20G=false,bone=false, + drop=1e99,lock=1e99, + wait=10,fall=20, + next=6,hold=true,oncehold=true, + sequence="bag7", + + block=true, + visible="show", + Fkey=NULL,puzzle=false,ospin=true, + freshLimit=1e99,easyFresh=true, + target=1e99,dropPiece=NULL, + } + P.cur={bk={{}},id=0,color=0,name=0} + P.sc,P.dir,P.r,P.c={0,0},0,0,0 + P.curX,P.curY,P.y_img=0,0,0 + P.hd={bk={{}},id=0,color=0,name=0} + P.holded=false + P.next={} + + P.dropDelay,P.lockDelay=1e99,1e99 + P.freshTime=0 + P.spinLast,P.lastClear=false,nil + P.spinSeq=0 + P.ctrlCount=0 + + local bag1={1,2,3,4,5,6,7} + for _=1,7 do + P:newNext(rem(bag1,rnd(#bag1))) + end + P.freshNext=freshMethod.bag7 + if P.gameEnv.sequence==1 then P.bag={}--Bag7 + elseif P.gameEnv.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end--History4 + elseif P.gameEnv.sequence==3 then--Pure random + end + + P.human=false + P.AI_mode="CC" + P.AI_stage=1 + P.AI_needFresh=false + P.AI_keys={} + P.AI_delay,P.AI_delay0=3,3 + P.AIdata={next=5,hold=true,_20G=false,bag7=true,node=80000} + if not BOT then P.AI_mode="9S"end + if P.AI_mode=="CC"then + P.RS=AIRS + local opt,wei=BOT.getConf() + BOT.setHold(opt,P.AIdata.hold) + BOT.set20G(opt,P.AIdata._20G) + BOT.setBag(opt,P.AIdata.bag7) + BOT.setNode(opt,P.AIdata.node) + P.AI_bot=BOT.new(opt,wei) + BOT.free(opt)BOT.free(wei) + local CCBID={4,3,5,6,1,2,0} + for i=1,5 do + BOT.addNext(P.AI_bot,CCBID[P.next[i].id]) + end + elseif P.AI_mode=="9S"then + P.RS=TRS + end + P.showTime=1e99 + P.keepVisible=true + P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end + P.moving,P.downing=0,0 + P.waiting,P.falling=-1,-1 + P.clearing,P.cleared={},{} + P.combo,P.b2b=0,0 + P.fieldBeneath=0 + P.score1,P.b2b1=0,0 + P.shade={} + P.bonus={}--texts + P.dust=clearDust:clone() + P.dust:start() + + P:resetblock() +end +function newPlayer(id,x,y,size,AIdata) + players[id]={id=id} + local P=players[id] + for k,v in next,player do P[k]=v end--Class function + players.alive[#players.alive+1]=P + P.x,P.y,P.size=x,y,size or 1 + P.fieldOff={x=0,y=0,vx=0,vy=0}--for shake FX + P.small=P.size<.1--if draw in small mode + P.keyRec=not P.small--if calculate keySpeed + if P.small then + P.centerX,P.centerY=P.x+300*P.size,P.y+600*P.size + P.canvas=love.graphics.newCanvas(60,120) + P.frameWait=rnd(30,120) + P.draw=Pdraw_small + else + P.centerX,P.centerY=P.x+300*P.size,P.y+370*P.size + P.absFieldX=P.x+150*P.size + P.absFieldY=P.y+60*P.size + P.draw=Pdraw_norm + P.dust=clearDust:clone() + P.dust:start() + end + + P.alive=true + P.control=false + P.timing=false + P.stat={ + time=0,score=0, + key=0,extraPiece=0,extraRate=0, + rotate=0,hold=0,piece=0,row=0, + atk=0,send=0,recv=0,pend=0, + clear_1=0,clear_2=0,clear_3=0,clear_4=0, + spin_0=0,spin_1=0,spin_2=0,spin_3=0, + pc=0,b2b=0,b3b=0, + }--Current gamestat + P.modeData={point=0,event=0,counter=0}--data use by mode + P.keyTime={}for i=1,10 do P.keyTime[i]=-1e5 end P.keySpeed=0 + P.dropTime={}for i=1,10 do P.dropTime[i]=-1e5 end P.dropSpeed=0 + + P.field,P.visTime={},{} + P.atkBuffer={sum=0} + + P.ko,P.badge,P.strength=0,0,0 + P.atkMode,P.swappingAtkMode=1,20 + P.atker,P.atking,P.lastRecv={} + P.rank=nil + --Royale-related + + P.gameEnv={}--Current game setting environment + for k,v in next,gameEnv0 do + if modeEnv[k]~=nil then + P.gameEnv[k]=modeEnv[k] + elseif setting[k]~=nil then + P.gameEnv[k]=setting[k] + else + P.gameEnv[k]=v + end + end--reset current game settings + P.cur={bk={{}},id=0,color=0,name=0}--shape,shapeID,colorID,nameID + P.sc,P.dir,P.r,P.c={0,0},0,0,0--spinCenter,direction,row,col + P.curX,P.curY,P.y_img=0,0,0--x,y,ghostY + P.hd={bk={{}},id=0,color=0,name=0} + P.holded=false + P.next={} + + P.dropDelay,P.lockDelay=P.gameEnv.drop,P.gameEnv.lock + P.freshTime=0 + P.spinLast,P.lastClear=false,nil + P.spinSeq=0--for Ospin,each digit mean a spin + P.ctrlCount=0--key press time,for finesse check + + P.his={rnd(7),rnd(7),rnd(7),rnd(7)} + local s=P.gameEnv.sequence + if s=="bag7"or s=="his4"then + local bag1={1,2,3,4,5,6,7} + for _=1,7 do + P:newNext(rem(bag1,rnd(#bag1))) + end + elseif s=="rnd"then + for _=1,6 do + local r=rnd(7) + P:newNext(r) + end + elseif s=="drought1"then + local bag1={1,2,3,4,5,6} + for _=1,6 do + P:newNext(rem(bag1,rnd(#bag1))) + end + elseif s=="drought2"then + local bag1={1,2,3,4,6,6} + for _=1,6 do + P:newNext(rem(bag1,rnd(#bag1))) + end + end + + P.freshNext=freshMethod[P.gameEnv.sequence] + if P.gameEnv.sequence==1 then P.bag={}--Bag7 + elseif P.gameEnv.sequence==2 then P.his={}for i=1,4 do P.his[i]=P.next.id[i+3]end--History4 + elseif P.gameEnv.sequence==3 then--Pure random + end + + if AIdata then + P.human=false + P.AI_mode=AIdata.type + P.AI_stage=1 + P.AI_needFresh=false + P.AI_keys={} + P.AI_delay=min(int(P.gameEnv.drop*.8),2*AIdata.delta) + P.AI_delay0=AIdata.delta + P.AIdata={ + next=AIdata.next, + hold=AIdata.hold, + _20G=P.gameEnv._20G, + bag7=AIdata.bag7=="bag7", + node=AIdata.node, + } + if not BOT then P.AI_mode="9S"end + if P.AI_mode=="CC"then + P.RS=AIRS + local opt,wei=BOT.getConf() + BOT.setHold(opt,P.AIdata.hold) + BOT.set20G(opt,P.AIdata._20G) + BOT.setBag(opt,P.AIdata.bag7) + BOT.setNode(opt,P.AIdata.node) + P.AI_bot=BOT.new(opt,wei) + BOT.free(opt)BOT.free(wei) + for i=1,AIdata.next do + BOT.addNext(P.AI_bot,CCblockID[P.next[i].id]) + end + elseif P.AI_mode=="9S"then + P.RS=TRS + P.AI_keys={} + end + else + P.human=true + P.RS=TRS + players.human=players.human+1 + end + + P.showTime=visible_opt[P.gameEnv.visible] + P.keepVisible=P.gameEnv.visible=="show" + P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end + P.moving,P.downing=0,0 + P.waiting,P.falling=-1,-1 + P.clearing,P.cleared={},{} + P.combo,P.b2b=0,0 + P.fieldBeneath=0 + + P.score1,P.b2b1=0,0 + P.shade={} + P.bonus={}--texts + + P.endCounter=0--used after gameover + P.result=nil--string:"WIN"/"K.O." +end \ No newline at end of file diff --git a/scene.lua b/scene.lua index af006321..b6368221 100644 --- a/scene.lua +++ b/scene.lua @@ -1,3 +1,4 @@ +local int,max,format=math.floor,math.max,string.format local scene={ cur="load",--Current scene swapping=false,--ifSwapping @@ -9,7 +10,7 @@ local scene={ draw=nil, --Swap draw }, seq={"quit","slowFade"},--Back sequence -} +}--scene datas,returned local sceneInit={ quit=love.event.quit, load=function() @@ -49,6 +50,7 @@ local sceneInit={ curBG="none" BGM("blank") destroyPlayers() + mapCam.zoomK=scene.swap.tar=="mode"and 5 or 1 end, custom=function() sceneTemp=1--option select @@ -58,7 +60,12 @@ local sceneInit={ end, draw=function() curBG="none" - sceneTemp={sure=0,pen=1,x=1,y=1} + sceneTemp={ + sure=0, + pen=1, + x=1,y=1, + demo=false, + } end, play=function() love.keyboard.setKeyRepeat(false) @@ -72,7 +79,25 @@ local sceneInit={ curBG=modeEnv.bg end, pause=function() - curBG=modeEnv.bg + local S=players[1].stat + sceneTemp={ + S.key, + S.rotate, + S.hold, + S.piece.." "..(int(S.piece/S.time*100)*.01).."PPS", + S.row.." "..(int(S.row/S.time*600)*.1).."LPM", + S.atk.." "..(int(S.atk/S.time*600)*.1).."APM", + S.send, + S.recv, + S.pend, + S.clear_1.."/"..S.clear_2.."/"..S.clear_3.."/"..S.clear_4, + "["..S.spin_0.."]/"..S.spin_1.."/"..S.spin_2.."/"..S.spin_3, + S.b2b.."[+"..S.b3b.."]", + S.pc, + format("%0.2f",S.atk/S.row), + S.extraPiece, + max(100-int(S.extraRate/S.piece*10000)*.01,0).."%", + } end, setting_game=function() curBG="none" @@ -105,10 +130,32 @@ local sceneInit={ help=function() curBG="none" end, + stat=function() + local S=stat + sceneTemp={ + S.run, + S.game, + format("%0.1fHr",S.time*2.78e-4), + S.key, + S.rotate, + S.hold, + S.piece, + S.row, + S.atk, + S.send, + S.recv, + S.pend, + S.clear_1.."/"..S.clear_2.."/"..S.clear_3.."/"..S.clear_4, + "["..S.spin_0.."]/"..S.spin_1.."/"..S.spin_2.."/"..S.spin_3, + S.b2b.."[+"..S.b3b.."]", + S.pc, + format("%0.2f",S.atk/S.row), + S.extraPiece.."["..(int(S.extraRate/S.piece*10000)*.01).."%]", + } + end, history=function() - updateLog=require"updateLog" curBG="lightGrey" - sceneTemp=1--scroll pos + sceneTemp={require("updateLog"),1}--scroll pos end, quit=function() love.timer.sleep(.3) @@ -128,19 +175,24 @@ local swapDeck_data={ }--Block id [ZSLJTOI] ,dir,x,y local gc=love.graphics local swap={ - none={1,0,nil,NULL}, - flash={8,1,nil,function()gc.clear(1,1,1)end}, - fade={30,15,"swipe",function(t) + none={1,0,NULL}, + 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 gc.setColor(0,0,0,t) gc.rectangle("fill",0,0,1280,720) end}, - slowFade={180,90,nil,function(t) + fade_togame={120,20,function(t) + local t=t>20 and (120-t)/100 or t/20 + gc.setColor(0,0,0,t) + gc.rectangle("fill",0,0,1280,720) + end}, + slowFade={180,90,function(t) local t=t>90 and 2-t/90 or t/90 gc.setColor(0,0,0,t) gc.rectangle("fill",0,0,1280,720) end}, - deck={50,8,nil,function(t) + deck={50,8,function(t) gc.setColor(1,1,1) if t>8 then local t=t<15 and 15 or t @@ -166,12 +218,12 @@ local backFunc={ pause=function() love.keyboard.setKeyRepeat(true) updateStat() - saveData() + saveStat() clearTask("play") end, - setting_game=function() - saveSetting() - end, + setting_game= function()saveSetting()end, + setting_graphic=function()saveSetting()end, + setting_sound= function()saveSetting()end, } function scene.init(s) if sceneInit[s]then sceneInit[s]()end @@ -196,8 +248,7 @@ function scene.swapTo(tar,style) local swap=swap[style] S.time=swap[1] S.mid=swap[2] - if swap[3]then SFX(swap[3])end - S.draw=swap[4] + S.draw=swap[3] widget_sel=nil end end diff --git a/shader.lua b/shader.lua deleted file mode 100644 index 32f0f156..00000000 --- a/shader.lua +++ /dev/null @@ -1,2 +0,0 @@ -gc=love.graphics -shader_glow=gc.newShader("shader/glow.cs") \ No newline at end of file diff --git a/sound.lua b/sound.lua index b8e92e69..5608f137 100644 --- a/sound.lua +++ b/sound.lua @@ -32,8 +32,8 @@ function SFX(s,v,pos) end end function getVoice(str) - local n=1 local L=voiceBank[str] + local n=1 while L[n]:isPlaying()do n=n+1 if not L[n]then diff --git a/texture.lua b/texture.lua index bd0b5df1..18c03d6e 100644 --- a/texture.lua +++ b/texture.lua @@ -39,17 +39,17 @@ end puzzleMark={} gc.setLineWidth(3) -for i=1,13 do +for i=1,7 do puzzleMark[i]=C(30,30) - if i>7 then - gc.setColor(blockColor[i]) - gc.rectangle("line",7,7,16,16) - else - local c=blockColor[i] - gc.setColor(c[1],c[2],c[3],.6) - gc.rectangle("line",5,5,20,20) - gc.rectangle("line",10,10,10,10) - end + local c=blockColor[i] + gc.setColor(c[1],c[2],c[3],.6) + gc.rectangle("line",5,5,20,20) + gc.rectangle("line",10,10,10,10) +end +for i=8,13 do + puzzleMark[i]=C(30,30) + gc.setColor(blockColor[i]) + gc.rectangle("line",7,7,16,16) end c=C(30,30) gc.setColor(1,1,1) @@ -60,15 +60,20 @@ gc.setColor(1,1,1,.9) gc.draw(c) c:release() -PTC={dust={}}--Particle systems +mapCross=C(40,40) +gc.setColor(1,1,1) +gc.setLineWidth(4) +gc.line(0,20,40,20) +gc.line(20,0,20,40) + c=C(6,6) gc.clear(1,1,1) -PTC.dust0=gc.newParticleSystem(c,1000) +clearDust=gc.newParticleSystem(c,1000) c:release() -PTC.dust0:setParticleLifetime(.2,.3) -PTC.dust0:setEmissionRate(0) -PTC.dust0:setLinearAcceleration(-1500,-200,1500,200) -PTC.dust0:setColors(1,1,1,.5,1,1,1,0) +clearDust:setParticleLifetime(.2,.3) +clearDust:setEmissionRate(0) +clearDust:setLinearAcceleration(-1500,-200,1500,200) +clearDust:setColors(1,1,1,.5,1,1,1,0) --Dust particles gc.setDefaultFilter("linear","linear") @@ -85,11 +90,13 @@ background2=N("/image/BG/bg2.png") groupCode=N("/image/mess/groupcode.png") payCode=N("/image/mess/paycode.png") -miya_ch=N("/image/miya/ch.png") -miya_f1=N("/image/miya/f1.png") -miya_f2=N("/image/miya/f2.png") -miya_f3=N("/image/miya/f3.png") -miya_f4=N("/image/miya/f4.png") +miya={ + ch=N("/image/miya/ch.png"), + f1=N("/image/miya/f1.png"), + f2=N("/image/miya/f2.png"), + f3=N("/image/miya/f3.png"), + f4=N("/image/miya/f4.png"), +} drawableText={ question=T(100,"?"), bpm=T(15,"BPM"),kpm=T(15,"KPM"), @@ -121,8 +128,8 @@ drawableText={ musicRoom=T(80), nowPlaying=T(50), warning=T(30), - VKTchW=T(30), - VKOrgW=T(30), - VKCurW=T(30), + VKTchW=T(30),VKOrgW=T(30),VKCurW=T(30), + noScore=T(50), + highScore=T(30), } gc.setCanvas() \ No newline at end of file diff --git a/timer.lua b/timer.lua index 55e0af8d..014df1a8 100644 --- a/timer.lua +++ b/timer.lua @@ -1,4 +1,5 @@ local wd=love.window +local kb=love.keyboard local Timer=love.timer.getTime local int,abs,rnd,max,min,sin=math.floor,math.abs,math.random,math.max,math.min,math.sin local ins,rem=table.insert,table.remove @@ -8,6 +9,7 @@ function Tmr.load() local t=Timer() local L=loading ::R:: + --L={stage,curPos,curLen} if L[1]==1 then local N=voiceName[L[2]] for i=1,#voiceList[N]do @@ -25,7 +27,7 @@ function Tmr.load() bgm[N]:setVolume(0) L[2]=L[2]+1 if L[2]>L[3]then - for i=1,#bgm do bgm[i]=nil end + for i=1,L[3]do bgm[i]=nil end L[1],L[2],L[3]=3,1,#sfx end elseif L[1]==3 then @@ -33,10 +35,25 @@ function Tmr.load() sfx[S]={love.audio.newSource("/SFX/"..S..".ogg","static")} L[2]=L[2]+1 if L[2]>L[3]then - for i=1,L[2]do sfx[i]=nil end - L[1],L[2],L[3]=0,1,1 - SFX("welcome",.2) + for i=1,L[3]do sfx[i]=nil end + L[1],L[2],L[3]=4,1,#modes end + elseif L[1]==4 then + local m=modes[L[2]] + modes[L[2]]=require("modes/"..m[1]) + local M=modes[L[2]] + M.saveFileName,M.x,M.y,M.shape,M.size,M.id,M.unlock=m[1],m.x,m.y,m.shape,m.size,m.id,m.unlock + M.records=loadRecord(m[1]) + L[2]=L[2]+1 + if L[2]>L[3]then + L[1],L[2],L[3]=5,1,1 + end + elseif L[1]==5 then + --------------------------Loading some other things here? + + -------------------------- + L[1],L[2],L[3]=0,1,1 + SFX("welcome",.2) else L[2]=L[2]+1 L[3]=L[2] @@ -53,6 +70,67 @@ end function Tmr.main(dt) players[1]:update(dt) end +function Tmr.mode(dt) + local cam=mapCam + local F + local x,y,k=cam.x,cam.y,cam.k + if kb.isDown("up", "w") then y=y-10*k;F=true end + if kb.isDown("down","s") then y=y+10*k;F=true end + if kb.isDown("left","a") then x=x-10*k;F=true end + if kb.isDown("right","d") then x=x+10*k;F=true end + if F or cam.keyCtrl and(x-cam.x1)^2+(y-cam.y1)^2>2.6 then + if F then + cam.keyCtrl=true + end + local x,y=(cam.x1-180)/cam.k1,cam.y1/cam.k1 + local MM,R=modes,modeRanks + for _=1,#MM do + if R[_]then + local M=MM[_] + local s=M.size + local __ + if M.shape==1 then + if x>M.x-s and xM.y-s and y1400*k then x=1400*k + elseif x<-1300*k then x=-1300*k + end + if y>500*k then y=500*k + elseif y<-1900*k then y=-1900*k + end + cam.x,cam.y=x,y + --keyboard controlling + + cam.x1=cam.x1*.85+x*.15 + cam.y1=cam.y1*.85+y*.15 + cam.k1=cam.k1*.85+k*.15 + local _=scene.swap.tar + cam.zoomMethod=_=="play"and 1 or _=="mode"and 2 + if cam.zoomMethod==1 then + if cam.zoomK<60 then + if cam.sel then + local M=modes[cam.sel] + cam.x=cam.x*.8+M.x*cam.k*.2 + cam.y=cam.y*.8+M.y*cam.k*.2 + end + _=cam.zoomK + if _<1 then _=_*1.1 end + cam.zoomK=_*1.06 + end + elseif cam.zoomMethod==2 then + cam.zoomK=cam.zoomK^.9 + end +end function Tmr.draw() if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end end diff --git a/toolfunc.lua b/toolfunc.lua index 40052f05..5fca84ba 100644 --- a/toolfunc.lua +++ b/toolfunc.lua @@ -2,7 +2,7 @@ local tm=love.timer local gc=love.graphics local kb=love.keyboard local int,abs,rnd,max,min=math.floor,math.abs,math.random,math.max,math.min -local sub,find=string.sub,string.find +local sub,find,format,char,byte=string.sub,string.find,string.format,string.char,string.byte local ins,rem=table.insert,table.remove local toN,toS=tonumber,tostring local concat=table.concat @@ -17,6 +17,17 @@ local function splitS(s,sep) until #s==0 return t end + +function toTime(s) + if s<60 then + return format("%.2fs",s) + elseif s<3600 then + return format("%dm%.2fs",int(s/60),s%60) + else + local h=int(s/3600) + return format("%dh%dm%.2fs",h,int(s-h/60),s%60) + end +end function mStr(s,x,y) gc.printf(s,x-320,y,640,"center") end @@ -27,6 +38,7 @@ function destroyPlayers() for i=#players,1,-1 do local P=players[i] if P.canvas then P.canvas:release()end + if P.dust then P.dust:release()end while P.field[1]do removeRow(P.field) removeRow(P.visTime) @@ -66,7 +78,6 @@ function removeRow(t,k) freeRow.L=freeRow.L+1 end --Single-usage funcs -langName={"中文","全中文","English"} local langID={"chi","chi_full","eng"} local drawableTextLoad={ "next","hold", @@ -81,6 +92,8 @@ local drawableTextLoad={ "nowPlaying", "warning", "VKTchW","VKOrgW","VKCurW", + "noScore", + "highScore", } function swapLanguage(l) text=require("language/"..langID[l]) @@ -130,7 +143,58 @@ function restoreVirtualKey() B.r=O.r end end - +function copyBoard() + local str="" + for y=1,20 do + local L="" + for x=1,10 do + local s=preField[y][x] + if s>7 then s=s-1 end + L=L..char(66+s) + end + str=str..L.."\n" + end + love.system.setClipboardText("Techmino sketchpad:\n"..str) + TEXT(text.copySuccess,350,360,40,"appear",.5) +end +function pasteBoard() + local str=love.system.getClipboardText() + local len=#str + local s,p,P,_=0,1,10--sum,pStr,pField + if sub(str,1,20)=="Techmino sketchpad:\n"then + p=21 + else + p=find(str,":") + if p then + p=p+1 + else + p=find(str,"[A-N]") + end + end + ::L1:: + _=byte(str,p) + if _<65 or _>78 then + p=p+1 + goto L1 + end + ::L2:: + if s==200 then return end + if p>len then + if s~=200 then + goto E + end + end + _=byte(sub(str,p))-66 + if _>-2 and _<13 then + if _>7 then _=_+1 end + preField[int(P/10)][P%10+1]=_ + s,P=s+1,P+1 + end + p=p+1 + goto L2 + ::E:: + TEXT(text.dataCorrupted,350,360,35,"flicker",.5) +end function updateStat() local S=players[1].stat @@ -138,7 +202,6 @@ function updateStat() stat[k]=stat[k]+S[k] end end - function randomTarget(P) if #players.alive>1 then local R @@ -188,7 +251,10 @@ function royaleLevelup() if players[1].alive then BGM("cruelty")end elseif gameStage==4 then spd=10 - pushSpeed=3 + local _=players.alive + for i=1,#_ do + _[i].gameEnv.pushSpeed=3 + end elseif gameStage==5 then spd=5 garbageSpeed=1 @@ -211,7 +277,6 @@ function royaleLevelup() end end end - function pauseGame() restartCount=0--Avoid strange darkness pauseTimer=0--Pause timer for animation @@ -231,26 +296,30 @@ end function resumeGame() scene.swapTo("play","fade") end -function loadGame(mode,level) +function loadGame(M) --rec={} - curMode={ - id=modeID[mode], - lv=level, - } - drawableText.modeName:set(text.modeName[mode]) - drawableText.levelName:set(modes[modeID[mode]].level[level]) + M=modes[M] + curMode=M + local lang=setting.lang + drawableText.modeName:set(M.name[lang]) + drawableText.levelName:set(M.level[lang]) needResetGameData=true - scene.swapTo("play","deck") + scene.swapTo("play","fade_togame") end function resetPartGameData() gameResult=false frame=30 destroyPlayers() - modes[curMode.id].load() + curMode.load() texts={} + for i=1,#players do + if players.dust then + players.dust:reset() + end + end if modeEnv.task then for i=1,#players do - newTask(Event_task[modeEnv.task],players[i]) + newTask(modeEnv.task,players[i]) end end if modeEnv.royaleMode then @@ -265,16 +334,14 @@ function resetGameData() gameResult=false frame=0 garbageSpeed=1 - pushSpeed=3 pauseTime=0--Time paused pauseCount=0--Times paused destroyPlayers() - local E=modes[curMode.id].env - modeEnv=E[curMode.lv]or E[1] - modes[curMode.id].load()--bg/bgm need redefine in custom,so up here + modeEnv=curMode.env + curMode.load()--bg/bgm need redefine in custom,so up here if modeEnv.task then for i=1,#players do - newTask(Event_task[modeEnv.task],players[i]) + newTask(modeEnv.task,players[i]) end end curBG=modeEnv.bg @@ -283,15 +350,6 @@ function resetGameData() texts={} FX_badge={} FX_attack={} - for _,v in next,PTC.dust do - v:release() - end - for i=1,#players do - if not players[i].small then - PTC.dust[i]=PTC.dust0:clone() - PTC.dust[i]:start() - end - end if modeEnv.royaleMode then for i=1,#players do players[i]:changeAtk(randomTarget(players[i])) @@ -299,7 +357,6 @@ function resetGameData() mostBadge,mostDangerous,secBadge,secDangerous=nil gameStage=1 garbageSpeed=.3 - pushSpeed=2 end restoreVirtualKey() stat.game=stat.game+1 @@ -324,9 +381,48 @@ function gameStart() P.control=true end end +local fs=love.filesystem +function loadRecord(N) + local F=fs.newFile(N..".dat") + if F:open("r")then + local s=loadstring(F:read()) + local T={} + setfenv(s,T) + T[1]=s() + return T[1] + else + return{} + end +end +local function dumpTable(L) + local s="{\n" + for k,v in next,L do + local T + T=type(v) + if T=="number"then v=tostring(v) + elseif T=="string"then v="\""..v.."\"" + elseif T=="table"then v=dumpTable(v) + else error("Error data type!") + end + s=s.."["..k.."]="..v..",\n" + end + return s.."}" +end +function saveRecord(N,L) + local F=fs.newFile(N..".dat") + F:open("w") + local _=F:write("return"..dumpTable(L)) + F:flush() + F:close() + if not _ then + TEXT(text.recSavingError..mes,640,480,40,"appear",.4) + end +end +function delRecord(N) + fs.remove(N..".dat") +end - -local dataOpt={ +local statOpy={ "run","game","time", "extraPiece","extraRate", "key","rotate","hold","piece","row", @@ -335,43 +431,67 @@ local dataOpt={ "spin_0","spin_1","spin_2","spin_3", "b2b","b3b","pc","score", } -function loadData() - userData:open("r") - local t=userData:read() +function loadStat() + local F=FILE.data + F:open("r") + local t=F:read() t=splitS(t,"\r\n") - userData:close() + F:close() for i=1,#t do local p=find(t[i],"=") if p then local t,v=sub(t[i],1,p-1),sub(t[i],p+1) - if t=="gametime"then t="time"end - for i=1,#dataOpt do - if t==dataOpt[i]then - v=toN(v)if not v or v<0 then v=0 end - stat[t]=v - break + if t=="rank"then + v=splitS(v,",") + for i=1,#modeRanks do + local v=toN(v[i]) + if not v or v<0 or v>6 or v~=int(v)then v=false end + modeRanks[i]=v + end + else + if t=="gametime"then t="time"end + for i=1,#statOpy do + if t==statOpy[i]then + v=toN(v)if not v or v<0 then v=0 end + stat[t]=v + break + end end end end end end -function saveData() +function saveStat() local t={} - for i=1,#dataOpt do - t[i]=dataOpt[i].."="..toS(stat[dataOpt[i]]) + for i=1,#statOpy do + t[i]=statOpy[i].."="..toS(stat[statOpy[i]]) end + + local R={} + local RR=modeRanks + for i=1,#RR do + R[i]=RR[i]or"X" + end + t[#t+1]="rank="..concat(R,",") + --Save unlock infos + t=concat(t,"\r\n") - userData:open("w") - userData:write(t) - userData:flush() - userData:close() + local F=FILE.data + F:open("w") + local _=F:write(t) + F:flush() + F:close() + if not _ then + TEXT(text.statSavingError..mes,640,480,40,"appear",.4) + end end function loadSetting() - userSetting:open("r") - local t=userSetting:read() + local F=FILE.setting + F:open("r") + local t=F:read() t=splitS(t,"\r\n") - userSetting:close() + F:close() for i=1,#t do local p=find(t[i],"=") if p then @@ -410,14 +530,6 @@ function loadSetting() setting[t]=toN(v:match("[123]"))or 1 elseif t=="skin"then setting[t]=toN(v:match("[12345678]"))or 1 - elseif t=="modesel"then - local t=toN(v) - if not(t or modes[modeID[t]])then - t=1 - end - modeSel=t - elseif t=="levelsel"then - levelSel=toN(v) elseif t=="keymap"then v=splitS(v,"/") for i=1,16 do @@ -440,9 +552,6 @@ function loadSetting() end end end - if not modes[modeID[modeSel]].level[levelSel]then - levelSel=1 - end end local saveOpt={ "das","arr", @@ -492,8 +601,6 @@ function saveSetting() map[i]=concat(setting.keyMap[i],",") end local t={ - "modesel="..modeSel, - "levelsel="..levelSel, "keymap="..toS(concat(map,"/")), "VK="..toS(concat(vk,"/")), } @@ -501,8 +608,14 @@ function saveSetting() t[#t+1]=saveOpt[i].."="..toS(setting[saveOpt[i]]) end t=concat(t,"\r\n") - userSetting:open("w") - userSetting:write(t) - userSetting:flush(t) - userSetting:close() + local F=FILE.setting + F:open("w") + local _,mes=F:write(t) + F:flush() + F:close() + if _ then + TEXT(text.settingSaved,640,360,80,"appear") + else + TEXT(text.settingSavingError..mes,640,360,40,"appear",.4) + end end \ No newline at end of file diff --git a/updateLog.lua b/updateLog.lua index 6e2b73a7..01399c11 100644 --- a/updateLog.lua +++ b/updateLog.lua @@ -1,3 +1,6 @@ +--[[ +big bang未完成 +]] local S=[=[ Patron(rmb10+): Fireboos @@ -9,13 +12,18 @@ Patron(rmb10+): ?[D*a] Future outlook: New mode system with: - ultra mode rythem mode combo mode bigbang mode - TTT mode - Normal: - powerinfo switch + puzzle mode(ttt) + square mode + finesse practice mode + infinite 1v1 + Other: + puzzle import/output(ttt) + classic face direction + (powerinfo switch) + virtualWidgets like joysticks splashing block ajustable next count custom block color/direction @@ -23,14 +31,19 @@ Future outlook: CC smarter(think of garbage buffer) game recording new AI:task-Z - auto GUI in any screen size - Hard: - Encrypt source code(compile to byte code) - infinite 1v1 - square mode + auto GUI position in any screen size more FXs & 3d features & animations -0.8.4: + Encrypt source code(compile to byte code) +0.8.6: + mode map!Brandly new GUI for mode selecting + mode unlock system,not that scary for noob + every mode has rank calculating method(may some mistakes/inappropriate number) + save 10 best recoreds for each mode + can save/share custom map now + new mode:Big Bang better widget performence + many bug fixed +0.8.4: vocal more natural(important,may cause new bug) a bit better performence on mobile devices fatal bug fixed @@ -136,9 +149,9 @@ Future outlook: can set BG/BGM in custom mode bug fixed 0.7.19: - Secret option! + secret option! macOS version! - add C4W train mode + new mode:C4W train rendering of royale mode optimized again add "free cell" in draw mode add 2 new block skins diff --git a/widgetList.lua b/widgetList.lua new file mode 100644 index 00000000..07fb04ae --- /dev/null +++ b/widgetList.lua @@ -0,0 +1,395 @@ +local mobile=system=="Android"or system=="iOS" +local langName={"中文","全中文","English"} +local virtualkeySet={ + { + {1, 80, 720-200, 80},--moveLeft + {2, 320, 720-200, 80},--moveRight + {3, 1280-80, 720-200, 80},--rotRight + {4, 1280-200, 720-80, 80},--rotLeft + {5, 1280-200, 720-320, 80},--rotFlip + {6, 200, 720-320, 80},--hardDrop + {7, 200, 720-80, 80},--softDrop + {8, 1280-320, 720-200, 80},--hold + {9, 1280-80, 280, 80},--func + {10,80, 280, 80},--restart + },--Farter's set,thanks + { + {1, 1280-320, 720-200, 80},--moveLeft + {2, 1280-80, 720-200, 80},--moveRight + {3, 200, 720-80, 80},--rotRight + {4, 80, 720-200, 80},--rotLeft + {5, 200, 720-320, 80},--rotFlip + {6, 1280-200, 720-320, 80},--hardDrop + {7, 1280-200, 720-80, 80},--softDrop + {8, 320, 720-200, 80},--hold + {9, 80, 280, 80},--func + {10,1280-80, 280, 80},--restart + },--Mirrored farter's set,sknaht + { + {1, 80, 720-80, 80},--moveLeft + {2, 240, 720-80, 80},--moveRight + {3, 1280-240, 720-80, 80},--rotRight + {4, 1280-400, 720-80, 80},--rotLeft + {5, 1280-240, 720-240, 80},--rotFlip + {6, 1280-80, 720-80, 80},--hardDrop + {7, 1280-80, 720-240, 80},--softDrop + {8, 1280-80, 720-400, 80},--hold + {9, 80, 360, 80},--func + {10,80, 80, 80},--restart + },--Author's set,not recommend + { + {1, 1280-400, 720-80, 80},--moveLeft + {2, 1280-80, 720-80, 80},--moveRight + {3, 240, 720-80, 80},--rotRight + {4, 80, 720-80, 80},--rotLeft + {5, 240, 720-240, 80},--rotFlip + {6, 1280-240, 720-240, 80},--hardDrop + {7, 1280-240, 720-80, 80},--softDrop + {8, 1280-80, 720-240, 80},--hold + {9, 80, 720-240, 80},--func + {10,80, 320, 80},--restart + },--Keyboard set + { + {10,70, 50,30},--restart + {9, 130, 50,30},--func + {4, 190, 50,30},--rotLeft + {3, 250, 50,30},--rotRight + {5, 310, 50,30},--rotFlip + {1, 370, 50,30},--moveLeft + {2, 430, 50,30},--moveRight + {8, 490, 50,30},--hold + {7, 550, 50,30},--softDrop1 + {6, 610, 50,30},--hardDrop + {11,670, 50,30},--insLeft + {12,730, 50,30},--insRight + {13,790, 50,30},--insDown + {14,850, 50,30},--down1 + {15,910, 50,30},--down4 + {16,970, 50,30},--down10 + {17,1030, 50,30},--dropLeft + {18,1090, 50,30},--dropRight + {19,1150, 50,30},--addLeft + {20,1210, 50,30},--addRight + },--PC key feedback(top&in a row) +} +local customSet={ + {20,20,1,1,7,1,1,1,3,4,1,2,3}, + {18,20,1,1,7,1,1,1,8,3,8,3,3}, + {22,22,1,1,7,3,1,1,8,4,1,7,7}, + {20,20,1,1,7,1,1,3,8,3,1,7,8}, + {1,11,8,11,4,1,2,1,8,3,1,4,9}, +} +local function useDefaultSet(n) + for i=1,#customSet[n]do + customSel[i]=customSet[n][i] + end + curBG=customRange.bg[customSel[12]] + BGM(customRange.bgm[customSel[13]]) +end + +--λFuncs for widgets +local function SETdisp(k) + return function() + return setting[k] + end +end +local function SETsto(k) + return function(i)setting[k]=i end +end +local function SETrev(k) + return function() + setting[k]=not setting[k] + end +end +local function pressKey(k) + return function() + love.keypressed(k) + end +end +local function setPen(i) + return function() + sceneTemp.pen=i + end +end +local function VKAdisp(n) + return function() + return VK_org[n].ava + end +end +local function VKAcode(n) + return function() + VK_org[n].ava=not VK_org[n].ava + end +end +local C=color +local skinName={ + "Normal(MrZ)", + "Jelly(Miya)", + "Plastic(MrZ)", + "Glow(MrZ)", + "Pure(MrZ)", + "Text Bone(MrZ)", + "Colored Bone(MrZ)", + "white Bone(MrZ)", +} +local Widget={ + load={},intro={},quit={}, + main={ + play= newButton(150,280,200,160,C.lightRed, 55,function()scene.push()scene.swapTo("mode")end, nil,"setting"), + setting=newButton(370,280,200,160,C.lightBlue, 45,function()scene.push()scene.swapTo("setting_game")end, nil,"music"), + music= newButton(590,280,200,160,C.lightPurple, 32,function()scene.push()scene.swapTo("music")end, nil,"help"), + help= newButton(150,460,200,160,C.lightYellow, 50,function()scene.push()scene.swapTo("help")end, nil,"stat"), + stat= newButton(370,460,200,160,C.lightCyan, 43,function()scene.push()scene.swapTo("stat")end, nil,"lang"), + lang= newButton(150,610,160,100,C.lightGreen, 45,function() + setting.lang=setting.lang%#langName+1 + swapLanguage(setting.lang) + TEXT(text.lang,370,610,50,"appear",1.6) + end,nil,"quit"), + quit= newButton(590,460,200,160,C.lightGrey, 55,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"play"), + }, + mode={ + draw= newButton(1100, 440,220,90,C.lightYellow, 40,function()scene.push()scene.swapTo("draw")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end), + setting=newButton(1100, 540,220,90,C.lightGreen, 40,function()scene.push()scene.swapTo("custom")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end), + start= newButton(1100, 640,220,90,C.lightGrey, 40,function()scene.push()loadGame(mapCam.sel)end,function()return not mapCam.sel end), + back= newButton(1205, 50, 130,80, C.white, 40,scene.back), + --function()scene.push()scene.swapTo("custom")end + }, + music={ + bgm= newSlider(760, 80,400,10,35,nil,SETdisp("bgm"),function(i)setting.bgm=i;BGM(bgmPlaying)end), + up= newButton(1100, 200,120,120,C.white,55,pressKey("up")), + play= newButton(1100, 340,120,120,C.white,35,pressKey("space"),function()return setting.bgm==0 end), + down= newButton(1100, 480,120,120,C.white,55,pressKey("down")), + back= newButton(640, 630,230,90, C.white,40,scene.back), + }, + custom={ + up= newButton(1000, 360,100,100,C.white, 45,function()sceneTemp=(sceneTemp-2)%#customID+1 end), + down= newButton(1000, 600,100,100,C.white, 45,function()sceneTemp=sceneTemp%#customID+1 end), + left= newButton(880, 480,100,100,C.white, 45,pressKey("left")), + right= newButton(1120, 480,100,100,C.white, 45,pressKey("right")), + set1= newButton(640, 160,240,75, C.lightYellow, 35,function()useDefaultSet(1)end), + set2= newButton(640, 250,240,75, C.lightYellow, 35,function()useDefaultSet(2)end), + set3= newButton(640, 340,240,75, C.lightYellow, 35,function()useDefaultSet(3)end), + set4= newButton(640, 430,240,75, C.lightYellow, 35,function()useDefaultSet(4)end), + set5= newButton(640, 520,240,75, C.lightYellow, 35,function()useDefaultSet(5)end), + back= newButton(640, 630,180,60, C.white, 35,scene.back), + }, + draw={ + block1= newButton(920, 80, 120,120,C.red, 60,setPen(1)), + block2= newButton(1060, 80, 120,120,C.green, 60,setPen(2)), + block3= newButton(1200, 80, 120,120,C.orange, 60,setPen(3)), + block4= newButton(920, 220,120,120,C.blue, 60,setPen(4)), + block5= newButton(1060, 220,120,120,C.magenta, 60,setPen(5)), + block6= newButton(1200, 220,120,120,C.yellow, 60,setPen(6)), + block7= newButton(920, 360,120,120,C.cyan, 60,setPen(7)), + gb1= newButton(1060, 360,120,120,C.darkGrey, 60,setPen(9)), + gb2= newButton(1200, 360,120,120,C.grey, 60,setPen(10)), + gb3= newButton(920, 500,120,120,C.darkPurple, 60,setPen(11)), + gb4= newButton(1060, 500,120,120,C.darkRed, 60,setPen(12)), + gb5= newButton(1200, 500,120,120,C.darkGreen, 60,setPen(13)), + clear= newButton(780, 80, 120,120,C.white, 40,pressKey("delete")), + any= newButton(780, 220,120,120,C.lightGrey, 40,setPen(0)), + space= newButton(780, 360,120,120,C.grey, 65,setPen(-1)), + demo= newSwitch(755, 640,30,function()return sceneTemp.demo end,function()sceneTemp.demo=not sceneTemp.demo end), + copy= newButton(920, 640,120,120,C.lightRed, 35,copyBoard), + paste= newButton(1060, 640,120,120,C.lightBlue, 35,pasteBoard), + back= newButton(1200, 640,120,120,C.white, 35,scene.back), + }, + play={ + pause= newButton(1235,45,80,80,C.white,25,pauseGame), + }, + pause={ + resume= newButton(640,290,240,100,C.white,45,resumeGame), + restart=newButton(640,445,240,100,C.white,45,function() + clearTask("play") + updateStat() + resetGameData() + scene.swapTo("play","none") + end), + sfx= newSlider(950,60,280,10,35,function()SFX("blip_1")end, SETdisp("sfx"),SETsto("sfx")), + bgm= newSlider(950,120,280,10,35,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"),SETsto("bgm")), + quit= newButton(640,600,240,100,C.white,45,scene.back), + }, + setting_game={ + graphic=newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end,nil,"sound"), + sound= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"dasD"), + dasD= newButton(180,230,50,50,C.white,40,function() + setting.das=(setting.das-1)%31 + if setting.arr>setting.das then + setting.arr=setting.das + Widget.setting_game.arrD:FX() + SFX("blip_1",.4) + end + end,nil,"dasU"), + dasU= newButton(400,230,50,50,C.white,40,function() + setting.das=(setting.das+1)%31 + if setting.arr>setting.das then + setting.das=setting.arr + Widget.setting_game.arrD:FX() + SFX("blip_1",.4) + end + end,nil,"arrD"), + arrD= newButton(500,230,50,50,C.white,40,function() + setting.arr=(setting.arr-1)%16 + if setting.arr>setting.das then + setting.das=setting.arr + Widget.setting_game.dasU:FX() + SFX("blip_1",.4) + end + end,nil,"arrU"), + arrU= newButton(720,230,50,50,C.white,40,function() + setting.arr=(setting.arr+1)%16 + if setting.arr>setting.das then + setting.das=setting.arr + Widget.setting_game.dasU:FX() + SFX("blip_1",.4) + end + end,nil,"sddasD"), + sddasD= newButton(180,340,50,50,C.white,40, function()setting.sddas=(setting.sddas-1)%11 end, nil,"sddasU"), + sddasU= newButton(400,340,50,50,C.white,40, function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"), + sdarrD= newButton(500,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"), + sdarrU= newButton(720,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"), + quickR= newSwitch(580,430,35,SETdisp("quickR"), SETrev("quickR"), nil,"swap"), + swap= newSwitch(580,510,20,SETdisp("swap"), SETrev("swap"), nil,"fine"), + fine= newSwitch(580,590,20,SETdisp("fine"), SETrev("fine"), nil,"ctrl"), + ctrl= newButton(1020,230,320,80,C.white,35,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"), + touch= newButton(1020,340,320,80,C.white,35,function()scene.push()scene.swapTo("setting_touch")end,nil,"back"), + back= newButton(1160,600,160,160,C.white,50,scene.back,nil,"graphic"), + }, + setting_graphic={ + sound= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"game"), + game= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"ghost"), + ghost= newSwitch(310,180,35,SETdisp("ghost"), SETrev("ghost"), nil,"center"), + center= newSwitch(580,180,35,SETdisp("center"), SETrev("center"), nil,"smo"), + smo= newSwitch(310,260,25,SETdisp("smo"), SETrev("smo"), nil,"grid"), + grid= newSwitch(580,260,30,SETdisp("grid"), SETrev("grid"), nil,"dropFX"), + dropFX= newSlider(310,350,373,5,35,nil,SETdisp("dropFX"), SETsto("dropFX"), nil,"shakeFX"), + shakeFX=newSlider(310,430,373,5,35,nil,SETdisp("shakeFX"), SETsto("shakeFX"), nil,"atkFX"), + atkFX= newSlider(310,510,373,5,35,nil,SETdisp("atkFX"), SETsto("atkFX"), nil,"frame"), + frame= newSlider(310,590,373,10,35,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"fullscreen"), + fullscreen=newSwitch(990,180,40,SETdisp("fullscreen"),function() + setting.fullscreen=not setting.fullscreen + love.window.setFullscreen(setting.fullscreen) + if not setting.fullscreen then + love.resize(love.graphics.getWidth(),love.graphics.getHeight()) + end + end,nil,"bg"), + bg= newSwitch(990,250,35,SETdisp("bg"),SETrev("bg"),nil,"bgblock"), + bgblock=newSwitch(990,330,35,SETdisp("bgblock"),SETrev("bgblock"),nil,"skin"),--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end + skin= newButton(810,420,120,60,C.white,35,function() + local _=setting.skin%8+1 + setting.skin=_ + changeBlockSkin(_) + TEXT(skinName[_],850,475,28,"appear") + end,nil,"back"), + back= newButton(1160,600,160,160,C.white,50,scene.back,nil,"sound"), + }, + setting_sound={ + game= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_game")end, nil,"graphic"), + graphic=newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end, nil,"sfx"), + sfx= newSlider(180,250,400,10,35,function()SFX("blip_1")end, SETdisp("sfx"), SETsto("sfx"), nil,"bgm"), + bgm= newSlider(750,250,400,10,35,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"), SETsto("bgm"), nil,"vib"), + vib= newSlider(180,440,400,5 ,35,function()VIB(1)end, SETdisp("vib"), SETsto("vib"), nil,"voc"), + voc= newSlider(750,440,400,10,35,function()VOICE("nya")end, SETdisp("voc"), SETsto("voc"), nil,"stereo"), + stereo= newSlider(180,630,400,10,35,function()SFX("move",1,-1)SFX("lock",1,1)end, SETdisp("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"back"), + back=newButton(1160,600,160,160,C.white,50,scene.back,nil,"game"), + }, + setting_key={ + back=newButton(1140,650,200,80,C.white,45,scene.back), + }, + setting_touch={ + default=newButton(520,80,170,80,C.white,35,function() + local D=virtualkeySet[sceneTemp.default] + for i=1,#VK_org do + VK_org[i].ava=false + end + for n=1,#D do + local T=D[n] + if T[1]then + local B=VK_org[n] + B.ava=true + B.x,B.y,B.r=T[2],T[3],T[4] + end + end--Replace keys + sceneTemp.default=sceneTemp.default%5+1 + sceneTemp.sel=nil + end), + snap= newButton(760,80,170,80,C.white,35,function() + sceneTemp.snap=sceneTemp.snap%6+1 + end), + option= newButton(520,180,170,80,C.white,40,function() + scene.push() + scene.swapTo("setting_touchSwitch") + end), + back= newButton(760,180,170,80,C.white,40,scene.back), + size= newSlider(450,265,460,14,40,nil,function() + return VK_org[sceneTemp.sel].r/10-1 + end, + function(v) + if sceneTemp.sel then + VK_org[sceneTemp.sel].r=10+v*10 + end + end, + function()return not sceneTemp.sel end), + }, + setting_touchSwitch={ + b1= newSwitch(280,80, 35,VKAdisp(1),VKAcode(1)), + b2= newSwitch(280,140, 35,VKAdisp(2),VKAcode(2)), + b3= newSwitch(280,200, 35,VKAdisp(3),VKAcode(3)), + b4= newSwitch(280,260, 35,VKAdisp(4),VKAcode(4)), + b5= newSwitch(280,320, 35,VKAdisp(5),VKAcode(5)), + b6= newSwitch(280,380, 35,VKAdisp(6),VKAcode(6)), + b7= newSwitch(280,440, 35,VKAdisp(7),VKAcode(7)), + b8= newSwitch(280,500, 35,VKAdisp(8),VKAcode(8)), + b9= newSwitch(280,560, 35,VKAdisp(9),VKAcode(9)), + b10= newSwitch(280,620, 35,VKAdisp(10),VKAcode(10)), + b11= newSwitch(620,80, 35,VKAdisp(11),VKAcode(11)), + b12= newSwitch(620,140, 35,VKAdisp(12),VKAcode(12)), + b13= newSwitch(620,200, 35,VKAdisp(13),VKAcode(13)), + b14= newSwitch(620,260, 35,VKAdisp(14),VKAcode(14)), + b15= newSwitch(620,320, 35,VKAdisp(15),VKAcode(15)), + b16= newSwitch(620,380, 35,VKAdisp(16),VKAcode(16)), + b17= newSwitch(620,440, 35,VKAdisp(17),VKAcode(17)), + b18= newSwitch(620,500, 35,VKAdisp(18),VKAcode(18)), + b19= newSwitch(620,560, 35,VKAdisp(19),VKAcode(19)), + b20= newSwitch(620,620, 35,VKAdisp(20),VKAcode(20)), + norm= newButton(840,100,240,80,C.white,45,function()for i=1,20 do VK_org[i].ava=i<11 end end), + pro= newButton(1120,100,240,80,C.white,35,function()for i=1,20 do VK_org[i].ava=true end end), + hide= newSwitch(1170,200,40,SETdisp("VKSwitch"),SETrev("VKSwitch")), + track= newSwitch(1170,300,35,SETdisp("VKTrack"),SETrev("VKTrack")), + icon= newSwitch(850,300,40,SETdisp("VKIcon"),SETrev("VKIcon")), + tkset= newButton(1120,400,240,80,C.white,32,function() + scene.push() + scene.swapTo("setting_trackSetting") + end,function()return not setting.VKTrack end), + alpha= newSlider(840,490,400,10,40,nil,SETdisp("VKAlpha"),SETsto("VKAlpha")), + back= newButton(1100,600,240,80,C.white,45,scene.back), + }, + setting_trackSetting={ + VKDodge=newSwitch(400,200, 35,SETdisp("VKDodge"),SETrev("VKDodge")), + VKTchW= newSlider(140,310,1000,10,35,nil,SETdisp("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end), + VKCurW= newSlider(140,370,1000,10,35,nil,SETdisp("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end), + back= newButton(1080,600,240,80,C.white,45,scene.back), + }, + help={ + his= newButton(1050,520,230,60,C.white,35,function()scene.push()scene.swapTo("history")end,nil,"back"), + qq= newButton(1050,600,230,60,C.white,35,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end, function()return mobile end,"his"), + back= newButton(640, 600,180,60,C.white,35,scene.back,nil,"qq"), + }, + history={ + prev= newButton(1155,170,180,180,C.white,65,pressKey("up"),function()return sceneTemp[2]==1 end), + next= newButton(1155,400,180,180,C.white,65,pressKey("down"),function()return sceneTemp[2]==#sceneTemp[1]-22 end), + back= newButton(1155,600,180,90,C.white,35,scene.back), + }, + stat={ + path= newButton(980,620,250,60,C.white,25,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"), + back= newButton(640,620,180,60,C.white,35,scene.back,nil,"path"), + }, +} +for _,L in next,Widget do + for _,W in next,L do + if W.next then + W.next,L[W.next].prev=L[W.next],W + end + end +end +return Widget \ No newline at end of file