From 2f8e182546eda32f78f4a94c3fb3d5f59cb7a14f Mon Sep 17 00:00:00 2001 From: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Date: Sat, 22 Nov 2025 10:33:57 -0600 Subject: [PATCH] boss music fetching length programitcly (#94054) ## About The Pull Request Sound len for boss music is fetched with rustg so we dont have to hardcode length ## Why It's Good For The Game I love code --- code/datums/components/boss_music.dm | 7 ++----- .../simple_animal/hostile/megafauna/blood_drunk_miner.dm | 2 +- .../simple_animal/hostile/megafauna/demonic_frost_miner.dm | 2 +- .../living/simple_animal/hostile/megafauna/hierophant.dm | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/code/datums/components/boss_music.dm b/code/datums/components/boss_music.dm index a5d2de4c8d5..3d7bdf896bf 100644 --- a/code/datums/components/boss_music.dm +++ b/code/datums/components/boss_music.dm @@ -12,15 +12,12 @@ ///List of callback timers, used to clear out mobs listening to boss music after `track_duration`. var/list/music_callbacks = list() -/datum/component/boss_music/Initialize( - boss_track, - track_duration, -) +/datum/component/boss_music/Initialize(boss_track) . = ..() if(!ishostile(parent)) return COMPONENT_INCOMPATIBLE src.boss_track = boss_track - src.track_duration = track_duration + track_duration = SSsounds.get_sound_length(boss_track) /datum/component/boss_music/Destroy(force) . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm index ce63bb86ab6..fb30a84e4e4 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm @@ -78,7 +78,7 @@ Difficulty: Medium dash_attack.Grant(src) transform_weapon.Grant(src) - AddComponent(/datum/component/boss_music, 'sound/music/boss/bdm_boss.ogg', 167 SECONDS) + AddComponent(/datum/component/boss_music, 'sound/music/boss/bdm_boss.ogg') /// Block deletion of their saw under normal circumstances. It is fused to their hands as far as we're concerned. /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/proc/on_saw_deleted(datum/source, force) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm index 29f4caa8a46..9449491a67e 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm @@ -81,7 +81,7 @@ Difficulty: Extremely Hard AddElement(/datum/element/knockback, 7, FALSE, TRUE) AddElement(/datum/element/lifesteal, 50) ADD_TRAIT(src, TRAIT_NO_FLOATING_ANIM, INNATE_TRAIT) - AddComponent(/datum/component/boss_music, 'sound/music/boss/bdm_boss.ogg', 167 SECONDS) + AddComponent(/datum/component/boss_music, 'sound/music/boss/bdm_boss.ogg') /mob/living/simple_animal/hostile/megafauna/demonic_frost_miner/Destroy() frost_orbs = null diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 5314d79a6a0..8541e544350 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -102,7 +102,7 @@ Difficulty: Hard /mob/living/simple_animal/hostile/megafauna/hierophant/Initialize(mapload) . = ..() spawned_beacon_ref = WEAKREF(new /obj/effect/hierophant(loc)) - AddComponent(/datum/component/boss_music, 'sound/music/boss/hiero_boss.ogg', 145 SECONDS) + AddComponent(/datum/component/boss_music, 'sound/music/boss/hiero_boss.ogg') /mob/living/simple_animal/hostile/megafauna/hierophant/Destroy() QDEL_NULL(spawned_beacon_ref)