From f08a469ea5a34d406592903338e5c5c58784cdf9 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Thu, 12 Sep 2024 09:13:49 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90WIP=E3=80=91interior=E6=95=99=E7=A8=8B?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=B8=AD=E5=88=A0=E9=99=A4=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=B0=8F=E6=B8=B8=E6=88=8F=E5=85=B3=E5=8D=A1=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E7=95=99=E4=B8=8B=E5=9B=9B=E4=B8=AA=E6=AD=A3=E5=BC=8F=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=20=E6=A1=86=E6=9E=B6=E8=B7=9F=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mode/brik/interior/tutorial/1.basic.lua | 2 +- .../brik/interior/tutorial/2.sequence.lua | 3 +- .../{4.stackBasic.lua => 3.stackBasic.lua} | 2 +- ....twoRotatingKey.lua => 4.finesseBasic.lua} | 2 +- .../interior/tutorial/5.finessePractice.lua | 0 .../interior/tutorial/6.allclearPractice.lua | 0 .../interior/tutorial/7.techrashPractice.lua | 0 .../brik/interior/tutorial/8.finessePlus.lua | 0 assets/language/lang_en.lua | 8 ++- assets/language/lang_zh.lua | 10 +-- assets/progress.lua | 47 +++++++++--- assets/scene/tutorial_in.lua | 71 ++++++++++++------- .../{scene => scene_app}/tutorial_rotate.lua | 0 .../tutorial_shape_drop.lua} | 0 .../tutorial_shape_find.lua} | 0 15 files changed, 100 insertions(+), 45 deletions(-) rename assets/game/mode/brik/interior/tutorial/{4.stackBasic.lua => 3.stackBasic.lua} (99%) rename assets/game/mode/brik/interior/tutorial/{5.twoRotatingKey.lua => 4.finesseBasic.lua} (99%) create mode 100644 assets/game/mode/brik/interior/tutorial/5.finessePractice.lua create mode 100644 assets/game/mode/brik/interior/tutorial/6.allclearPractice.lua create mode 100644 assets/game/mode/brik/interior/tutorial/7.techrashPractice.lua create mode 100644 assets/game/mode/brik/interior/tutorial/8.finessePlus.lua rename assets/{scene => scene_app}/tutorial_rotate.lua (100%) rename assets/{scene/tutorial_shape.lua => scene_app/tutorial_shape_drop.lua} (100%) rename assets/{scene/tutorial_shape_legacy.lua => scene_app/tutorial_shape_find.lua} (100%) diff --git a/assets/game/mode/brik/interior/tutorial/1.basic.lua b/assets/game/mode/brik/interior/tutorial/1.basic.lua index 7cf2c197..26cb1085 100644 --- a/assets/game/mode/brik/interior/tutorial/1.basic.lua +++ b/assets/game/mode/brik/interior/tutorial/1.basic.lua @@ -169,7 +169,7 @@ return { "sfx finish_win", {cmd='say',arg={duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}}, - {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(1) end end}, + {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(1,1) end end}, "finish win", }, }}, diff --git a/assets/game/mode/brik/interior/tutorial/2.sequence.lua b/assets/game/mode/brik/interior/tutorial/2.sequence.lua index ed4e8178..f38ce7e4 100644 --- a/assets/game/mode/brik/interior/tutorial/2.sequence.lua +++ b/assets/game/mode/brik/interior/tutorial/2.sequence.lua @@ -208,11 +208,12 @@ return { "jeq extra,extra,true", {cmd='say',arg={duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}}, + {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(2,1) end end}, "j end", "extra:", {cmd='say',arg={duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lY,y=-30}}, + {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(2,2) end end}, "end:", - {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(2) end end}, "finish win", }, }}, diff --git a/assets/game/mode/brik/interior/tutorial/4.stackBasic.lua b/assets/game/mode/brik/interior/tutorial/3.stackBasic.lua similarity index 99% rename from assets/game/mode/brik/interior/tutorial/4.stackBasic.lua rename to assets/game/mode/brik/interior/tutorial/3.stackBasic.lua index d32140ee..9f47eaf0 100644 --- a/assets/game/mode/brik/interior/tutorial/4.stackBasic.lua +++ b/assets/game/mode/brik/interior/tutorial/3.stackBasic.lua @@ -149,7 +149,7 @@ return { "setc msg,false", {cmd='say',arg={duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}}, - {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(4) end end}, + {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(3,1) end end}, "finish win", }, }}, diff --git a/assets/game/mode/brik/interior/tutorial/5.twoRotatingKey.lua b/assets/game/mode/brik/interior/tutorial/4.finesseBasic.lua similarity index 99% rename from assets/game/mode/brik/interior/tutorial/5.twoRotatingKey.lua rename to assets/game/mode/brik/interior/tutorial/4.finesseBasic.lua index f0df1128..2bfcebfc 100644 --- a/assets/game/mode/brik/interior/tutorial/5.twoRotatingKey.lua +++ b/assets/game/mode/brik/interior/tutorial/4.finesseBasic.lua @@ -193,7 +193,7 @@ return { "sfx finish_win", {cmd='say',arg={duration='6.26s',text="@tutorial_pass",size=60,k=2,type='bold',style='beat',c=COLOR.lG,y=-30}}, - {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(5) end end}, + {cmd=function(P) if P.isMain then PROGRESS.setTutorialPassed(4,1) end end}, "finish win", }, }}, diff --git a/assets/game/mode/brik/interior/tutorial/5.finessePractice.lua b/assets/game/mode/brik/interior/tutorial/5.finessePractice.lua new file mode 100644 index 00000000..e69de29b diff --git a/assets/game/mode/brik/interior/tutorial/6.allclearPractice.lua b/assets/game/mode/brik/interior/tutorial/6.allclearPractice.lua new file mode 100644 index 00000000..e69de29b diff --git a/assets/game/mode/brik/interior/tutorial/7.techrashPractice.lua b/assets/game/mode/brik/interior/tutorial/7.techrashPractice.lua new file mode 100644 index 00000000..e69de29b diff --git a/assets/game/mode/brik/interior/tutorial/8.finessePlus.lua b/assets/game/mode/brik/interior/tutorial/8.finessePlus.lua new file mode 100644 index 00000000..e69de29b diff --git a/assets/language/lang_en.lua b/assets/language/lang_en.lua index fa1a87a4..57765dd2 100644 --- a/assets/language/lang_en.lua +++ b/assets/language/lang_en.lua @@ -303,10 +303,12 @@ local L={ -- Level tutorial_basic="The Basics", tutorial_sequence="Next & Hold", - tutorial_piece="Piece shapes", tutorial_stackBasic="Basic Stacking", - tutorial_twoRotatingKey="Two-way Rotation", - tutorial_rotating="Rotating Practice", + tutorial_finesseBasic="Basic Finesse", + tutorial_finessePractice="Finesse Practice", + tutorial_allclearPractice="All Clear Practice", + tutorial_techrash="Techrash Only", + tutorial_finessePlus="Elegant Stack", tutorial_notpass="Failed", tutorial_pass="PASS", diff --git a/assets/language/lang_zh.lua b/assets/language/lang_zh.lua index f76ccecc..1fd1876f 100644 --- a/assets/language/lang_zh.lua +++ b/assets/language/lang_zh.lua @@ -302,10 +302,12 @@ local L={ -- Level tutorial_basic="基本规则", tutorial_sequence="预览&暂存", - tutorial_piece="方块形状", - tutorial_stackBasic="堆叠(基础)", - tutorial_twoRotatingKey="双旋", - tutorial_rotating="旋转练习", + tutorial_stackBasic="基础堆叠", + tutorial_finesseBasic="基础极简", + tutorial_finessePractice="极简练习", + tutorial_allclearPractice="全消练习", + tutorial_techrash="仅消四", + tutorial_finessePlus="优雅堆叠", tutorial_notpass="Failed", tutorial_pass="PASS", diff --git a/assets/progress.lua b/assets/progress.lua index aafbafcb..e7cc7d13 100644 --- a/assets/progress.lua +++ b/assets/progress.lua @@ -2,17 +2,25 @@ local gc=love.graphics --[[ I/II: - Sum>=100 → II + Sum>=150 → II Single>=200 or Sum>=350 → III ]] local prgs=setmetatable({ launchCount=0, main=1, - tutorial='000000', interiorScore={ dig=0, sprint=0, marathon=0, + tutorial='0000', -- 0: Not Finished, 1: Passed, 2: Perfect Passed (unlock B side) + tuto_B1_score=0, + tuto_B2_score=0, + tuto_B3_score=0, + tuto_B4_score=0, + tuto_B1_time=false, + tuto_B2_time=false, + tuto_B3_time=false, + tuto_B4_time=false, }, styles={ brik=true, @@ -102,7 +110,7 @@ local function zDump(t) return table.concat(list) end local function getHash(t) - return love.data.encode('string','base64',STRING.digezt(zDump(t))) + return love.data.encode('string','base64',zDump(t):digezt()) end local PROGRESS={} @@ -145,6 +153,17 @@ function PROGRESS.load() end function PROGRESS.fix() prgs.brik_stdMap=nil + if type(prgs.interiorScore.tutorial)=='table' then + prgs.interiorScore.tutorial='0000' + prgs.tuto_B1_score=0 + prgs.tuto_B2_score=0 + prgs.tuto_B3_score=0 + prgs.tuto_B4_score=0 + prgs.tuto_B1_time=false + prgs.tuto_B2_time=false + prgs.tuto_B3_time=false + prgs.tuto_B4_time=false + end end -------------------------------------------------------------- @@ -396,9 +415,9 @@ function PROGRESS.getBgmUnlocked(name) return prgs.bgmUnlocked[name] end function PROGRESS.getStyleUnlock(style) return prgs.styles[style] end function PROGRESS.getTutorialPassed(n) if n then - return prgs.tutorial:sub(n,n)=='1' + return tonumber(prgs.interiorScore.tutorial:sub(n,n)) else - return prgs.tutorial=='111111' + return not prgs.interiorScore.tutorial:find('0') end end function PROGRESS.getInteriorScore(mode) return prgs.interiorScore[mode] end @@ -420,9 +439,15 @@ function PROGRESS.setMain(n) while prgs.maintonumber(l[n]) then + l[n]=v + prgs.interiorScore.tutorial=table.concat(l) PROGRESS.save() end end diff --git a/assets/scene/tutorial_in.lua b/assets/scene/tutorial_in.lua index 782a5905..10bf4ee0 100644 --- a/assets/scene/tutorial_in.lua +++ b/assets/scene/tutorial_in.lua @@ -1,6 +1,16 @@ ---@type Zenitha.Scene local scene={} +local buttonTexts={ + 'tutorial_basic', + 'tutorial_sequence', + 'tutorial_stackBasic', + 'tutorial_finesseBasic', + 'tutorial_finessePractice', + 'tutorial_allclearPractice', + 'tutorial_techrash', + 'tutorial_finessePlus', +} local function B(t) local w={ type='button_fill', @@ -13,30 +23,45 @@ local function B(t) TABLE.update(w,t) return WIDGET.new(w) end +local function playTutorial(level) + if PROGRESS.getTutorialPassed(level)==2 then level=level+4 end + if level<=4 then + SCN.go('game_in','none','brik/interior/tutorial/'..( + level==1 and '1.basic' or + level==2 and '2.sequence' or + level==3 and '3.stackBasic' or + level==4 and '4.finesseBasic' + )) + else + MSG.new('warn','Coming Soon') + -- SCN.go('game_in','none','brik/interior/tutorial/'..( + -- level==1 and '5.finessePractice' or + -- level==2 and '6.allclearPractice' or + -- level==3 and '7.techrash' or + -- level==4 and '8.finessePlus' + -- )) + end +end function scene.load() - local L=scene.widgetList for _,v in next,scene.widgetList do if v.name then - v.color=PROGRESS.getTutorialPassed(tonumber(v.name:sub(-1))) and 'lG' or 'B' + local id=tonumber(v.name:sub(-1)) + local state=PROGRESS.getTutorialPassed(id) + if state==2 then + 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 - if not (PROGRESS.getTutorialPassed(1) and PROGRESS.getTutorialPassed(2) and PROGRESS.getTutorialPassed(3)) then - L.T1.x,L.T2.x,L.T3.x=0,0,0 - L.T1.w,L.T2.w,L.T3.w=800,800,800 - L.T4:setVisible(false) - L.T5:setVisible(false) - L.T6:setVisible(false) - WIDGET._reset() - else - L.T1.x,L.T2.x,L.T3.x=-360,-360,-360 - L.T1.w,L.T2.w,L.T3.w=600,600,600 - L.T4.x,L.T5.x,L.T6.x=360,360,360 - L.T4:setVisible(true) - L.T5:setVisible(true) - L.T6:setVisible(true) - WIDGET._reset() - end + WIDGET._reset() PROGRESS.applyInteriorBGM() end @@ -59,12 +84,10 @@ end scene.widgetList={ {type='button',pos={0,.5},x=210,y=-360,w=200,h=80,lineWidth=4,cornerR=0,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn('none')}, - B{name='T1',x=nil, y=-200,text=LANG'tutorial_basic', code=playInterior'brik/interior/tutorial/1.basic'}, - B{name='T2',x=nil, y= 0, text=LANG'tutorial_sequence', code=playInterior'brik/interior/tutorial/2.sequence'}, - B{name='T3',x=nil, y= 200,text=LANG'tutorial_piece', code=WIDGET.c_goScn('tutorial_shape','none')}, + B{name='T1',x=-350,y=-180,text=LANG'tutorial_basic', code=function() playTutorial(1) end}, + B{name='T2',x=-350,y= 180,text=LANG'tutorial_sequence', code=function() playTutorial(2) end}, - B{name='T4',x=nil, y=-200,text=LANG'tutorial_stackBasic', code=playInterior'brik/interior/tutorial/4.stackBasic'}, - B{name='T5',x=nil, y= 0, text=LANG'tutorial_twoRotatingKey', code=playInterior'brik/interior/tutorial/5.twoRotatingKey'}, - B{name='T6',x=nil, y= 200,text=LANG'tutorial_rotating', code=WIDGET.c_goScn('tutorial_rotate','none')}, + B{name='T3',x= 350,y=-180,text=LANG'tutorial_stackBasic', code=function() playTutorial(3) end}, + B{name='T4',x= 350,y= 180,text=LANG'tutorial_finesseBasic', code=function() playTutorial(4) end}, } return scene diff --git a/assets/scene/tutorial_rotate.lua b/assets/scene_app/tutorial_rotate.lua similarity index 100% rename from assets/scene/tutorial_rotate.lua rename to assets/scene_app/tutorial_rotate.lua diff --git a/assets/scene/tutorial_shape.lua b/assets/scene_app/tutorial_shape_drop.lua similarity index 100% rename from assets/scene/tutorial_shape.lua rename to assets/scene_app/tutorial_shape_drop.lua diff --git a/assets/scene/tutorial_shape_legacy.lua b/assets/scene_app/tutorial_shape_find.lua similarity index 100% rename from assets/scene/tutorial_shape_legacy.lua rename to assets/scene_app/tutorial_shape_find.lua