mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 00:21:11 +01:00
Stasis Cages - Bugfixes & QoL (#22982)
changes: - qol: "Mobs in animal traps can now be transferred directly to Stasis Cages by click-dragging rather than requiring them to be in a net." - bugfix: "Mobs can no longer use their ranged attacks while contained inside objects (including animal traps)." - bugfix: "Stasis cages now apply stasis only while powered and correctly clear it when releasing simplemobs." - bugfix: "Fixes stasis cage transfers race condition freeing trapped animals randomly." - bugfix: "Corrects stasis cage safety-wire status display."
This commit is contained in:
@@ -524,6 +524,7 @@
|
||||
unbuckle()
|
||||
return
|
||||
|
||||
capturing_mob.captured = TRUE
|
||||
captured = WEAKREF(capturing_mob)
|
||||
|
||||
playsound(src, 'sound/weapons/beartrap_shut.ogg', 100, 1)
|
||||
@@ -674,10 +675,10 @@
|
||||
if(captured_mob)
|
||||
captured_mob.bullet_act(arglist(args))
|
||||
|
||||
/obj/item/trap/animal/proc/release(var/mob/user, var/turf/target)
|
||||
/obj/item/trap/animal/proc/release(var/mob/user, var/turf/target, var/transferring = FALSE)
|
||||
if(!target)
|
||||
target = src.loc
|
||||
if(user)
|
||||
if(user && !transferring)
|
||||
visible_message(SPAN_NOTICE("[user] opens \the [src]."))
|
||||
|
||||
var/mob/captured_mob = captured ? captured.resolve() : null
|
||||
@@ -690,10 +691,12 @@
|
||||
var/mob/living/living_mob = captured_mob
|
||||
msg = SPAN_WARNING("[living_mob] runs out of \the [src].")
|
||||
|
||||
captured_mob.captured = FALSE
|
||||
unbuckle()
|
||||
captured = null
|
||||
visible_message(msg)
|
||||
shake_animation()
|
||||
if(!transferring)
|
||||
visible_message(msg)
|
||||
shake_animation()
|
||||
update_icon()
|
||||
layer = initial(layer)
|
||||
|
||||
@@ -779,6 +782,17 @@
|
||||
if(.)
|
||||
sync_captured_mob()
|
||||
|
||||
/obj/item/trap/animal/post_buckle(atom/movable/MA)
|
||||
if(MA == buckled || !isliving(MA))
|
||||
return
|
||||
|
||||
var/mob/living/released_mob = MA
|
||||
released_mob.captured = FALSE
|
||||
if(captured?.resolve() == released_mob)
|
||||
captured = null
|
||||
layer = initial(layer)
|
||||
update_icon()
|
||||
|
||||
/obj/item/trap/animal/attack_hand(mob/user)
|
||||
if(user.loc == src || captured)
|
||||
return
|
||||
|
||||
@@ -69,7 +69,10 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/machinery/stasis_cage/process(seconds_per_tick)
|
||||
if (use_power || !cell || !cell.charge)
|
||||
if (!use_power || !cell || !cell.charge)
|
||||
if (isanimal(contained))
|
||||
var/mob/living/simple_animal/SA = contained
|
||||
SA.in_stasis = FALSE
|
||||
return
|
||||
cell.use(2 * seconds_per_tick)
|
||||
if (contained)
|
||||
@@ -100,7 +103,10 @@
|
||||
release()
|
||||
|
||||
/obj/structure/machinery/stasis_cage/proc/release()
|
||||
if (contained)
|
||||
if(contained)
|
||||
if(isanimal(contained))
|
||||
var/mob/living/simple_animal/SA = contained
|
||||
SA.in_stasis = FALSE
|
||||
contained.dropInto(src)
|
||||
contained = null
|
||||
playsound(get_turf(src), 'sound/machines/airlock.ogg', 40)
|
||||
@@ -249,6 +255,12 @@
|
||||
playsound(src, 'sound/machines/AirlockClose.ogg', 100)
|
||||
add_fingerprint(user)
|
||||
if (do_after(user, 2 SECONDS, src))
|
||||
if(QDELETED(target) || contained || broken || !use_power)
|
||||
return
|
||||
if(target.buckled_to)
|
||||
target.buckled_to.unbuckle()
|
||||
if(istype(target.buckled_to, /obj/item/trap/animal))
|
||||
var/obj/item/trap/animal/animal_trap = target.buckled_to
|
||||
animal_trap.release(transferring = TRUE)
|
||||
else
|
||||
target.buckled_to.unbuckle()
|
||||
contain(user, target)
|
||||
|
||||
Reference in New Issue
Block a user