mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
Merge pull request #2736 from Crazylemon64/odysseus_resistance
Resist to escape an odysseus' sleeper
This commit is contained in:
@@ -198,6 +198,9 @@
|
||||
update_equip_info()
|
||||
return
|
||||
|
||||
container_resist(var/mob/living/L)
|
||||
go_out()
|
||||
|
||||
update_equip_info()
|
||||
if(..())
|
||||
send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_occupant_dam())
|
||||
|
||||
@@ -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()
|
||||
@@ -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
|
||||
|
||||
@@ -34,6 +34,25 @@
|
||||
for(var/mob/living/M in contents)
|
||||
M.show_message(message,m_type)
|
||||
|
||||
/obj/item/weapon/holder/container_resist(var/mob/living/L)
|
||||
var/mob/M = src.loc //Get our mob holder (if any).
|
||||
|
||||
if(istype(M))
|
||||
M.unEquip(src)
|
||||
M << "[src] wriggles out of your grip!"
|
||||
src << "You wriggle out of [M]'s grip!"
|
||||
else if(istype(src.loc,/obj/item))
|
||||
src << "You struggle free of [src.loc]."
|
||||
src.forceMove(get_turf(src))
|
||||
|
||||
if(istype(M))
|
||||
for(var/atom/A in M.contents)
|
||||
if(istype(A,/mob/living/simple_animal/borer) || istype(A,/obj/item/weapon/holder))
|
||||
return
|
||||
M.status_flags &= ~PASSEMOTES
|
||||
|
||||
return
|
||||
|
||||
//Mob procs and vars for scooping up
|
||||
/mob/living/var/holder_type
|
||||
|
||||
|
||||
@@ -499,10 +499,6 @@
|
||||
|
||||
var/mob/living/L = usr
|
||||
|
||||
//Getting out of someone's inventory.
|
||||
if(istype(src.loc,/obj/item/weapon/holder))
|
||||
resist_holder()
|
||||
|
||||
//Resisting control by an alien mind.
|
||||
if(istype(src.loc,/mob/living/simple_animal/borer))
|
||||
resist_borer()
|
||||
@@ -511,17 +507,15 @@
|
||||
if ((!(L.stat) && !(L.restrained())))
|
||||
resist_grab(L) //this passes L because the proc requires a typecasted mob/living instead of just 'src'
|
||||
|
||||
// Sliding out of a morgue/crematorium
|
||||
if(loc && (istype(loc, /obj/structure/morgue) || istype(loc, /obj/structure/crematorium)))
|
||||
resist_tray(L)
|
||||
|
||||
//unbuckling yourself
|
||||
if(L.buckled && (L.last_special <= world.time) )
|
||||
resist_buckle(L) //this passes L because the proc requires a typecasted mob/living instead of just 'src'
|
||||
|
||||
//Breaking out of a locker?
|
||||
else if(src.loc && (istype(src.loc, /obj/structure/closet)))
|
||||
resist_closet()
|
||||
//Breaking out of an object?
|
||||
else if(src.loc && istype(src.loc, /obj) && (!isturf(src.loc)))
|
||||
if(stat == CONSCIOUS && !stunned && !weakened && !paralysis)
|
||||
var/obj/C = loc
|
||||
C.container_resist(L)
|
||||
|
||||
//breaking out of handcuffs
|
||||
else if(iscarbon(L))
|
||||
@@ -540,28 +534,6 @@
|
||||
RESIST SUBPROCS
|
||||
*/////////////////////
|
||||
|
||||
/* resist_holder allows small mobs that can be picked up to get out of their holder, so they aren't stuck forever.
|
||||
*/////
|
||||
/mob/living/proc/resist_holder()
|
||||
var/obj/item/weapon/holder/H = src.loc //Get our item holder.
|
||||
var/mob/M = H.loc //Get our mob holder (if any).
|
||||
|
||||
if(istype(M))
|
||||
M.unEquip(H)
|
||||
M << "[H] wriggles out of your grip!"
|
||||
src << "You wriggle out of [M]'s grip!"
|
||||
else if(istype(H.loc,/obj/item))
|
||||
src << "You struggle free of [H.loc]."
|
||||
H.forceMove(get_turf(H))
|
||||
|
||||
if(istype(M))
|
||||
for(var/atom/A in M.contents)
|
||||
if(istype(A,/mob/living/simple_animal/borer) || istype(A,/obj/item/weapon/holder))
|
||||
return
|
||||
M.status_flags &= ~PASSEMOTES
|
||||
|
||||
return
|
||||
|
||||
/* resist_borer allows a mob to regain control of their body after a borer has assumed control.
|
||||
*/////
|
||||
/mob/living/proc/resist_borer()
|
||||
@@ -647,87 +619,6 @@
|
||||
else
|
||||
L.buckled.user_unbuckle_mob(L,L)
|
||||
|
||||
/* resist_closet() allows a mob to break out of a welded/locked closet
|
||||
*/////
|
||||
/mob/living/proc/resist_closet()
|
||||
var/breakout_time = 2 //2 minutes by default
|
||||
var/mob/living/L = src
|
||||
var/obj/structure/closet/C = L.loc
|
||||
if(C.opened)
|
||||
return //Door's open... wait, why are you in it's contents then?
|
||||
if(istype(L.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = L.loc
|
||||
if(!SC.locked && !SC.welded)
|
||||
return //It's a secure closet, but isn't locked. Easily escapable from, no need to 'resist'
|
||||
else
|
||||
if(!C.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 << "\red You lean on the back of \the [C] and start pushing the door open. (this will take about [breakout_time] minutes)"
|
||||
for(var/mob/O in viewers(usr.loc))
|
||||
O.show_message("\red <B>The [L.loc] begins to shake violently!</B>", 1)
|
||||
|
||||
|
||||
spawn(0)
|
||||
if(do_after(usr,(breakout_time*60*10), target = C)) //minutes * 60seconds * 10deciseconds
|
||||
if(!C || !L || L.stat != CONSCIOUS || L.loc != C || C.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(istype(L.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = L.loc
|
||||
if(!SC.locked && !SC.welded)
|
||||
return
|
||||
else
|
||||
if(!C.welded)
|
||||
return
|
||||
|
||||
//Well then break it!
|
||||
if(istype(usr.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = L.loc
|
||||
SC.desc = "It appears to be broken."
|
||||
SC.icon_state = SC.icon_off
|
||||
flick(SC.icon_broken, SC)
|
||||
sleep(10)
|
||||
flick(SC.icon_broken, SC)
|
||||
sleep(10)
|
||||
SC.broken = 1
|
||||
SC.locked = 0
|
||||
SC.update_icon()
|
||||
usr << "\red You successfully break out!"
|
||||
for(var/mob/O in viewers(L.loc))
|
||||
O.show_message("\red <B>\the [usr] successfully broke out of \the [SC]!</B>", 1)
|
||||
if(istype(SC.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace)
|
||||
var/obj/structure/bigDelivery/BD = SC.loc
|
||||
BD.attack_hand(usr)
|
||||
SC.open()
|
||||
else
|
||||
C.welded = 0
|
||||
C.update_icon()
|
||||
usr << "\red You successfully break out!"
|
||||
for(var/mob/O in viewers(L.loc))
|
||||
O.show_message("\red <B>\the [usr] successfully broke out of \the [C]!</B>", 1)
|
||||
if(istype(C.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above
|
||||
var/obj/structure/bigDelivery/BD = C.loc
|
||||
BD.attack_hand(usr)
|
||||
C.open()
|
||||
|
||||
// resist_tray allows a mob to slide themselves out of a morgue or crematorium
|
||||
/mob/living/proc/resist_tray(var/mob/living/carbon/CM)
|
||||
if(!istype(CM))
|
||||
return
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
usr << "<span class='alert'>You attempt to slide yourself out of \the [loc]...</span>"
|
||||
var/obj/structure/S = loc
|
||||
S.attack_hand(src)
|
||||
|
||||
/* resist_stop_drop_roll allows a mob to stop, drop, and roll in order to put out a fire burning on them.
|
||||
*/////
|
||||
/mob/living/proc/resist_stop_drop_roll(var/mob/living/carbon/CM)
|
||||
|
||||
Reference in New Issue
Block a user