introducing soundcubeapi
This commit is contained in:
parent
3879c8ed27
commit
108bdfc281
@ -6,6 +6,7 @@ Cleans up the table for the next scenario in a campaign:
|
|||||||
--]]
|
--]]
|
||||||
|
|
||||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||||
|
local soundCubeApi = require("core/SoundCubeApi")
|
||||||
|
|
||||||
-- enable this for debugging
|
-- enable this for debugging
|
||||||
local SHOW_RAYS = false
|
local SHOW_RAYS = false
|
||||||
@ -165,7 +166,7 @@ function cleanUp(_, color)
|
|||||||
printToAll("Clean up started!", "Orange")
|
printToAll("Clean up started!", "Orange")
|
||||||
printToAll("Resetting counters...", "White")
|
printToAll("Resetting counters...", "White")
|
||||||
|
|
||||||
triggerSoundCube()
|
soundCubeApi.playSoundByName("Vacuum")
|
||||||
ignoreCustomDataHelper()
|
ignoreCustomDataHelper()
|
||||||
getTrauma()
|
getTrauma()
|
||||||
updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror")
|
updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror")
|
||||||
@ -185,14 +186,6 @@ end
|
|||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
-- modular functions, called by other functions
|
-- modular functions, called by other functions
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
function triggerSoundCube()
|
|
||||||
local soundCube = getObjectsWithTag("SoundCube")[1]
|
|
||||||
if soundCube then
|
|
||||||
soundCube.AssetBundle.playTriggerEffect(0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function updateCounters(tableOfGUIDs, tableOfNewValues, info)
|
function updateCounters(tableOfGUIDs, tableOfNewValues, info)
|
||||||
if tonumber(tableOfNewValues) then
|
if tonumber(tableOfNewValues) then
|
||||||
local value = tableOfNewValues
|
local value = tableOfNewValues
|
||||||
|
@ -34,6 +34,7 @@ local hideTitleSplashWaitFunctionId = nil
|
|||||||
local playmatApi = require("playermat/PlaymatApi")
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
local tokenManager = require("core/token/TokenManager")
|
local tokenManager = require("core/token/TokenManager")
|
||||||
local playAreaAPI = require("core/PlayAreaApi")
|
local playAreaAPI = require("core/PlayAreaApi")
|
||||||
|
local soundCubeApi = require("core/SoundCubeApi")
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
-- data for tokens
|
-- data for tokens
|
||||||
@ -1021,10 +1022,6 @@ function titleSplash(scenarioName)
|
|||||||
hideTitleSplashWaitFunctionId = nil
|
hideTitleSplashWaitFunctionId = nil
|
||||||
end, 4)
|
end, 4)
|
||||||
|
|
||||||
-- play bell sound from soundCube
|
soundCubeApi.playSoundByName("Deep Bell")
|
||||||
local soundCube = getObjectsWithTag("SoundCube")[1]
|
|
||||||
if soundCube then
|
|
||||||
soundCube.AssetBundle.playTriggerEffect(1)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
17
src/core/SoundCubeApi.ttslua
Normal file
17
src/core/SoundCubeApi.ttslua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
do
|
||||||
|
local SoundCubeApi = {}
|
||||||
|
|
||||||
|
-- this table links the name of a trigger effect to its index
|
||||||
|
local soundIndices = {
|
||||||
|
["Vacuum"] = 0,
|
||||||
|
["Deep Bell"] = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
-- plays the by name requested sound
|
||||||
|
---@param soundName String Name of the sound to play
|
||||||
|
SoundCubeApi.playSoundByName = function(soundName)
|
||||||
|
getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(soundIndices[soundName])
|
||||||
|
end
|
||||||
|
|
||||||
|
return SoundCubeApi
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user