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.
This commit is contained in:
Winter Frost
2025-08-29 15:59:23 -07:00
committed by GitHub
parent c2b8ef1d09
commit c97eaa3195
+9 -3
View File
@@ -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()