Skip to content

Commit

Permalink
加一堆新音乐的索引
Browse files Browse the repository at this point in the history
第四阶段(exterior2)使用新的音乐
尝试更早加载fmod
hypersonic_titanium的音乐改为secret7th remix
整理代码
  • Loading branch information
MrZ626 committed Jun 23, 2024
1 parent f9cea4a commit 6c22d7e
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 61 deletions.
7 changes: 7 additions & 0 deletions assets/game/mechanicLib/brik/marathon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,13 @@ do -- hypersonic (of course they are variations of marathon, aren't they?)
if md.level<10 then
P:playSound('beep_rise')
md.level=md.level+1
if md.level>9 then
FMOD.music.setParam('section',3)
elseif md.level>5 then
FMOD.music.setParam('section',2)
elseif md.level>2 then
FMOD.music.setParam('section',1)
end
md.target.point=100*md.level

P.settings.asd=max(md.storedAsd,levels[md.level].asd)
Expand Down
3 changes: 1 addition & 2 deletions assets/game/mode/brik/exterior/hypersonic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ return {
-- Titanium: Techrash in 8s without hold
P.modeData.subMode='titanium'
initFunc=mechLib.brik.marathon.hypersonic_titanium_event_playerInit
playBgm('distortion')
mechLib.common.music.set(P,{path='.point',s=200,e=600},'afterSpawn')
playBgm('secret7th remix_titanium')

elseif P.gameTime<=6e3 then
-- Hidden: Techrash in 6s
Expand Down
4 changes: 3 additions & 1 deletion assets/gamefunc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ local _bgmPlaying ---@type string?
---@param noProgress? boolean
function playBgm(name,full,noProgress)
if name==_bgmPlaying then return end
if not noProgress and not SONGBOOK[name].inside then PROGRESS.setBgmUnlocked(name,full and 2 or 1) end
if not noProgress and not SONGBOOK[name].inside then
PROGRESS.setBgmUnlocked(SONGBOOK[name].redirect or name,full and 2 or 1)
end
if full then
FMOD.music(name)
else
Expand Down
8 changes: 7 additions & 1 deletion assets/progress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ end
function PROGRESS.applyInteriorBG() BG.set('none') end
function PROGRESS.applyExteriorBG() BG.set(prgs.main==3 and 'space' or 'galaxy') end
function PROGRESS.applyInteriorBGM() playBgm('blank',prgs.main~=1) end
function PROGRESS.applyExteriorBGM() playBgm('vacuum',prgs.main~=3) end
function PROGRESS.applyExteriorBGM()
if prgs.main==3 then
playBgm('vacuum')
else
playBgm('singularity')
end
end
function PROGRESS.applyEnv(env)
if env=='interior' then
PROGRESS.applyInteriorBG()
Expand Down
12 changes: 11 additions & 1 deletion assets/scene/hello.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ function scene.load()
t=0
ZENITHA.globalEvent.clickFX=NULL
ZENITHA.globalEvent.drawCursor=NULL
if PROGRESS.get('main')>=3 then PROGRESS.applyCoolWaitTemplate() end
if PROGRESS.get('main')>=3 then
PROGRESS.applyCoolWaitTemplate()
if PROGRESS.get('main')>=4 then
TASK.new(function()
repeat
coroutine.yield()
until FMOD.studio
playBgm('singularity')
end)
end
end
end

function scene.update(dt)
Expand Down
1 change: 0 additions & 1 deletion assets/scene/pause_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ local function sysAction(action)
end
end
function scene.keyDown(key,isRep)
FMOD.effect.keyOff('music_pause')
if isRep then return true end
sysAction(KEYMAP.sys:getAction(key))
return true
Expand Down
61 changes: 25 additions & 36 deletions assets/scene/simulation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,23 @@ local sims={
)
end,
},
{ -- Exterior 2
trigger=function()
DEBUG.yieldUntilNextScene()
if SCN.cur=='simulation' then
SCN.go('mode_gela','fadeHeader')
end
end,
draw=function()
-- GC.setColor(COLOR.R)
-- GC.setLineWidth(8)
-- GC.circle('line',-35,-60,70)
-- GC.circle('line',35,60,70)
end,
},
-- { -- Acry
-- trigger=function()
-- DEBUG.yieldUntilNextScene()
-- if SCN.cur=='simulation' then
-- SCN.go('mode_acry','fadeHeader')
-- end
-- end,
-- draw=function()
-- GC.setColor(COLOR.B)
-- GC.setLineWidth(10)
-- GC.polygon('line',
-- 0,112,
-- 108,-32,
-- 50,-100,
-- -50,-100,
-- -108 ,-32
-- )
-- end,
-- },
-- draw=function() -- Gela
-- GC.setColor(COLOR.R)
-- GC.setLineWidth(8)
-- GC.circle('line',-35,-60,70)
-- GC.circle('line',35,60,70)
-- end,
-- draw=function() -- Acry
-- GC.setColor(COLOR.B)
-- GC.setLineWidth(10)
-- GC.polygon('line',
-- 0,112,
-- 108,-32,
-- 50,-100,
-- -50,-100,
-- -108 ,-32
-- )
-- end,
}

