Converts table_smash component into an element (#94585)

## About The Pull Request

<img width="573" height="30" alt="firefox_EhVA73C1LZ"
src="https://github.com/user-attachments/assets/f77baf9c-2585-4cb7-a08f-5ce8322b0a54"
/>

## Why It's Good For The Game

Less overhead and memory usage.

## Changelog

🆑
refactor: refactors table_smash component into an element
/🆑
This commit is contained in:
Bloop
2025-12-25 00:25:49 +01:00
committed by GitHub
parent cab86affff
commit e90fca25d4
4 changed files with 69 additions and 68 deletions
+1 -1
View File
@@ -50,7 +50,7 @@
AddElement(/datum/element/elevation, pixel_shift = 12)
AddElement(/datum/element/give_turf_traits, string_list(turf_traits))
AddElement(/datum/element/footstep_override, footstep = footstep, priority = STEP_SOUND_TABLE_PRIORITY)
AddComponent(/datum/component/table_smash)
AddElement(/datum/element/table_smash)
/obj/structure/platform/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
+7 -7
View File
@@ -91,10 +91,10 @@
make_climbable()
AddElement(/datum/element/give_turf_traits, string_list(turf_traits))
AddElement(/datum/element/footstep_override, priority = STEP_SOUND_TABLE_PRIORITY)
AddComponent(/datum/component/table_smash, gentle_push = slam_gently, after_smash = CALLBACK(src, PROC_REF(after_smash)))
AddElement(/datum/element/table_smash, gentle_push = slam_gently)
/// Called after someone is harmfully smashed into us
/obj/structure/table/proc/after_smash(mob/living/smashed)
/obj/structure/table/after_smash(mob/living/smashed_onto)
return // This is mostly for our children
/// Applies additional properties based on the frame used to construct this table.
@@ -633,7 +633,7 @@
canSmoothWith = SMOOTH_GROUP_WOOD_TABLES
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT)
/obj/structure/table/wood/after_smash(mob/living/smashed)
/obj/structure/table/wood/after_smash(mob/living/smashed_onto)
if(QDELETED(src) || prob(66))
return
visible_message(
@@ -642,9 +642,9 @@
)
playsound(src, 'sound/effects/wounds/crack2.ogg', 50, TRUE)
smashed.Knockdown(10 SECONDS)
smashed.Paralyze(2 SECONDS)
smashed.apply_damage(20, BRUTE)
smashed_onto.Knockdown(10 SECONDS)
smashed_onto.Paralyze(2 SECONDS)
smashed_onto.apply_damage(20, BRUTE)
deconstruct(FALSE)
/obj/structure/table/wood/narsie_act(total_override = TRUE)
@@ -855,7 +855,7 @@
canSmoothWith = SMOOTH_GROUP_BRONZE_TABLES
can_flip = FALSE
/obj/structure/table/bronze/after_smash(mob/living/pushed_mob)
/obj/structure/table/bronze/after_smash(mob/living/smashed_onto)
playsound(src, 'sound/effects/magic/clockwork/fellowship_armory.ogg', 50, TRUE)
/obj/structure/table/reinforced/rglass