Merge pull request #2659 from Citadel-Station-13/upstream-merge-30412

[MIRROR] Regularizes resisting out of containers
This commit is contained in:
LetterJay
2017-09-11 18:05:52 -05:00
committed by GitHub
12 changed files with 682 additions and 620 deletions
+4
View File
@@ -49,6 +49,10 @@
open_machine()
/obj/machinery/vr_sleeper/container_resist(mob/living/user)
open_machine()
/obj/machinery/vr_sleeper/Destroy()
open_machine()
cleanup_vr_human()
@@ -32,6 +32,8 @@
var/running_bob_anim = FALSE
var/escape_in_progress = FALSE
var/message_cooldown
var/breakout_time = 0.5
/obj/machinery/atmospherics/components/unary/cryo_cell/Initialize()
. = ..()
@@ -219,7 +221,9 @@
update_icon()
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user)
container_resist(user)
if(message_cooldown <= world.time)
message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
/obj/machinery/atmospherics/components/unary/cryo_cell/open_machine(drop = 0)
if(!state_open && !panel_open)
@@ -239,16 +243,17 @@
return occupant
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
if(escape_in_progress)
to_chat(user, "<span class='notice'>You are already trying to exit (This will take around 30 seconds)</span>")
return
escape_in_progress = TRUE
to_chat(user, "<span class='notice'>You struggle inside the cryotube, kicking the release with your foot... (This will take around 30 seconds.)</span>")
audible_message("<span class='notice'>You hear a thump from [src].</span>")
if(do_after(user, 300))
if(occupant == user) // Check they're still here.
open_machine()
escape_in_progress = FALSE
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \
"<span class='notice'>You struggle inside [src], kicking the release with your foot... (this will take about [(breakout_time<1) ? "[breakout_time*60] seconds" : "[breakout_time] minute\s"].)</span>", \
"<span class='italics'>You hear a thump from [src].</span>")
if(do_after(user,(breakout_time*60*10), target = src)) //minutes * 60seconds * 10deciseconds
if(!user || user.stat != CONSCIOUS || user.loc != src )
return
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
"<span class='notice'>You successfully break out of [src]!</span>")
open_machine()
/obj/machinery/atmospherics/components/unary/cryo_cell/examine(mob/user)
..()
@@ -51,6 +51,9 @@
/obj/machinery/gibber/container_resist(mob/living/user)
go_out()
/obj/machinery/gibber/relaymove(mob/living/user)
go_out()
/obj/machinery/gibber/attack_hand(mob/user)
if(stat & (NOPOWER|BROKEN))
return
@@ -225,4 +228,4 @@
if(M.loc == input_plate)
M.forceMove(src)
M.gib()
M.gib()