---@type integer|false
Expand All @@ -85,12 +69,17 @@ function scene.load()
s.trigTimer=false
end
subjectFocused=false
sims[1].valid=true
sims[2].valid=false
sims[1].valid=true -- TODO
-- sims[2].valid=false -- TODO
scene.update(0)
PROGRESS.applyExteriorBG()
PROGRESS.applyExteriorBGM()
if SCN.prev=='main_out' and sims[1].valid and not sims[2].valid then
if SCN.prev=='main_out' then
for i=2,#sims do
if sims[i].valid then
return
end
end
subjectFocused=1
scene.keyDown('return')
end
Expand Down
38 changes: 20 additions & 18 deletions assets/songbook.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
---@alias Techmino.MusicName
---| Techmino.PubMusicName
---| 'secret7th_hidden'
---| 'propel_marathon'
---
---| 'race remix_mix'
---| 'race_old'
---| 'sakura_noloop'
---| 'secret7th remix_loop'
---| 'shibamata_noloop'
---| 'caprice'
---| 'fruit dance_ex'
---| 'fruit dance_mix'
---| 'vacc'
---| 'secret7th_overdrive'
---| 'secret7th_old'

---@enum (key) Techmino.PubMusicName
---@enum (key) Techmino.MusicName
local songbook={
['8-bit happiness'] ={},
['8-bit sadness'] ={},
Expand Down Expand Up @@ -90,6 +73,24 @@ local songbook={
['space retro'] ={author="LR & MrZ"},
['flare'] ={},
['fruit dance'] ={message="Recollection? remix"},
['singularity'] ={author="T0722",message="A cool blank remix"},
['pressure orchestra'] ={author="T0722",message="A cool pressure remix"},
['secret7th_old'] ={message="The -7th secret"},
['secret7th overdrive remix']={author="Yunokawa"},

['secret7th overdrive remix_mix'] ={inside=true,author="Yunokawa",redirect='secret7th overdrive remix'},
['secret7th remix_titanium'] ={inside=true,author="柒栎流星",redirect='secret7th remix'},
['jazz nihilism_layered'] ={inside=true,author="Trebor",redirect='jazz nihilism'},
['accelerator'] ={inside=true,author="Trebor",},
['caprice'] ={inside=true,redirect='rectification'},
['fruit dance_ex'] ={inside=true,redirect='dance'},
['fruit dance_mix'] ={inside=true,redirect='dance'},
['propel_marathon'] ={inside=true,redirect='propel'},
['race remix_mix'] ={inside=true,redirect='race remix'},
['race_old'] ={inside=true,redirect='race'},
['sakura_noloop'] ={inside=true,redirect='sakura'},
['secret7th_hidden'] ={inside=true,redirect='secret7th'},
['shibamata_noloop'] ={inside=true,redirect='shibamata'},
}

for name,data in next,songbook do
Expand All @@ -102,6 +103,7 @@ for name,data in next,songbook do
end

setmetatable(songbook,{__call=function(t,name)
MSG.new('warn',"Unlisted song: "..name)
t[name]={
title='['..name..']',
author='',
Expand Down
4 changes: 3 additions & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,15 @@ function FMODLoadFunc() -- Will be called again when applying advanced options
end)())
end
TASK.new(function() -- Don't initialize studio at first frame, may cause some weird problem
DEBUG.yieldN(6)
DEBUG.yieldT(0.26)
FMODLoadFunc()
FMOD.setMainVolume(SETTINGS.system.mainVol,true)
for name,data in next,SONGBOOK do
data.intensity=FMOD.music.getParamDesc(name,'intensity')~=nil
data.section=FMOD.music.getParamDesc(name,'section')~=nil
if not FMOD.music.getParamDesc(name,'fade') then
MSG.new('warn',"Missing fade parameter in music '"..name.."'")
end
end
end)
-- Hijack the original SFX module, use FMOD instead
Expand Down

0 comments on commit 6c22d7e

Please sign in to comment.