Skip to content

Commit 548c29b

Browse files
committed
修interior三个模式没能正确算分,优化分数计算公式格式
1 parent 735fcbc commit 548c29b

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

assets/game/mode/brik/interior/dig.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@ return {
2929
}},
3030
result=function()
3131
local P=GAME.mainPlayer
32-
if P and P.finished=='AC' then
33-
PROGRESS.setInteriorScore('dig',
34-
P.gameTime<=30e3 and 160 or
35-
P.gameTime<=60e3 and MATH.interpolate(60e3,120,30e3,160,P.gameTime) or
36-
P.gameTime<=120e3 and MATH.interpolate(120e3,90,60e3,120,P.gameTime) or
37-
math.max(MATH.interpolate(200e3,40,120e3,90,P.gameTime),0)
38-
)
32+
if P and P.finished=='win' then
33+
PROGRESS.setInteriorScore('dig',MATH.lLerp({160,120,90,40,0},MATH.ilLerp({30e3,60e3,120e3,200e3,260e3},P.gameTime)))
3934
end
4035
end,
4136
resultPage=function(time)

assets/game/mode/brik/interior/marathon.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,7 @@ return {
5858
local P=GAME.mainPlayer
5959
if not P then return end
6060
PROGRESS.setInteriorScore('sprint',math.min(P.stat.line*4/3,40))
61-
PROGRESS.setInteriorScore('marathon',
62-
P.stat.line>=200 and 160 or
63-
P.stat.line>=130 and MATH.interpolate(130,120,200,160,P.stat.line) or
64-
P.stat.line>=80 and MATH.interpolate(80,90,130,120,P.stat.line) or
65-
P.stat.line>=40 and MATH.interpolate(40,40,80,90,P.stat.line) or
66-
MATH.interpolate(0,0,40,40,P.stat.line)
67-
)
61+
MATH.lLerp({0,40,90,120,160},MATH.ilLerp({0,40,80,130,200},P.stat.line))
6862
end,
6963
resultPage=function(time)
7064
local P=GAME.mainPlayer

assets/game/mode/brik/interior/sprint.lua

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,10 @@ return {
2828
result=function()
2929
local P=GAME.mainPlayer
3030
if not P then return end
31-
if P.finished=='AC' then
31+
if P.finished=='win' then
3232
P.stat.line=40
3333
PROGRESS.setInteriorScore('marathon',30)
34-
PROGRESS.setInteriorScore('sprint',
35-
P.gameTime<60e3 and 200 or
36-
P.gameTime<90e3 and MATH.interpolate(90e3,140,60e3,200,P.gameTime) or
37-
P.gameTime<180e3 and MATH.interpolate(180e3,90,90e3,140,P.gameTime) or
38-
P.gameTime<300e3 and MATH.interpolate(300e3,40,180e3,90,P.gameTime) or
39-
40
40-
)
34+
PROGRESS.setInteriorScore('sprint',MATH.lLerp({200,140,90,40},MATH.ilLerp({60e3,90e3,180e3,300e3},P.gameTime)))
4135
else
4236
PROGRESS.setInteriorScore('marathon',P.stat.line*0.75)
4337
PROGRESS.setInteriorScore('sprint',P.stat.line)

0 commit comments

Comments
 (0)