Merge pull request #1047 from Yoshax/lockerfix

Fixes #985
This commit is contained in:
Datraen
2016-02-21 11:30:24 -05:00
4 changed files with 14 additions and 30 deletions
@@ -317,8 +317,6 @@
return 1
/obj/structure/closet/proc/req_breakout()
if(breakout)
return 0 //Already breaking out.
if(opened)
return 0 //Door's open... wait, why are you in it's contents then?
if(!welded)
@@ -328,10 +326,7 @@
/obj/structure/closet/proc/mob_breakout(var/mob/living/escapee)
var/breakout_time = 2 //2 minutes by default
if(!req_breakout())
return
if(!escapee.canClick())
if(breakout || !req_breakout())
return
escapee.setClickCooldown(100)
@@ -339,17 +334,14 @@
//okay, so the closet is either welded or locked... resist!!!
escapee << "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>"
visible_message("<span class='danger'>The [src] begins to shake violently!</span>")
visible_message("<span class='danger'>\The [src] begins to shake violently!</span>")
breakout = 1 //can't think of a better way to do this right now.
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1)
animate_shake()
if(!do_after(escapee, 50)) //5 seconds
breakout = 0
return
if(!escapee || escapee.stat || escapee.loc != src)
if(!escapee || escapee.incapacitated() || escapee.loc != src)
breakout = 0
return //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
@@ -357,10 +349,14 @@
breakout = 0
return
playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1)
animate_shake()
add_fingerprint(escapee)
//Well then break it!
breakout = 0
escapee << "<span class='warning'>You successfully break out!</span>"
visible_message("<span class='danger'>\the [escapee] successfully broke out of \the [src]!</span>")
visible_message("<span class='danger'>\The [escapee] successfully broke out of \the [src]!</span>")
playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1)
break_open()
animate_shake()
@@ -129,8 +129,11 @@
/obj/structure/closet/secure_closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
overlays.Cut()
if(!opened)
if(locked)
if(broken)
icon_state = icon_off
else if(locked)
icon_state = icon_locked
else
icon_state = icon_closed
@@ -139,24 +142,12 @@
else
icon_state = icon_opened
/obj/structure/closet/secure_closet/req_breakout()
if(!opened && locked) return 1
return ..() //It's a secure closet, but isn't locked.
/obj/structure/closet/secure_closet/break_open()
desc += " It appears to be broken."
icon_state = icon_off
spawn()
flick(icon_broken, src)
sleep(10)
flick(icon_broken, src)
sleep(10)
broken = 1
locked = 0
update_icon()
//Do this to prevent contents from being opened into nullspace (read: bluespace)
if(istype(loc, /obj/structure/bigDelivery))
var/obj/structure/bigDelivery/BD = loc
BD.unwrap()
open()
..()
-3
View File
@@ -155,9 +155,6 @@
return ..()
/mob/living/carbon/escape_buckle()
if(!canClick())
return
setClickCooldown(100)
if(!buckled) return
+1 -1
View File
@@ -580,7 +580,7 @@ default behaviour is:
set name = "Resist"
set category = "IC"
if(!(stat || next_move > world.time))
if(!stat && canClick())
setClickCooldown(20)
resist_grab()
if(!weakened)