diff --git a/config.json b/config.json index e062bb1a..30b12fd2 100644 --- a/config.json +++ b/config.json @@ -190,7 +190,8 @@ "ArkhamSCE300-1272023-Page1.f873a8", "VictoryDisplay.6ccd6d", "CampaignOverview.e03c01", - "OptionPanelSource.830bd0" + "OptionPanelSource.830bd0", + "SoundCube.3c988f" ], "PlayArea": 1, "PlayerCounts": [ diff --git a/objects/SoundCube.3c988f.json b/objects/SoundCube.3c988f.json new file mode 100644 index 00000000..3c9fdf6f --- /dev/null +++ b/objects/SoundCube.3c988f.json @@ -0,0 +1,55 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0, + "g": 0.86837, + "r": 1 + }, + "CustomAssetbundle": { + "AssetbundleSecondaryURL": "", + "AssetbundleURL": "http://cloud-3.steamusercontent.com/ugc/2037356539985233174/FB2785745105BDFB2903346BEA6D090B7A4609AC/", + "LoopingEffectIndex": 0, + "MaterialIndex": 2, + "TypeIndex": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "3c988f", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Assetbundle", + "Nickname": "SoundCube", + "Snap": true, + "Sticky": true, + "Tags": [ + "SoundCube" + ], + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.645, + "posZ": -27, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index ebcd03ac..2b1711fa 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -3,72 +3,72 @@ Cleans up the table for the next scenario in a campaign: - sets counters to default values (resources and doom) or trauma values (health and sanity, if not disabled) from campaign log - puts everything on playmats and hands into respective trashcans - use the IGNORE_TAG to exclude objects from tidying (default: "CleanUpHelper_Ignore")]] - -local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi") -local playmatApi = require("playermat/PlaymatApi") +local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi") +local soundCubeApi = require("core/SoundCubeApi") +local playmatApi = require("playermat/PlaymatApi") -- these objects will be ignored -local IGNORE_GUIDS = { +local IGNORE_GUIDS = { -- big playmat, change image panel and investigator counter - "b7b45b"; "f182ee"; "721ba2"; + "b7b45b", "f182ee", "721ba2", -- bless/curse manager - "afa06b"; "bd0253"; "5933fb"; + "afa06b", "bd0253", "5933fb", -- stuff on agenda/act playmat - "85c4c6"; "4a3aa4"; "fea079"; "b015d8"; "11e0cf"; "9f334f"; "70b9f6"; "0a5a29"; + "85c4c6", "4a3aa4", "fea079", "b015d8", "11e0cf", "9f334f", "70b9f6", "0a5a29", -- doom/location token bag - "47ffc3"; "170f10"; + "47ffc3", "170f10", -- table "4ee1f2" } -- objects with this tag will be ignored -local IGNORE_TAG = "CleanUpHelper_ignore" +local IGNORE_TAG = "CleanUpHelper_ignore" -- colors and order for following tables -local COLORS = { "White"; "Orange"; "Green"; "Red"; "Agenda" } +local COLORS = { "White", "Orange", "Green", "Red", "Agenda" } -- counter GUIDS (4x damage and 4x horror) -local DAMAGE_HORROR_GUIDS = { - "eb08d6"; "e64eec"; "1f5a0a"; "591a45"; - "468e88"; "0257d9"; "7b5729"; "beb964"; +local DAMAGE_HORROR_GUIDS = { + "eb08d6", "e64eec", "1f5a0a", "591a45", + "468e88", "0257d9", "7b5729", "beb964", } -local RESET_VALUES = {} +local RESET_VALUES = {} -- GUIDS of objects (in order of ownership relating to 'COLORS') -local PLAYERMAT_GUIDS = { "8b081b"; "bd0ff4"; "383d8b"; "0840d5" } -local RESOURCE_GUIDS = { "4406f0"; "816d84"; "cd15ac"; "a4b60d" } -local TRACKER_GUIDS = { "e598c2"; "b4a5f7"; "af7ed7"; "e74881" } -local CLUE_GUIDS = { "d86b7c"; "1769ed"; "032300"; "37be78" } -local CLUE_CLICKER_GUIDS = { "db85d6"; "3f22e5"; "891403"; "4111de" } -local TRASHCAN_GUIDS = { "147e80"; "f7b6c8"; "5f896a"; "4b8594"; "70b9f6" } +local PLAYERMAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" } +local RESOURCE_GUIDS = { "4406f0", "816d84", "cd15ac", "a4b60d" } +local TRACKER_GUIDS = { "e598c2", "b4a5f7", "af7ed7", "e74881" } +local CLUE_GUIDS = { "d86b7c", "1769ed", "032300", "37be78" } +local CLUE_CLICKER_GUIDS = { "db85d6", "3f22e5", "891403", "4111de" } +local TRASHCAN_GUIDS = { "147e80", "f7b6c8", "5f896a", "4b8594", "70b9f6" } -- values for physics.cast (4 entries for player zones, 5th entry for agenda/act deck, 6th for campaign log) -local PHYSICS_POSITION = { - { -54.5, 2, 21 }; - { -54.5, 2, -21 }; - { -27.0, 2, 26 }; - { -27.0, 2, -26 }; - { -02.0, 2, 10 }; +local PHYSICS_POSITION = { + { -54.5, 2, 21 }, + { -54.5, 2, -21 }, + { -27.0, 2, 26 }, + { -27.0, 2, -26 }, + { -02.0, 2, 10 }, { -00.0, 2, -27 } } -local PHYSICS_ROTATION = { 270, 270, 0, 180, 270, 0 } +local PHYSICS_ROTATION = { 270, 270, 0, 180, 270, 0 } -local PHYSICS_SCALE = { - { 36.6, 1, 14.5 }; - { 36.6, 1, 14.5 }; - { 34.0, 1, 14.5 }; - { 34.0, 1, 14.5 }; - { 55.0, 1, 13.5 }; +local PHYSICS_SCALE = { + { 36.6, 1, 14.5 }, + { 36.6, 1, 14.5 }, + { 34.0, 1, 14.5 }, + { 34.0, 1, 14.5 }, + { 55.0, 1, 13.5 }, { 05.0, 1, 05.0 } } -local optionsVisible = false -local options = {} -options["importTrauma"] = true -options["tidyPlayermats"] = true -options["removeDrawnLines"] = false +local optionsVisible = false +local options = {} +options["importTrauma"] = true +options["tidyPlayermats"] = true +options["removeDrawnLines"] = false local buttonParameters = {} buttonParameters.function_owner = self @@ -160,6 +160,7 @@ function cleanUp(_, color) printToAll("Clean up started!", "Orange") printToAll("Resetting counters...", "White") + soundCubeApi.playSoundByName("Vacuum") ignoreCustomDataHelper() getTrauma() updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror") @@ -179,7 +180,6 @@ end --------------------------------------------------------- -- modular functions, called by other functions --------------------------------------------------------- - function updateCounters(tableOfGUIDs, tableOfNewValues, info) if tonumber(tableOfNewValues) then local value = tableOfNewValues @@ -234,8 +234,8 @@ end -- read values for trauma from campaign log if enabled function getTrauma() RESET_VALUES = { - 0; 0; 0; 0; - 0; 0; 0; 0 + 0, 0, 0, 0, + 0, 0, 0, 0 } -- stop here if trauma import is disabled diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 10701019..68f56f7c 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -34,6 +34,7 @@ local hideTitleSplashWaitFunctionId = nil local playmatApi = require("playermat/PlaymatApi") local tokenManager = require("core/token/TokenManager") local playAreaAPI = require("core/PlayAreaApi") +local soundCubeApi = require("core/SoundCubeApi") local mythosAreaApi = require("core/MythosAreaApi") local tokenArrangerApi = require("accessories/TokenArrangerApi") local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi") @@ -1029,5 +1030,7 @@ function titleSplash(scenarioName) UI.hide('title_splash') hideTitleSplashWaitFunctionId = nil end, 4) + + soundCubeApi.playSoundByName("Deep Bell") end end diff --git a/src/core/SoundCubeApi.ttslua b/src/core/SoundCubeApi.ttslua new file mode 100644 index 00000000..61883ac7 --- /dev/null +++ b/src/core/SoundCubeApi.ttslua @@ -0,0 +1,21 @@ +do + local SoundCubeApi = {} + + -- this table links the name of a trigger effect to its index + local soundIndices = { + ["Vacuum"] = 0, + ["Deep Bell"] = 1 + } + + function playTriggerEffect(index) + getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index) + end + + -- plays the by name requested sound + ---@param soundName String Name of the sound to play + SoundCubeApi.playSoundByName = function(soundName) + playTriggerEffect(soundIndices[soundName]) + end + + return SoundCubeApi +end