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
This commit is contained in:
mcbalaam
2025-09-02 21:32:47 -05:00
committed by GitHub
parent e507152713
commit d40bb5ddd2
6 changed files with 12 additions and 9 deletions
+3
View File
@@ -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"
+1
View File
@@ -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,
+2 -2
View File
@@ -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
/**
+2
View File
@@ -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
@@ -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)
+2 -2
View File
@@ -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