Skip to content

Commit

Permalink
修interior计分相关
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Sep 28, 2024
1 parent b74c147 commit 7e90211
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions assets/game/mode/brik/interior/marathon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ return {
result=function()
local P=GAME.mainPlayer
if not P then return end
PROGRESS.setInteriorScore('sprint',math.min(P.stat.line*4/3,40))
MATH.lLerp({0,40,90,120,160},MATH.ilLerp({0,40,80,130,200},P.stat.line))
PROGRESS.setInteriorScore('sprint',MATH.clamp(P.stat.line*4/3,0,40))
PROGRESS.setInteriorScore('marathon',MATH.lLerp({0,40,90,120,160},MATH.ilLerp({0,40,80,130,200},P.stat.line)))
end,
resultPage=function(time)
local P=GAME.mainPlayer
Expand Down
4 changes: 2 additions & 2 deletions assets/game/mode/brik/interior/sprint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ return {
PROGRESS.setInteriorScore('marathon',30)
PROGRESS.setInteriorScore('sprint',MATH.lLerp({200,140,90,40},MATH.ilLerp({60e3,90e3,180e3,300e3},P.gameTime)))
else
PROGRESS.setInteriorScore('marathon',P.stat.line*0.75)
PROGRESS.setInteriorScore('sprint',P.stat.line)
PROGRESS.setInteriorScore('marathon',MATH.clamp(P.stat.line*0.75,0,200))
PROGRESS.setInteriorScore('sprint',MATH.clamp(P.stat.line,0,200))
end
end,
resultPage=function(time)
Expand Down
1 change: 0 additions & 1 deletion assets/progress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ end
---@param sign? '<'|'>' #default to `'>'` bigger=better, `'<'` smaller=better
function PROGRESS.setInteriorScore(mode,score,sign)
sign=sign or '>'
score=MATH.clamp(math.floor(score),0,260)
if not prgs.interiorScore[mode] or sign=='>' and score>prgs.interiorScore[mode] or sign=='<' and score<prgs.interiorScore[mode] then
prgs.interiorScore[mode]=score
PROGRESS.save()
Expand Down

0 comments on commit 7e90211

Please sign in to comment.