diff --git a/assets/game/init.lua b/assets/game/init.lua index fe1deec7..9e179481 100644 --- a/assets/game/init.lua +++ b/assets/game/init.lua @@ -273,7 +273,7 @@ end ---@param id integer ---@param pType 'brik'|'gela'|'acry' ----@param remote boolean +---@param remote? boolean function GAME.newPlayer(id,pType,remote) if not (type(id)=='number' and math.floor(id)==id and id>=1 and id<=1000) then MSG.new('error',"player id must be 1~1000 integer") diff --git a/assets/game/mode/brik/exterior/sprint.lua b/assets/game/mode/brik/exterior/sprint.lua index 8e4e35cb..5cae140d 100644 --- a/assets/game/mode/brik/exterior/sprint.lua +++ b/assets/game/mode/brik/exterior/sprint.lua @@ -95,30 +95,38 @@ return { end if not lClearBound then break end - local rClearBound + local rClearBounds={} + local currentCheck=1 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 + if count>=recordedLines[currentCheck]*10 then + rClearBounds[currentCheck]=j + currentCheck=currentCheck+1 + if currentCheck>4 then + break + end 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 + for j=1,4 do + if rClearBounds[j] then + local drop=P.dropHistory[dropCheckPos-1] + local time=CLEAR[rClearBounds[j]][0]-(drop and drop.time or 0) + PROGRESS.setExteriorScore('sprint',recordedLinesStr[j],time,'<') + -- print(("Time=%.2f"):format(time/1000)) + -- print(dropCheckPos,lClearBound,rClearBound) + if j==4 then + dropCheckPos=dropCheckPos+1 + P.modeData.infSprint_dropCheckPos=dropCheckPos + end + else + return + -- TODO: calculate approximate time + end end end end, @@ -188,8 +196,7 @@ return { gc.print('.'..time%1000,-367+getFont(45):getWidth(int),y+20) else setFont(40) - -- gc.print('———',-370,y) - gc.print('',-370,y) + gc.print('———',-370,y) end setFont(20,'bold') gc.print(recordedLinesName[i],-370,y+45)