Merge pull request #2736 from Crazylemon64/odysseus_resistance

Resist to escape an odysseus' sleeper
This commit is contained in:
TheDZD
2015-12-06 15:59:08 -05:00
7 changed files with 136 additions and 117 deletions
+3
View File
@@ -256,3 +256,6 @@ a {
anchored = 0
step_towards(src,S)
else step_towards(src,S)
/obj/proc/container_resist(var/mob/living)
return
@@ -365,3 +365,42 @@
open()
if(AM.loc == src) return 0
return 1
/obj/structure/closet/container_resist(var/mob/living/L)
var/breakout_time = 2 //2 minutes by default
if(opened)
if (L.loc == src)
L.forceMove(get_turf(src)) // Let's just be safe here
return //Door's open... wait, why are you in it's contents then?
if(!welded)
return //closed but not welded...
// else Meh, lets just keep it at 2 minutes for now
// breakout_time++ //Harder to get out of welded lockers than locked lockers
//okay, so the closet is either welded or locked... resist!!!
L.changeNext_move(CLICK_CD_BREAKOUT)
L.last_special = world.time + CLICK_CD_BREAKOUT
L << "<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>"
for(var/mob/O in viewers(usr.loc))
O.show_message("<span class='danger'>The [src] begins to shake violently!</span>", 1)
spawn(0)
if(do_after(L,(breakout_time*60*10), target = src)) //minutes * 60seconds * 10deciseconds
if(!src || !L || L.stat != CONSCIOUS || L.loc != src || opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
return
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
if(!welded)
return
//Well then break it!
welded = 0
update_icon()
usr << "<span class='warning'>You successfully break out!</span>"
for(var/mob/O in viewers(L.loc))
O.show_message("<span class='danger'>\the [usr] successfully broke out of \the [src]!</span>", 1)
if(istype(src.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above
var/obj/structure/bigDelivery/BD = src.loc
BD.attack_hand(usr)
open()
@@ -127,4 +127,49 @@
if(welded)
overlays += "welded"
else
icon_state = icon_opened
icon_state = icon_opened
/obj/structure/closet/secure_closet/container_resist(var/mob/living/L)
var/breakout_time = 2 //2 minutes by default
if(opened)
if (L.loc == src)
L.forceMove(get_turf(src)) // Let's just be safe here
return //Door's open... wait, why are you in it's contents then?
if(!locked && !welded)
return //It's a secure closet, but isn't locked. Easily escapable from, no need to 'resist'
//okay, so the closet is either welded or locked... resist!!!
L.changeNext_move(CLICK_CD_BREAKOUT)
L.last_special = world.time + CLICK_CD_BREAKOUT
L << "<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>"
for(var/mob/O in viewers(src))
O.show_message("<span class='danger'>The [src] begins to shake violently!</span>", 1)
spawn(0)
if(do_after(usr,(breakout_time*60*10), target = src)) //minutes * 60seconds * 10deciseconds
if(!src || !L || L.stat != CONSCIOUS || L.loc != src || opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
return
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
if(!locked && !welded)
return
//Well then break it!
desc = "It appears to be broken."
icon_state = icon_off
flick(icon_broken, src)
sleep(10)
flick(icon_broken, src)
sleep(10)
broken = 1
locked = 0
welded = 0
update_icon()
usr << "\red You successfully break out!"
for(var/mob/O in viewers(L.loc))
O.show_message("<span class='danger'>\the [usr] successfully broke out of \the [src]!</span>", 1)
if(istype(src.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace)
var/obj/structure/bigDelivery/BD = src.loc
BD.attack_hand(usr)
open()
+21 -2
View File
@@ -143,6 +143,16 @@
connected = null
return ..()
/obj/structure/morgue/container_resist(var/mob/living/L)
var/mob/living/carbon/CM = L
if(!istype(CM))
return
if (CM.stat || CM.restrained())
return
CM << "<span class='alert'>You attempt to slide yourself out of \the [src]...</span>"
src.attack_hand(CM)
/*
* Morgue tray
@@ -314,12 +324,12 @@
if(contents.len <= 0)
for (var/mob/M in viewers(src))
M.show_message("\red You hear a hollow crackle.", 1)
M.show_message("<span class='warning'>You hear a hollow crackle.</span>", 1)
return
else
for (var/mob/M in viewers(src))
M.show_message("\red You hear a roar as the crematorium activates.", 1)
M.show_message("<span class='warning'>You hear a roar as the crematorium activates.</span>", 1)
cremating = 1
locked = 1
@@ -355,6 +365,15 @@
connected = null
return ..()
/obj/structure/crematorium/container_resist(var/mob/living/L)
var/mob/living/carbon/CM = L
if(!istype(CM))
return
if (CM.stat || CM.restrained())
return
CM << "<span class='alert'>You attempt to slide yourself out of \the [src]...</span>"
src.attack_hand(CM)
/*
* Crematorium tray