Adds an element for noisy movement (wheelchairs, office chairs, trashcarts etc. etc.) (#76378)

## About The Pull Request
Converts generic, copypasted behavior into an element.

## Why It's Good For The Game
I'd rather not have someone just copypaste the old thing, since there're
a few more things to take into account now than just whether the item
has gravity, and if that ever has to change, we will only have to modify
one line than several.

## Changelog

🆑
fix: Fixed the office chair being silent. My bad.
/🆑
This commit is contained in:
Ghom
2023-07-01 15:30:09 +01:00
committed by GitHub
parent 4c81262346
commit 0f4be6d9b5
8 changed files with 50 additions and 48 deletions
@@ -66,6 +66,7 @@
/datum/element/contextual_screentip_bare_hands, \
rmb_text = "Fold up", \
)
AddElement(/datum/element/noisy_movement)
/obj/structure/bed/roller/examine(mob/user)
. = ..()
@@ -112,12 +113,6 @@
//Push them up from the normal lying position
M.pixel_y = M.base_pixel_y
/obj/structure/bed/roller/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/effects/roll.ogg', 100, TRUE)
/obj/structure/bed/roller/post_unbuckle_mob(mob/living/M)
set_density(FALSE)
icon_state = "down"
@@ -244,11 +244,9 @@
item_chair = null
icon_state = "officechair_dark"
/obj/structure/chair/office/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
/obj/structure/chair/office/Initialize(mapload)
. = ..()
if(!forced && CHECK_MOVE_LOOP_FLAGS(src, MOVEMENT_LOOP_OUTSIDE_CONTROL) && has_gravity())
playsound(src, 'sound/effects/roll.ogg', 100, TRUE)
AddElement(/datum/element/noisy_movement)
/obj/structure/chair/office/electrify_self(obj/item/assembly/shock_kit/input_shock_kit, mob/user, list/overlays_from_child_procs)
if(!overlays_from_child_procs)
@@ -459,6 +457,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
item_chair = null
var/turns = 0
/obj/structure/chair/bronze/Initialize(mapload)
. = ..()
AddElement(/datum/element/noisy_movement, 'sound/machines/clockcult/integration_cog_install.ogg', 50)
/obj/structure/chair/bronze/Destroy()
STOP_PROCESSING(SSfastprocess, src)
. = ..()
@@ -470,11 +472,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
if(turns >= 8)
STOP_PROCESSING(SSfastprocess, src)
/obj/structure/chair/bronze/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/machines/clockcult/integration_cog_install.ogg', 50, TRUE)
/obj/structure/chair/bronze/AltClick(mob/user)
turns = 0
if(!user.can_perform_action(src, NEED_DEXTERITY))
@@ -158,9 +158,24 @@
for (var/i in 1 to rand(2,6))
new /obj/effect/spawner/random/maintenance(src)
/obj/structure/closet/crate/trashcart //please make this a generic cart path later after things calm down a little
desc = "A heavy, metal trashcart with wheels."
name = "trash cart"
icon_state = "trashcart"
base_icon_state = "trashcart"
can_install_electronics = FALSE
paint_jobs = null
/obj/structure/closet/crate/trashcart/laundry
name = "laundry cart"
desc = "A large cart for hauling around large amounts of laundry."
icon_state = "laundry"
base_icon_state = "laundry"
/obj/structure/closet/crate/trashcart/Initialize(mapload)
. = ..()
AddElement(/datum/element/swabable, CELL_LINE_TABLE_SLUDGE, CELL_VIRUS_TABLE_GENERIC, rand(2,3), 15)
AddElement(/datum/element/noisy_movement)
/obj/structure/closet/crate/trashcart/filled
@@ -182,25 +197,6 @@
icon_state = "o2crate"
base_icon_state = "o2crate"
/obj/structure/closet/crate/trashcart //please make this a generic cart path later after things calm down a little
desc = "A heavy, metal trashcart with wheels."
name = "trash cart"
icon_state = "trashcart"
base_icon_state = "trashcart"
can_install_electronics = FALSE
paint_jobs = null
/obj/structure/closet/crate/trashcart/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/effects/roll.ogg', 100, TRUE)
/obj/structure/closet/crate/trashcart/laundry
name = "laundry cart"
desc = "A large cart for hauling around large amounts of laundry."
icon_state = "laundry"
base_icon_state = "laundry"
/obj/structure/closet/crate/medical
desc = "A medical crate."
name = "medical crate"
+4 -4
View File
@@ -354,6 +354,10 @@
icon_state = "rollingtable"
var/list/attached_items = list()
/obj/structure/table/rolling/Initialize(mapload)
. = ..()
AddElement(/datum/element/noisy_movement)
/obj/structure/table/rolling/AfterPutItemOnTable(obj/item/I, mob/living/user)
. = ..()
attached_items += I
@@ -377,10 +381,6 @@
if(!attached_movable.Move(loc))
RemoveItemFromTable(attached_movable, attached_movable.loc)
/obj/structure/table/rolling/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/effects/roll.ogg', 100, TRUE)
/*
* Glass tables
*/