From 788d26f9ecd4616a689bc0c7b2fbeb065dd703b9 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 24 Aug 2024 11:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0sprint=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=9B=9B=E4=B8=AA=E6=8C=A1=E4=BD=8D=E7=9A=84=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/game/init.lua | 2 +- assets/game/mode/brik/exterior/sprint.lua | 41 +++++++++++++---------- 2 files changed, 25 insertions(+), 18 deletions(-) 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)