Stasis Cage Exporting (#19612)

* sellable stasis cage

* Sellable mobs

* crate code cleanup

* export fix

* clamp

* sold mobs should vanish
This commit is contained in:
Will
2026-07-16 20:12:59 -04:00
committed by GitHub
parent f16080262e
commit 5d2ed77b57
19 changed files with 176 additions and 37 deletions
@@ -269,19 +269,20 @@
/obj/structure/closet/attackby(obj/item/W as obj, mob/user as mob)
if(W.has_tool_quality(TOOL_WRENCH))
if(opened)
if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
if(do_after(user, 2 SECONDS * W.toolspeed, target = src))
if(!src) return
to_chat(user, span_notice("You [anchored? "un" : ""]secured \the [src]!"))
anchored = !anchored
return
else
if(!opened)
to_chat(user, span_notice("You can't reach the anchoring bolts when the door is closed!"))
else if(opened)
return
if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
if(do_after(user, 2 SECONDS * W.toolspeed, target = src))
if(!src) return
to_chat(user, span_notice("You [anchored? "un" : ""]secured \the [src]!"))
anchored = !anchored
return
if(opened)
if(istype(W, /obj/item/grab))
var/obj/item/grab/G = W
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
@@ -319,9 +320,15 @@
if(W)
W.do_drop_animation(user)
W.forceMove(loc)
else if(istype(W, /obj/item/packageWrap))
return
else if(seal_tool)
if(istype(W, /obj/item/packageWrap))
return
if(istype(W,/obj/item/cargo_scanner))
return
if(seal_tool)
if(istype(W, seal_tool))
var/obj/item/S = W
if(S.has_tool_quality(TOOL_WELDER))
@@ -338,9 +345,9 @@
update_icon()
for(var/mob/M in viewers(src))
M.show_message(span_warning("[src] has been [sealed?"sealed":"unsealed"] by [user.name]."), 3)
else
attack_hand(user)
return
return
return attack_hand(user)
/obj/structure/closet/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if(istype(O, /atom/movable/screen)) //fix for HUD elements making their way into the world -Pete
@@ -74,9 +74,11 @@
/obj/structure/closet/crate/attackby(obj/item/W as obj, mob/user as mob)
if(W.has_tool_quality(TOOL_WRENCH) && istype(src,/obj/structure/closet/crate/bin))
return ..()
else if(W.has_tool_quality(TOOL_WELDER))
if(W.has_tool_quality(TOOL_WELDER))
return ..()
else if(opened)
if(opened)
if(isrobot(user))
return
if(W.loc != user) // This should stop mounted modules ending up outside the module.
@@ -86,9 +88,15 @@
user.drop_item()
if(W)
W.forceMove(src.loc)
else if(istype(W, /obj/item/packageWrap))
return
else if(istype(W, /obj/item/stack/cable_coil))
if(istype(W, /obj/item/packageWrap))
return
if(istype(W,/obj/item/cargo_scanner))
return
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(rigged)
to_chat(user, span_notice("[src] is already rigged!"))
@@ -97,19 +105,22 @@
to_chat(user , span_notice("You rig [src]."))
rigged = 1
return
else if(istype(W, /obj/item/radio/electropack))
if(istype(W, /obj/item/radio/electropack))
if(rigged)
to_chat(user , span_notice("You attach [W] to [src]."))
user.drop_item()
W.forceMove(src)
return
else if(W.has_tool_quality(TOOL_WIRECUTTER))
return
if(W.has_tool_quality(TOOL_WIRECUTTER))
if(rigged)
to_chat(user , span_notice("You cut away the wiring."))
playsound(src, W.usesound, 100, 1)
rigged = 0
return
else return attack_hand(user)
return
return attack_hand(user)
/obj/structure/closet/crate/ex_act(severity)
switch(severity)
+8 -2
View File
@@ -14,6 +14,7 @@
var/mob/living/simple_mob/A = locate() in loc
if(A)
contain(A)
AddElement(/datum/element/sellable/stasis_cage)
/obj/structure/stasis_cage/attack_hand(mob/user)
release()
@@ -48,9 +49,14 @@
desc = initial(desc)
/obj/structure/stasis_cage/Destroy()
// If sold by cargo, we need to delete our contents instead of releasing them
// Check for admin z instead of shuttle area. Cause destroying it on the station will make the mob qdel.
if(z in using_map.admin_levels)
for(var/atom/thing in contents)
qdel(thing)
contained = null
release()
return ..()
. = ..()
/mob/living/simple_mob/MouseDrop(obj/structure/stasis_cage/over_object)
if(istype(over_object) && Adjacent(over_object) && CanMouseDrop(over_object, usr))