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 548c29b commit a3e39a1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
3 changes: 0 additions & 3 deletions assets/game/mode/brik/interior/tutorial/5.finessePractice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ return {
P.modeData.targetPreview={}
for i=1,3 do pushFinesseTarget(P,i) end

PROGRESS.setInteriorScore('tuto5_score',0)
PROGRESS.setInteriorScore('tuto5_time',2600e3,'<')

if PROGRESS.getInteriorScore('tuto5_score')<99 then
P.modeData.display=PROGRESS.getInteriorScore('tuto5_score').."/99"
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ return {
P.modeData.protect=false
P.modeData.display=false
P.modeData.techrashTimer=0
PROGRESS.setInteriorScore('tuto7_score',0)
PROGRESS.setInteriorScore('tuto7_time',2600e3,'<')
end,
always=function(P)
if P.modeData.techrashTimer>0 then
Expand Down
4 changes: 1 addition & 3 deletions assets/game/mode/brik/interior/tutorial/8.finessePlus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ return {
readyDelay=1,
spawnDelay=62,
dropDelay=2600,
lockDelay=2600,
lockDelay=1e99,
soundEvent={
countDown=NULL,
drop=gameSoundFunc.drop_old,
Expand All @@ -30,8 +30,6 @@ return {
playerInit=function(P)
P.modeData.target.line=20
P.modeData.keyCount=0

PROGRESS.setInteriorScore('tuto8_keys',2600,'<')
P.modeData.display=PROGRESS.getInteriorScore('tuto8_keys')
end,
beforePress=function(P,act)
Expand Down
31 changes: 18 additions & 13 deletions assets/progress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ local prgs=setmetatable({
marathon=0,
tutorial='1000', -- 0:Not Unlocked 1: Not Finished, 2: Passed, 3: Perfect Passed (unlock B side)
tuto5_score=0,
tuto5_time=2600e3,
tuto6_score=0,
tuto6_time=2600e3,
tuto7_score=0,
tuto8_keys=0,
tuto5_time=false,
tuto6_time=false,
tuto7_time=false,
tuto7_time=2600e3,
tuto8_keys=260,
},
styles={
brik=true,
Expand Down Expand Up @@ -151,17 +151,22 @@ function PROGRESS.load()
end
end
function PROGRESS.fix()
prgs.brik_stdMap=nil
if type(prgs.interiorScore.tutorial)=='table' then
prgs.interiorScore.tutorial='1000'
prgs.tuto5_score=0
prgs.tuto6_score=0
prgs.tuto7_score=0
prgs.tuto8_keys=0
prgs.tuto5_time=false
prgs.tuto6_time=false
prgs.tuto7_time=false
prgs.interiorScore.tuto5_score=0
prgs.interiorScore.tuto5_time=false
prgs.interiorScore.tuto6_score=0
prgs.interiorScore.tuto6_time=false
prgs.interiorScore.tuto7_score=0
prgs.interiorScore.tuto7_time=false
prgs.interiorScore.tuto8_keys=260
end
prgs.tutorial=nil
prgs.tuto5_score,prgs.tuto5_time=nil,nil
prgs.tuto6_score,prgs.tuto6_time=nil,nil
prgs.tuto7_score,prgs.tuto7_time=nil,nil
prgs.tuto8_keys=nil
prgs.brik_stdMap=nil
end

--------------------------------------------------------------
Expand Down Expand Up @@ -497,7 +502,7 @@ 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,200)
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 a3e39a1

Please sign in to comment.