Converts 3 components into elements (#94589)

## About The Pull Request

`adjust_fishing_difficulty` is a good one to make into a bespoke element
since a number of the same clothing item are created in the wardrobe
system.

climb_walkable is also good due to how prevalent it is, and it is a bit
of a two for one since it also removes the need for the
`/component/connect_loc_behalf`

Also stops adding the on_climbable trait to literally everything in the
turf, it now only applies it to atoms with density. So no more pipes and
stuff getting trait lists created for no reason.

<details><summary> Tested + things still work as before </summary>

<img width="422" height="122" alt="image"
src="https://github.com/user-attachments/assets/b23696f5-cd16-4150-aeb3-14ea6bd256fc"
/>

</details>

## Why It's Good For The Game

Lessens overhead, fixes a bug as well.

## Changelog

🆑
fix: fixes a pushed crate not removing on_climbable trait properly off
the mob standing atop it
/🆑
This commit is contained in:
Bloop
2025-12-30 01:05:50 +01:00
committed by GitHub
parent b5055f0a42
commit cf14dcfc1a
80 changed files with 337 additions and 312 deletions
@@ -27,7 +27,7 @@
fishing_modifier -= 8
MakeRotate()
if(can_buckle && fishing_modifier)
AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier)
AddElement(/datum/element/adjust_fishing_difficulty, fishing_modifier)
/obj/structure/chair/buckle_feedback(mob/living/being_buckled, mob/buckler)
if(HAS_TRAIT(being_buckled, TRAIT_RESTRAINED))
@@ -41,7 +41,7 @@
/obj/structure/closet/crate/Initialize(mapload)
AddElement(/datum/element/climbable, climb_time = crate_climb_time, climb_stun = 0) //add element in closed state before parent init opens it(if it does)
if(elevation)
AddComponent(/datum/component/climb_walkable)
AddElement(/datum/element/climb_walkable)
AddElement(/datum/element/elevation, pixel_shift = elevation)
. = ..()
+1 -1
View File
@@ -45,7 +45,7 @@
register_context()
update_appearance(UPDATE_OVERLAYS)
AddComponent(/datum/component/climb_walkable)
AddElement(/datum/element/climb_walkable)
AddElement(/datum/element/climbable)
AddElement(/datum/element/elevation, pixel_shift = 12)
AddElement(/datum/element/give_turf_traits, string_list(turf_traits))
+1 -1
View File
@@ -16,7 +16,7 @@
)
AddElement(/datum/element/connect_loc, loc_connections)
AddComponent(/datum/component/climb_walkable)
AddElement(/datum/element/climb_walkable)
AddElement(/datum/element/simple_rotation)
register_context()
+2 -2
View File
@@ -109,7 +109,7 @@
///Adds the element used to make the object climbable, and also the one that shift the mob buckled to it up.
/obj/structure/table/proc/make_climbable()
AddComponent(/datum/component/climb_walkable)
AddElement(/datum/element/climb_walkable)
AddElement(/datum/element/climbable)
AddElement(/datum/element/elevation, pixel_shift = 12)
@@ -136,7 +136,7 @@
//proc that removes elements present in now-flipped tables
/obj/structure/table/proc/flip_table(new_dir = SOUTH)
playsound(src, flipped_table_sound, 100)
qdel(GetComponent(/datum/component/climb_walkable))
RemoveElement(/datum/element/climb_walkable)
RemoveElement(/datum/element/climbable)
RemoveElement(/datum/element/footstep_override, priority = STEP_SOUND_TABLE_PRIORITY)
RemoveElement(/datum/element/give_turf_traits, turf_traits)
+2 -2
View File
@@ -12,7 +12,7 @@
/obj/structure/toiletbong/Initialize(mapload)
. = ..()
AddElement(/datum/element/simple_rotation)
AddElement(/datum/element/simple_rotation, post_rotation_proccall = PROC_REF(post_rotation))
create_storage(storage_type = /datum/storage/toiletbong)
weed_overlay = mutable_appearance('icons/obj/watercloset.dmi', "[base_icon_state]_overlay")
@@ -83,7 +83,7 @@
return ITEM_INTERACT_SUCCESS
///Called in the simple rotation's post_rotation callback, playing a sound cue to players.
/obj/structure/toiletbong/post_rotation(mob/user, degrees)
/obj/structure/toiletbong/proc/post_rotation(mob/user, degrees)
playsound(src, 'sound/items/deconstruct.ogg', 50)
/obj/structure/toiletbong/crowbar_act(mob/living/user, obj/item/tool)
@@ -27,7 +27,7 @@
return FALSE
return TRUE
/obj/structure/c_transit_tube/post_rotation(mob/user, degrees)
/obj/structure/c_transit_tube/proc/post_rotation(mob/user, degrees)
if(flipped_build_type && degrees == ROTATION_FLIP)
setDir(turn(dir, degrees)) //Turn back we don't actually flip
flipped = !flipped
+2 -2
View File
@@ -69,7 +69,7 @@
flags_1 |= ALLOW_DARK_PAINTS_1
RegisterSignal(src, COMSIG_OBJ_PAINTED, PROC_REF(on_painted))
AddElement(/datum/element/atmos_sensitive, mapload)
AddElement(/datum/element/simple_rotation, ROTATION_NEEDS_ROOM)
AddElement(/datum/element/simple_rotation, ROTATION_NEEDS_ROOM, post_rotation_proccall = PROC_REF(post_rotation))
var/static/list/loc_connections = list(
COMSIG_ATOM_EXIT = PROC_REF(on_exit),
@@ -360,7 +360,7 @@
dropped_debris += new /obj/item/stack/rods(location, (fulltile ? 2 : 1))
return dropped_debris
/obj/structure/window/post_rotation(mob/user, degrees)
/obj/structure/window/proc/post_rotation(mob/user, degrees)
air_update_turf(TRUE, FALSE)
/obj/structure/window/proc/on_painted(obj/structure/window/source, mob/user, obj/item/toy/crayon/spraycan/spraycan, is_dark_color)