Skip to content

Commit

Permalink
exterior的sprint可以解锁tspin和hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Jun 23, 2024
1 parent 28d8437 commit 786dd1a
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 64 deletions.
4 changes: 2 additions & 2 deletions assets/game/mode/brik/exterior/dig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion assets/game/mode/brik/exterior/drill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -61,6 +61,7 @@ return {
then
PROGRESS.setStyleUnlock('acry')
PROGRESS.setExteriorUnlock('action')
return true
end
end,
},
Expand Down
1 change: 1 addition & 0 deletions assets/game/mode/brik/exterior/excavate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
143 changes: 82 additions & 61 deletions assets/game/mode/brik/exterior/sprint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ return {
end,
settings={brik={
-- clearRule='float',
spin_immobile=true,
spin_corners=3,
seqType='bag7_sprint',
event={
playerInit=function(P)
Expand All @@ -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}
Expand All @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 786dd1a

Please sign in to comment.