This commit is contained in:
NanakoAC
2016-08-02 19:46:57 +01:00
committed by skull132
parent 83ed43896e
commit eba855d423
3 changed files with 61 additions and 11 deletions
@@ -343,28 +343,33 @@
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)
return 0 //closed but not welded...
return 1
if(welded)
return 1 //closed but not welded...
if(breakout)
return -1 //Already breaking out.
return 0
/obj/structure/closet/proc/mob_breakout(var/mob/living/escapee)
var/breakout_time = 2 //2 minutes by default
if(!req_breakout())
//Improved by nanako
//Now it actually works, also locker breakout time stacks with locking and welding
//This means secure lockers are more useful for imprisoning people
var/breakout_time = 1.5 * req_breakout()//1.5 minutes if locked or welded, 3 minutes if both
if(breakout_time <= 0)
return
//okay, so the closet is either welded or locked... resist!!!
escapee.next_move = world.time + 100
escapee.last_special = world.time + 100
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>")
breakout = 1 //can't think of a better way to do this right now.
breakout = 1
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()
@@ -118,6 +118,8 @@
if(ishuman(usr))
src.add_fingerprint(usr)
src.togglelock(usr)
else if(istype(usr, /mob/living/silicon/robot) && Adjacent(usr))
src.togglelock(usr)
else
usr << "<span class='warning'>This mob type can't use this verb.</span>"
@@ -135,8 +137,13 @@
/obj/structure/closet/secure_closet/req_breakout()
if(!opened && locked) return 1
return ..() //It's a secure closet, but isn't locked.
if(!opened && locked)
if (welded)
return 2
else
return 1
else
return ..() //It's a secure closet, but isn't locked.
/obj/structure/closet/secure_closet/break_open()
desc += " It appears to be broken."
@@ -147,6 +154,7 @@
flick(icon_broken, src)
sleep(10)
broken = 1
welded = 0
locked = 0
update_icon()
//Do this to prevent contents from being opened into nullspace (read: bluespace)