From c97eaa3195d503beb95ff520ef940798aebe9fed Mon Sep 17 00:00:00 2001 From: Winter Frost <98187980+RealWinterFrost@users.noreply.github.com> Date: Fri, 29 Aug 2025 15:59:23 -0700 Subject: [PATCH] de-hardcodes some of /obj/structure/table (#92740) ## About The Pull Request Adds new variables and removes minor hardcoding with the `/obj/structure/table` adding the variables `var/flipped_table_icon` `var/unflip_table_sound` `var/flipped_table_sound` ## Why It's Good For The Game This will provide more modular-ability, maintenance, and general care for changes up and down the stream. allowing modules and individual things to be made without affecting the /TG/ master files. Including with these new sound variables, it allows further control over how things should sound, not having to code-dive to find and change anything. Making it much easier to control. ## Changelog No player facing changes. --- code/game/objects/structures/tables_racks.dm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index fb2de1dd0ed..d1ce7c6f34b 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -52,6 +52,12 @@ var/matrix/before_flipped_matrix /// Do we place people onto the table rather than slamming them? var/slam_gently = FALSE + /// Where icon is our flipped table located in? + var/flipped_table_icon = 'icons/obj/flipped_tables.dmi' + /// What sound does the table make when unflipped? + var/unflip_table_sound = 'sound/items/trayhit/trayhit2.ogg' + /// What sound does the table make when we flip the table? + var/flipped_table_sound = 'sound/items/trayhit/trayhit1.ogg' /obj/structure/table/Initialize(mapload, obj/structure/table_frame/frame_used, obj/item/stack/stack_used) . = ..() @@ -109,7 +115,7 @@ //proc that adds elements present in normal tables /obj/structure/table/proc/unflip_table() - playsound(src, 'sound/items/trayhit/trayhit2.ogg', 100) + playsound(src, unflip_table_sound, 100) make_climbable() AddElement(/datum/element/give_turf_traits, turf_traits) AddElement(/datum/element/footstep_override, priority = STEP_SOUND_TABLE_PRIORITY) @@ -129,7 +135,7 @@ //proc that removes elements present in now-flipped tables /obj/structure/table/proc/flip_table(new_dir = SOUTH) - playsound(src, 'sound/items/trayhit/trayhit1.ogg', 100) + playsound(src, flipped_table_sound, 100) qdel(GetComponent(/datum/component/climb_walkable)) RemoveElement(/datum/element/climbable) RemoveElement(/datum/element/footstep_override, priority = STEP_SOUND_TABLE_PRIORITY) @@ -170,7 +176,7 @@ transform_matrix.Turn(270) animate(src, transform = transform_matrix, time = 0) else - icon = 'icons/obj/flipped_tables.dmi' + icon = flipped_table_icon icon_state = base_icon_state update_appearance()