From d40bb5ddd2d9a0fee78243c359a885b6348a2e6a Mon Sep 17 00:00:00 2001 From: mcbalaam <104003807+mcbalaam@users.noreply.github.com> Date: Wed, 3 Sep 2025 05:32:47 +0300 Subject: [PATCH] H.A.U.L. gauntlets and package wrapper QOL (#92427) ## About The Pull Request - Wrapping a crate with package wrapping while pulling it will now automatically make you grab it - You can now open the crate while dragging it with the H.A.U.L. gauntlets if you're the one who's pulling it. Also applies to other items (including MOD modules) that have the component https://github.com/user-attachments/assets/7b4743c8-855d-4274-89ca-b0507f6d3e0e ## Why It's Good For The Game QOL for cargo technicians - having to constantly grab and let go of crates is very annoying --- code/__DEFINES/traits/declarations.dm | 3 +++ code/_globalvars/traits/_traits.dm | 1 + code/datums/components/strong_pull.dm | 4 ++-- code/game/objects/items/stacks/wrap.dm | 2 ++ code/game/objects/structures/crates_lockers/closets.dm | 7 ++----- code/modules/mod/modules/modules_supply.dm | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 921d27118b9..92c34ed34e3 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -833,6 +833,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai ///Used for managing KEEP_TOGETHER in [/atom/var/appearance_flags] #define TRAIT_KEEP_TOGETHER "keep-together" +/// Used for ticking the crate as being strong pulled +#define TRAIT_STRONGPULL "strongpull" + // cargo traits ///If the item will block the cargo shuttle from flying to centcom #define TRAIT_BANNED_FROM_CARGO_SHUTTLE "banned_from_cargo_shuttle" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 8e5890d15fd..e6ee72fd897 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -93,6 +93,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_WADDLING" = TRAIT_WADDLING, "TRAIT_WAS_RENAMED" = TRAIT_WAS_RENAMED, "TRAIT_WEATHER_IMMUNE" = TRAIT_WEATHER_IMMUNE, + "TRAIT_STRONGPULL" = TRAIT_STRONGPULL, ), /area = list( "TRAIT_HAS_SHUTTLE_CONSTRUCTION_TURF" = TRAIT_HAS_SHUTTLE_CONSTRUCTION_TURF, diff --git a/code/datums/components/strong_pull.dm b/code/datums/components/strong_pull.dm index afb46b7252d..f2725939f79 100644 --- a/code/datums/components/strong_pull.dm +++ b/code/datums/components/strong_pull.dm @@ -29,7 +29,7 @@ Basically, the items they pull cannot be pulled (except by the puller) RegisterSignal(strongpulling, COMSIG_ATOM_NO_LONGER_PULLED, PROC_REF(on_no_longer_pulled)) if(istype(strongpulling, /obj/structure/closet) && !istype(strongpulling, /obj/structure/closet/body_bag)) var/obj/structure/closet/grabbed_closet = strongpulling - grabbed_closet.strong_grab = TRUE + ADD_TRAIT(grabbed_closet, TRAIT_STRONGPULL, REF(src)) /** * Signal for rejecting further grabs @@ -47,7 +47,7 @@ Basically, the items they pull cannot be pulled (except by the puller) UnregisterSignal(strongpulling, list(COMSIG_ATOM_CAN_BE_PULLED, COMSIG_ATOM_NO_LONGER_PULLED)) if(istype(strongpulling, /obj/structure/closet)) var/obj/structure/closet/ungrabbed_closet = strongpulling - ungrabbed_closet.strong_grab = FALSE + REMOVE_TRAIT(ungrabbed_closet, TRAIT_STRONGPULL, REF(src)) strongpulling = null /** diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm index 76194010707..600c7b3e451 100644 --- a/code/game/objects/items/stacks/wrap.dm +++ b/code/game/objects/items/stacks/wrap.dm @@ -165,6 +165,8 @@ return ITEM_INTERACT_BLOCKING if(use(3)) var/obj/item/delivery/big/parcel = new(get_turf(closet.loc)) + var/mob/being_pulled_by = closet.pulledby + being_pulled_by?.start_pulling(parcel) parcel.base_icon_state = closet.delivery_icon parcel.update_icon() parcel.drag_slowdown = closet.drag_slowdown diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 8a35511c6f4..50437e1936a 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -70,8 +70,6 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets) var/icon_broken = "sparking" /// Whether a skittish person can dive inside this closet. Disable if opening the closet causes "bad things" to happen or that it leads to a logical inconsistency. var/divable = TRUE - /// true whenever someone with the strong pull component (or magnet modsuit module) is dragging this, preventing opening - var/strong_grab = FALSE /// secure locker or not, also used if overriding a non-secure locker with a secure door overlay to add fancy lights var/secure = FALSE var/can_install_electronics = TRUE @@ -441,9 +439,8 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets) if(isliving(user)) if(!(user.mobility_flags & MOBILITY_USE)) return FALSE - if(strong_grab) - if(user) - to_chat(user, span_danger("[pulledby] has an incredibly strong grip on [src], preventing it from opening.")) + if(pulledby && user && HAS_TRAIT(src, TRAIT_STRONGPULL) && user != pulledby) + to_chat(user, span_danger("[pulledby] has an incredibly strong grip on [src], preventing it from opening.")) return FALSE var/turf/T = get_turf(src) for(var/mob/living/L in T) diff --git a/code/modules/mod/modules/modules_supply.dm b/code/modules/mod/modules/modules_supply.dm index fd4f02e51c4..75223f92162 100644 --- a/code/modules/mod/modules/modules_supply.dm +++ b/code/modules/mod/modules/modules_supply.dm @@ -343,13 +343,13 @@ if(!locker.Adjacent(mod.wearer) || !isturf(locker.loc) || !isturf(mod.wearer.loc)) return mod.wearer.start_pulling(locker) - locker.strong_grab = TRUE + ADD_TRAIT(locker, TRAIT_STRONGPULL, REF(mod.wearer)) RegisterSignal(locker, COMSIG_ATOM_NO_LONGER_PULLED, PROC_REF(on_stop_pull)) /obj/item/mod/module/magnet/proc/on_stop_pull(obj/structure/closet/locker, atom/movable/last_puller) SIGNAL_HANDLER - locker.strong_grab = FALSE + REMOVE_TRAIT(locker, TRAIT_STRONGPULL, REF(mod.wearer)) UnregisterSignal(locker, COMSIG_ATOM_NO_LONGER_PULLED) /obj/item/mod/module/ash_accretion