From 786dd1ae731d98f3abe58b14cc94108d148a934a Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Mon, 24 Jun 2024 02:59:51 +0800 Subject: [PATCH] =?UTF-8?q?exterior=E7=9A=84sprint=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=A7=A3=E9=94=81tspin=E5=92=8Chidden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/game/mode/brik/exterior/dig.lua | 4 +- assets/game/mode/brik/exterior/drill.lua | 3 +- assets/game/mode/brik/exterior/excavate.lua | 1 + assets/game/mode/brik/exterior/sprint.lua | 143 +++++++++++--------- 4 files changed, 87 insertions(+), 64 deletions(-) diff --git a/assets/game/mode/brik/exterior/dig.lua b/assets/game/mode/brik/exterior/dig.lua index c6626559..a65d5624 100644 --- a/assets/game/mode/brik/exterior/dig.lua +++ b/assets/game/mode/brik/exterior/dig.lua @@ -48,7 +48,7 @@ return { 0.2/PROGRESS.getExteriorModeState('dig').spl40+ 0.3/PROGRESS.getExteriorModeState('dig').spl100 >=0.26 -- lps, ≈3.85 spl - then PROGRESS.setExteriorUnlock('excavate') end + then PROGRESS.setExteriorUnlock('excavate') return true end end, function() if PROGRESS.getExteriorModeState('drill') then return true end @@ -58,7 +58,7 @@ return { 0.2/PROGRESS.getExteriorModeState('dig').ppl40+ 0.3/PROGRESS.getExteriorModeState('dig').ppl100 >=0.42 -- lpp, ≈2.38 ppl - then PROGRESS.setExteriorUnlock('drill') end + then PROGRESS.setExteriorUnlock('drill') return true end end, }, afterClear=mechLib.brik.dig.event_afterClear, diff --git a/assets/game/mode/brik/exterior/drill.lua b/assets/game/mode/brik/exterior/drill.lua index 20c2c068..49b0d35e 100644 --- a/assets/game/mode/brik/exterior/drill.lua +++ b/assets/game/mode/brik/exterior/drill.lua @@ -48,7 +48,7 @@ return { 0.2/PROGRESS.getExteriorModeState('drill').spl40+ 0.4/PROGRESS.getExteriorModeState('drill').spl100 >=0.355 -- lps, ≈2.82 spl - then PROGRESS.setExteriorUnlock('survivor') end + then PROGRESS.setExteriorUnlock('survivor') return true end end, function() if PROGRESS.getStyleUnlock('acry') then return true end @@ -61,6 +61,7 @@ return { then PROGRESS.setStyleUnlock('acry') PROGRESS.setExteriorUnlock('action') + return true end end, }, diff --git a/assets/game/mode/brik/exterior/excavate.lua b/assets/game/mode/brik/exterior/excavate.lua index f018608a..a2188d8d 100644 --- a/assets/game/mode/brik/exterior/excavate.lua +++ b/assets/game/mode/brik/exterior/excavate.lua @@ -86,6 +86,7 @@ return { (PROGRESS.getExteriorModeState('dig').checker or 1e99)<=60e3+5e3*playCount then PROGRESS.setExteriorUnlock('backfire') + return true end PROGRESS.setExteriorScore('dig','playCount',playCount+1) diff --git a/assets/game/mode/brik/exterior/sprint.lua b/assets/game/mode/brik/exterior/sprint.lua index e4dbafe7..0a90172c 100644 --- a/assets/game/mode/brik/exterior/sprint.lua +++ b/assets/game/mode/brik/exterior/sprint.lua @@ -7,6 +7,8 @@ return { end, settings={brik={ -- clearRule='float', + spin_immobile=true, + spin_corners=3, seqType='bag7_sprint', event={ playerInit=function(P) @@ -18,6 +20,10 @@ return { if not PROGRESS.getExteriorModeState('combo') then P.settings.combo_sound=true end + if PROGRESS.getExteriorModeState('tspin') then + P.settings.spin_immobile=false + P.settings.spin_corners=false + end end, gameStart=function(P) local set={S=0,Z=0,O=0} @@ -33,71 +39,83 @@ return { table.insert(P.modeData.keyCount,P.modeData.curKeyCount) P.modeData.curKeyCount=0 end, - beforeClear=function(P,lines) -- Infinite Sprint Core - local CLEAR=P.modeData.infSprint_clears - ---@type Techmino.Cell[][] - local mat=P.field._matrix - for i=1,#lines do - local l={[0]=P.time} - for x=1,P.settings.fieldW do - local c=mat[lines[i]][x] - l[c.did]=(l[c.did] or 0)+1 - end - table.insert(CLEAR,l) + afterPress=function(P) + if PROGRESS.getExteriorModeState('tspin') then return true end + local move=P.lastMovement + if move and (move.immobile or move.corners) then + PROGRESS.setExteriorUnlock('tspin') + P.settings.spin_immobile=false + P.settings.spin_corners=false + return true end + end, + beforeClear={ + function(P,lines) -- Infinite Sprint Core + local CLEAR=P.modeData.infSprint_clears + ---@type Techmino.Cell[][] + local mat=P.field._matrix + for i=1,#lines do + local l={[0]=P.time} + for x=1,P.settings.fieldW do + local c=mat[lines[i]][x] + l[c.did]=(l[c.did] or 0)+1 + end + table.insert(CLEAR,l) + end - local dropCheckPos=P.modeData.infSprint_dropCheckPos - while true do - local lClearBound - local i=1 - while i<=#CLEAR do - if CLEAR[i][dropCheckPos] then - lClearBound=i - break - else - local keep - for id in next,CLEAR[i] do - if id>=dropCheckPos then - keep=true - break - end - end - if keep then - i=i+1 + local dropCheckPos=P.modeData.infSprint_dropCheckPos + while true do + local lClearBound + local i=1 + while i<=#CLEAR do + if CLEAR[i][dropCheckPos] then + lClearBound=i + break else - table.remove(CLEAR,i) + local keep + for id in next,CLEAR[i] do + if id>=dropCheckPos then + keep=true + break + end + end + if keep then + i=i+1 + else + table.remove(CLEAR,i) + end end end - end - if not lClearBound then break end + if not lClearBound then break end - local rClearBound - local count=0 - for j=lClearBound,#CLEAR do - for id,num in next,CLEAR[j] do - if id>=dropCheckPos then - count=count+num - if count>=400 then - rClearBound=j - break + local rClearBound + local count=0 + for j=lClearBound,#CLEAR do + for id,num in next,CLEAR[j] do + if id>=dropCheckPos then + count=count+num + if count>=400 then + rClearBound=j + break + end end end end + if rClearBound then + local drop=P.dropHistory[dropCheckPos-1] + local time=CLEAR[rClearBound][0]-(drop and drop.time or 0) + PROGRESS.setExteriorScore('sprint','line40',time,'<') + -- print(("Time=%.2f"):format(time/1000)) + -- print(dropCheckPos,lClearBound,rClearBound) + dropCheckPos=dropCheckPos+1 + P.modeData.infSprint_dropCheckPos=dropCheckPos + else + break + -- TODO: calculate approximate time + end end - if rClearBound then - local drop=P.dropHistory[dropCheckPos-1] - local time=CLEAR[rClearBound][0]-(drop and drop.time or 0) - PROGRESS.setExteriorScore('sprint','line40',time,'<') - -- print(("Time=%.2f"):format(time/1000)) - -- print(dropCheckPos,lClearBound,rClearBound) - dropCheckPos=dropCheckPos+1 - P.modeData.infSprint_dropCheckPos=dropCheckPos - else - break - -- TODO: calculate approximate time - end - end - end, + end, + }, afterClear={ -- mechLib.brik.misc.cascade_event_afterClear, function(P) @@ -121,13 +139,16 @@ return { return true end end, + function(P) + if PROGRESS.getExteriorMapState('hidden') then return true end + if P.stat.line>=40 then + if P.stat.clears[1]+P.stat.clears[2]+P.stat.clears[3]==0 then + PROGRESS.setExteriorUnlock('hidden') + end + return true + end + end, }, - gameOver=function(P,reason) - if reason=='AC' and P.stat.clears[1]+P.stat.clears[2]+P.stat.clears[3]==0 then - PROGRESS.setExteriorUnlock('hidden') - return true - end - end, drawInField=mechLib.brik.misc.lineClear_event_drawInField, -- drawOnPlayer=mechLib.brik.misc.lineClear_event_drawOnPlayer, -- whenSuffocate=mechLib.brik.misc.suffocateLock_event_whenSuffocate,