Skip to content

Commit

Permalink
删除一个暂时没啥用的PROGRESS方法
Browse files Browse the repository at this point in the history
整理代码
  • Loading branch information
MrZ626 committed Jul 21, 2024
1 parent b0e8e95 commit 2745f69
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 52 deletions.
20 changes: 10 additions & 10 deletions assets/game/mode/brik/exterior/dig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ return {
end
end,
function()
if PROGRESS.getExteriorModeState('excavate') then return true end
if PROGRESS.getExteriorUnlock('excavate') then return true end
if
0.4/PROGRESS.getExteriorModeState('dig').spl10+
0.3/PROGRESS.getExteriorModeState('dig').spl20+
0.2/PROGRESS.getExteriorModeState('dig').spl40+
0.3/PROGRESS.getExteriorModeState('dig').spl100
0.4/PROGRESS.getExteriorModeScore('dig','spl10')+
0.3/PROGRESS.getExteriorModeScore('dig','spl20')+
0.2/PROGRESS.getExteriorModeScore('dig','spl40')+
0.3/PROGRESS.getExteriorModeScore('dig','spl100')
>=0.26 -- lps, ≈3.85 spl
then PROGRESS.setExteriorUnlock('excavate') return true end
end,
function()
if PROGRESS.getExteriorModeState('drill') then return true end
if PROGRESS.getExteriorUnlock('drill') then return true end
if
0.4/PROGRESS.getExteriorModeState('dig').ppl10+
0.3/PROGRESS.getExteriorModeState('dig').ppl20+
0.2/PROGRESS.getExteriorModeState('dig').ppl40+
0.3/PROGRESS.getExteriorModeState('dig').ppl100
0.4/PROGRESS.getExteriorModeScore('dig','ppl10')+
0.3/PROGRESS.getExteriorModeScore('dig','ppl20')+
0.2/PROGRESS.getExteriorModeScore('dig','ppl40')+
0.3/PROGRESS.getExteriorModeScore('dig','ppl100')
>=0.42 -- lpp, ≈2.38 ppl
then PROGRESS.setExteriorUnlock('drill') return true end
end,
Expand Down
18 changes: 9 additions & 9 deletions assets/game/mode/brik/exterior/drill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ return {
end
end,
function()
if PROGRESS.getExteriorModeState('survivor') then return true end
if PROGRESS.getExteriorUnlock('survivor') then return true end
if
0.3/PROGRESS.getExteriorModeState('drill').spl10+
0.3/PROGRESS.getExteriorModeState('drill').spl20+
0.2/PROGRESS.getExteriorModeState('drill').spl40+
0.4/PROGRESS.getExteriorModeState('drill').spl100
0.3/PROGRESS.getExteriorModeScore('drill','spl10')+
0.3/PROGRESS.getExteriorModeScore('drill','spl20')+
0.2/PROGRESS.getExteriorModeScore('drill','spl40')+
0.4/PROGRESS.getExteriorModeScore('drill','spl100')
>=0.355 -- lps, ≈2.82 spl
then PROGRESS.setExteriorUnlock('survivor') return true end
end,
function()
if PROGRESS.getStyleUnlock('acry') then return true end
if
0.3/PROGRESS.getExteriorModeState('drill').ppl10+
0.3/PROGRESS.getExteriorModeState('drill').ppl20+
0.2/PROGRESS.getExteriorModeState('drill').ppl40+
0.4/PROGRESS.getExteriorModeState('drill').ppl100
0.3/PROGRESS.getExteriorModeScore('drill','ppl10')+
0.3/PROGRESS.getExteriorModeScore('drill','ppl20')+
0.2/PROGRESS.getExteriorModeScore('drill','ppl40')+
0.4/PROGRESS.getExteriorModeScore('drill','ppl100')
>=0.495 -- lpp, ≈2.02 ppl
then
PROGRESS.setStyleUnlock('acry')
Expand Down
13 changes: 6 additions & 7 deletions assets/game/mode/brik/exterior/excavate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ return {
T.add(P,'excavate_shale', 'modeTask_excavate_shale_title', 'modeTask_excavate_shale_desc')
T.add(P,'excavate_volcanics', 'modeTask_excavate_volcanics_title', 'modeTask_excavate_volcanics_desc')

local S=PROGRESS.getExteriorModeState('excavate') or NONE
if S.shale and S.volcanics then
if PROGRESS.getExteriorModeScore('excavate','shale') and PROGRESS.getExteriorModeScore('excavate','volcanics') then
PROGRESS.setExteriorScore('excavate','showChecker',1)
end
if S.showChecker then
if PROGRESS.getExteriorModeScore('excavate','showChecker') then
T.add(P,'excavate_checker','modeTask_excavate_checker_title','modeTask_excavate_checker_desc')
else
T.add(P,'excavate_checker','modeTask_unknown_title','modeTask_excavate_unknown_desc')
Expand Down Expand Up @@ -99,11 +98,11 @@ return {
PROGRESS.setExteriorScore('dig','volcanics',P.gameTime,'<')
end

local playCount=PROGRESS.getExteriorModeState('dig').playCount or 0
local playCount=PROGRESS.getExteriorModeScore('dig','playCount') or 0
if
(PROGRESS.getExteriorModeState('dig').shale or 1e99)<=100e3+10e3*playCount or
(PROGRESS.getExteriorModeState('dig').volcanics or 1e99)<=100e3+10e3*playCount or
(PROGRESS.getExteriorModeState('dig').checker or 1e99)<=60e3+5e3*playCount
(PROGRESS.getExteriorModeScore('dig','shale') or 1e99)<=100e3+10e3*playCount or
(PROGRESS.getExteriorModeScore('dig','volcanics') or 1e99)<=100e3+10e3*playCount or
(PROGRESS.getExteriorModeScore('dig','checker') or 1e99)<=60e3+5e3*playCount
then
PROGRESS.setExteriorUnlock('backfire')
return true
Expand Down
7 changes: 3 additions & 4 deletions assets/game/mode/brik/exterior/hypersonic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ return {
T.add(P,'hypersonic_low','modeTask_hypersonic_low_title','modeTask_hypersonic_low_desc','(0/4)')
T.add(P,'hypersonic_high','modeTask_hypersonic_high_title','modeTask_hypersonic_high_desc')

local S=PROGRESS.getExteriorModeState('hypersonic') or NONE
if S.showHidden then
if PROGRESS.getExteriorModeScore('hypersonic','showHidden') then
T.add(P,'hypersonic_hidden','modeTask_hypersonic_hidden_title','modeTask_hypersonic_hidden_desc')
else
T.add(P,'hypersonic_hidden','modeTask_unknown_title','modeTask_unknown_desc')
end

if S.high then
if PROGRESS.getExteriorModeScore('hypersonic','high') then
PROGRESS.setExteriorScore('hypersonic','showTitanium',1)
end
if S.showTitanium then
if PROGRESS.getExteriorModeScore('hypersonic','showTitanium') then
T.add(P,'hypersonic_titanium','modeTask_hypersonic_titanium_title','modeTask_hypersonic_titanium_desc')
end
end,
Expand Down
6 changes: 3 additions & 3 deletions assets/game/mode/brik/exterior/marathon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ return {
mechLib.brik.marathon.event_playerInit,
function(P)
mechLib.common.music.set(P,{id='level_marathon_exterior',path='.level'},'afterClear')
if not PROGRESS.getExteriorModeState('combo') then
if not PROGRESS.getExteriorUnlock('combo') then
P.settings.combo_sound=true
end
end,
},
afterClear={
function(P)
if PROGRESS.getExteriorModeState('allclear') then return true end
if PROGRESS.getExteriorUnlock('allclear') then return true end
if P.stat.allclear>0 then
PROGRESS.setExteriorUnlock('allclear')
return true
end
end,
function(P)
if PROGRESS.getExteriorModeState('combo') then return true end
if PROGRESS.getExteriorUnlock('combo') then return true end
if P.combo==10 then
PROGRESS.setExteriorUnlock('combo')
return true
Expand Down
7 changes: 3 additions & 4 deletions assets/game/mode/brik/exterior/sequence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,18 @@ return {
T.add(P,'sequence_rect', 'modeTask_sequence_rect_title', 'modeTask_sequence_rect_desc')
T.add(P,'sequence_rain', 'modeTask_sequence_rain_title', 'modeTask_sequence_rain_desc')

local S=PROGRESS.getExteriorModeState('sequence') or NONE
local count=0
for _,v in next,{'mph','flood','drought','saw','rect','rain','pento'} do
if S[v] then count=count+1 end
if PROGRESS.getExteriorModeScore('sequence',v) then count=count+1 end
end
if count>=6 then PROGRESS.setExteriorScore('sequence','showPento',1) end

if S.showPento then
if PROGRESS.getExteriorModeScore('sequence','showPento') then
T.add(P,'sequence_pento','modeTask_sequence_pento_title','modeTask_sequence_pento_desc')
else
T.add(P,'sequence_pento','modeTask_unknown_title','modeTask_sequence_unknown_desc')
end
if S.showMPH then
if PROGRESS.getExteriorModeScore('sequence','showMPH') then
T.add(P,'sequence_mph','modeTask_sequence_mph_title','modeTask_sequence_mph_desc')
end
end,
Expand Down
12 changes: 6 additions & 6 deletions assets/game/mode/brik/exterior/sprint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ return {
P.modeData.target.line=40
P.modeData.keyCount={}
P.modeData.curKeyCount=0
if not PROGRESS.getExteriorModeState('combo') then
if not PROGRESS.getExteriorUnlock('combo') then
P.settings.combo_sound=true
end
if PROGRESS.getExteriorModeState('tspin') then
if PROGRESS.getExteriorUnlock('tspin') then
P.settings.spin_immobile=false
P.settings.spin_corners=false
end
Expand All @@ -40,7 +40,7 @@ return {
P.modeData.curKeyCount=0
end,
afterPress=function(P)
if PROGRESS.getExteriorModeState('tspin') then return true end
if PROGRESS.getExteriorUnlock('tspin') then return true end
local move=P.lastMovement
if move and (move.immobile or move.corners) then
PROGRESS.setExteriorUnlock('tspin')
Expand Down Expand Up @@ -126,21 +126,21 @@ return {
end
end,
function(P)
if PROGRESS.getExteriorModeState('allclear') then return true end
if PROGRESS.getExteriorUnlock('allclear') then return true end
if P.stat.allclear>0 then
PROGRESS.setExteriorUnlock('allclear')
return true
end
end,
function(P)
if PROGRESS.getExteriorModeState('combo') then return true end
if PROGRESS.getExteriorUnlock('combo') then return true end
if P.combo==10 then
PROGRESS.setExteriorUnlock('combo')
return true
end
end,
function(P)
if PROGRESS.getExteriorModeState('hidden') then return true end
if PROGRESS.getExteriorUnlock('hidden') then return true end
if P.stat.line>=40 then
if P.stat.piece<102.6 then
PROGRESS.setExteriorUnlock('sequence')
Expand Down
4 changes: 2 additions & 2 deletions assets/game/mode/brik/exterior/tspin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ return {

-- Unlock Gela
if
not (PROGRESS.getStyleUnlock('gela') and PROGRESS.getExteriorModeState('chain')) and
(PROGRESS.getExteriorModeState('tspin').tsd_hard or 0)+(PROGRESS.getExteriorModeState('tspin').tsd or 0)>=26
not (PROGRESS.getStyleUnlock('gela') and PROGRESS.getExteriorUnlock('chain')) and
(PROGRESS.getExteriorModeScore('tspin','tsd_hard') or 0)+(PROGRESS.getExteriorModeScore('tspin','tsd') or 0)>=26
then
PROGRESS.setStyleUnlock('gela')
PROGRESS.setExteriorUnlock('chain')
Expand Down
8 changes: 1 addition & 7 deletions assets/progress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ end
function PROGRESS.getInteriorScore(mode) return prgs.interiorScore[mode] end
function PROGRESS.getTotalInteriorScore() return prgs.interiorScore.dig+prgs.interiorScore.sprint+prgs.interiorScore.marathon end
function PROGRESS.getExteriorMapState() return prgs.exteriorMap end
function PROGRESS.getExteriorModeState(mode) return prgs.exteriorMap[mode] end ---@param mode Techmino.ModeName
function PROGRESS.getExteriorUnlock(mode) return not not prgs.exteriorMap[mode] end ---@param mode Techmino.ModeName
function PROGRESS.getExteriorModeScore(mode,key) local M=prgs.exteriorMap[mode] return M and M[key] end --[[@param mode Techmino.ModeName]] --[[@param key string]]
function PROGRESS.getSecret(id) return not not prgs.secretFound[id] end

Expand Down Expand Up @@ -479,12 +479,6 @@ function PROGRESS.setExteriorUnlock(mode,outsideGame)
end
end

---@param mode Techmino.ModeName
---@param data table
function PROGRESS.setExteriorModeState(mode,data)
prgs.exteriorMap[mode]=data
end

---@param mode Techmino.ModeName
---@param key string
---@param value number
Expand Down

0 comments on commit 2745f69

Please sign in to comment.