Skip to content

Commit

Permalink
修interior三个模式没能正确算分,优化分数计算公式格式
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Sep 27, 2024
1 parent 735fcbc commit 548c29b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
9 changes: 2 additions & 7 deletions assets/game/mode/brik/interior/dig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@ return {
}},
result=function()
local P=GAME.mainPlayer
if P and P.finished=='AC' then
PROGRESS.setInteriorScore('dig',
P.gameTime<=30e3 and 160 or
P.gameTime<=60e3 and MATH.interpolate(60e3,120,30e3,160,P.gameTime) or
P.gameTime<=120e3 and MATH.interpolate(120e3,90,60e3,120,P.gameTime) or
math.max(MATH.interpolate(200e3,40,120e3,90,P.gameTime),0)
)
if P and P.finished=='win' then
PROGRESS.setInteriorScore('dig',MATH.lLerp({160,120,90,40,0},MATH.ilLerp({30e3,60e3,120e3,200e3,260e3},P.gameTime)))
end
end,
resultPage=function(time)
Expand Down
8 changes: 1 addition & 7 deletions assets/game/mode/brik/interior/marathon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,7 @@ return {
local P=GAME.mainPlayer
if not P then return end
PROGRESS.setInteriorScore('sprint',math.min(P.stat.line*4/3,40))
PROGRESS.setInteriorScore('marathon',
P.stat.line>=200 and 160 or
P.stat.line>=130 and MATH.interpolate(130,120,200,160,P.stat.line) or
P.stat.line>=80 and MATH.interpolate(80,90,130,120,P.stat.line) or
P.stat.line>=40 and MATH.interpolate(40,40,80,90,P.stat.line) or
MATH.interpolate(0,0,40,40,P.stat.line)
)
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
10 changes: 2 additions & 8 deletions assets/game/mode/brik/interior/sprint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,10 @@ return {
result=function()
local P=GAME.mainPlayer
if not P then return end
if P.finished=='AC' then
if P.finished=='win' then
P.stat.line=40
PROGRESS.setInteriorScore('marathon',30)
PROGRESS.setInteriorScore('sprint',
P.gameTime<60e3 and 200 or
P.gameTime<90e3 and MATH.interpolate(90e3,140,60e3,200,P.gameTime) or
P.gameTime<180e3 and MATH.interpolate(180e3,90,90e3,140,P.gameTime) or
P.gameTime<300e3 and MATH.interpolate(300e3,40,180e3,90,P.gameTime) or
40
)
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)
Expand Down

0 comments on commit 548c29b

Please sign in to comment.