Skip to content

Commit

Permalink
教程关添加锁定状态,1234需要按顺序完成(有跳过条件)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Sep 27, 2024
1 parent 72dacf9 commit 7df6a46
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 24 deletions.
5 changes: 3 additions & 2 deletions assets/game/mode/brik/interior/tutorial/1.basic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,11 @@ return {
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}
if P.modeData.allFinesse then
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='flicker',c=COLOR.Y,y=-30}
PROGRESS.setTutorialPassed(1,2)
PROGRESS.setTutorialPassed(1,3)
else
PROGRESS.setTutorialPassed(1,1)
PROGRESS.setTutorialPassed(1,2)
end
PROGRESS.setTutorialPassed(2,1)
P:finish('win')
end},
},
Expand Down
5 changes: 3 additions & 2 deletions assets/game/mode/brik/interior/tutorial/2.sequence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ return {
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}
if P.modeData.extra then
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='flicker',c=COLOR.Y,y=-30}
PROGRESS.setTutorialPassed(2,2)
PROGRESS.setTutorialPassed(2,3)
else
PROGRESS.setTutorialPassed(2,1)
PROGRESS.setTutorialPassed(2,2)
end
PROGRESS.setTutorialPassed(3,1)
P:finish('win')
end},
},
Expand Down
5 changes: 3 additions & 2 deletions assets/game/mode/brik/interior/tutorial/3.stackBasic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ return {
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}
if not normalClear then
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='flicker',c=COLOR.Y,y=-30}
PROGRESS.setTutorialPassed(3,2)
PROGRESS.setTutorialPassed(3,3)
else
PROGRESS.setTutorialPassed(3,1)
PROGRESS.setTutorialPassed(3,2)
end
PROGRESS.setTutorialPassed(4,1)
else
local unstabality=0

Expand Down
4 changes: 2 additions & 2 deletions assets/game/mode/brik/interior/tutorial/4.finesseBasic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ return {
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}
if P.modeData.keySaved>12.6 then
P:say{duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='flicker',c=COLOR.Y,y=-30}
PROGRESS.setTutorialPassed(4,2)
PROGRESS.setTutorialPassed(4,3)
elseif P.modeData.keySaved>6.26 then
P:say{duration='1.26s',text=P.modeData.keySaved.."/12",k=2,size=30,type='bold',style='fly',c=COLOR.lY,y=60}
else
PROGRESS.setTutorialPassed(4,1)
PROGRESS.setTutorialPassed(4,2)
end
P:finish('win')
end},
Expand Down
12 changes: 5 additions & 7 deletions assets/progress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local prgs=setmetatable({
dig=0,
sprint=0,
marathon=0,
tutorial='0000', -- 0: Not Finished, 1: Passed, 2: Perfect Passed (unlock B side)
tutorial='1000', -- 0:Not Unlocked 1: Not Finished, 2: Passed, 3: Perfect Passed (unlock B side)
tuto5_score=0,
tuto6_score=0,
tuto7_score=0,
Expand Down Expand Up @@ -153,7 +153,7 @@ end
function PROGRESS.fix()
prgs.brik_stdMap=nil
if type(prgs.interiorScore.tutorial)=='table' then
prgs.interiorScore.tutorial='0000'
prgs.interiorScore.tutorial='1000'
prgs.tuto5_score=0
prgs.tuto6_score=0
prgs.tuto7_score=0
Expand Down Expand Up @@ -415,7 +415,7 @@ function PROGRESS.getTutorialPassed(n)
if n then
return tonumber(prgs.interiorScore.tutorial:sub(n,n))
else
return not prgs.interiorScore.tutorial:find('0')
return not prgs.interiorScore.tutorial:find('[01]')
end
end
function PROGRESS.getInteriorScore(mode) return prgs.interiorScore[mode] end
Expand All @@ -437,11 +437,9 @@ function PROGRESS.setMain(n)
while prgs.main<n do
prgs.main=prgs.main+1
if prgs.main==2 then
for i=1,4 do
prgs.interiorScore.tutorial[i]=math.max(prgs.interiorScore.tutorial[i],1)
end
prgs.interiorScore.tutorial=prgs.interiorScore.tutorial:gsub('0','1')
elseif prgs.main==3 then
-- ?
prgs.interiorScore.tutorial=prgs.interiorScore.tutorial:gsub('[01]','2')
elseif prgs.main==4 then
-- ?
elseif prgs.main==5 then
Expand Down
19 changes: 10 additions & 9 deletions assets/scene/tutorial_in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ local function B(t)
return WIDGET.new(w)
end
local function playTutorial(level)
if PROGRESS.getTutorialPassed(level)<2 then
local unlock=PROGRESS.getTutorialPassed(level)
if unlock==0 then
elseif unlock<=2 then
SCN.go('game_in','none','brik/interior/tutorial/'..(
level==1 and '1.basic' or
level==2 and '2.sequence' or
Expand All @@ -47,16 +49,15 @@ function scene.load()
if v.name then
local id=tonumber(v.name:sub(-1))
local state=PROGRESS.getTutorialPassed(id)
if state==2 then
if state==0 then
v.color='lD'
v.text="???"
elseif state<=2 then
v.color=state==1 and 'B' or 'lG'
v.text=LANG(buttonTexts[id])
else
v.color='lR'
v.text=LANG(buttonTexts[4+id])
else
if state==0 then
v.color='B'
elseif state==1 then
v.color='lG'
end
v.text=LANG(buttonTexts[id])
end
end
end
Expand Down

0 comments on commit 7df6a46

Please sign in to comment.