Files
Paradise/code/game/machinery/morgue.dm
mport2004@gmail.com 17ed3899c4 Fixed the map/code issues that the body bags caused.
/obj/effects is now /obj/effect.
/obj/station_objects is now /obj/structure.
Did a bit of minor blob work. 
The Bay 12 body bags were replaced with closets because having two sets of code that do almost the same thing is silly.
Changed back a few of the last jobproc edits as the remove from list before assign was a check to see if the mob was fucked up and if it was remove it so we did not check it again as it would still be fucked up.
The medbay/tox monkeys names are random once more.  More random name monkeys will help with changeling and clean up the observe/mob menus.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2324 316c924e-a436-60f5-8080-3fe189b3f50e
2011-10-03 10:28:57 +00:00

333 lines
9.2 KiB
Plaintext

/obj/structure/morgue/proc/update()
if (src.connected)
src.icon_state = "morgue0"
else
if (src.contents.len)
src.icon_state = "morgue2"
else
src.icon_state = "morgue1"
return
/obj/structure/morgue/ex_act(severity)
switch(severity)
if(1.0)
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
del(src)
return
if(2.0)
if (prob(50))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
del(src)
return
if(3.0)
if (prob(5))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
del(src)
return
return
/obj/structure/morgue/alter_health()
return src.loc
/obj/structure/morgue/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/morgue/attack_hand(mob/user as mob)
if (src.connected)
for(var/atom/movable/A as mob|obj in src.connected.loc)
if (!( A.anchored ))
A.loc = src
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
//src.connected = null
del(src.connected)
else
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
src.connected = new /obj/structure/m_tray( src.loc )
step(src.connected, EAST)
src.connected.layer = OBJ_LAYER
var/turf/T = get_step(src, EAST)
if (T.contents.Find(src.connected))
src.connected.connected = src
src.icon_state = "morgue0"
for(var/atom/movable/A as mob|obj in src)
A.loc = src.connected.loc
src.connected.icon_state = "morguet"
else
//src.connected = null
del(src.connected)
src.add_fingerprint(user)
update()
return
/obj/structure/morgue/attackby(P as obj, mob/user as mob)
if (istype(P, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
if (user.equipped() != P)
return
if ((!in_range(src, usr) && src.loc != user))
return
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
if (t)
src.name = text("Morgue- '[]'", t)
else
src.name = "Morgue"
src.add_fingerprint(user)
return
/obj/structure/morgue/relaymove(mob/user as mob)
if (user.stat)
return
src.connected = new /obj/structure/m_tray( src.loc )
step(src.connected, EAST)
src.connected.layer = OBJ_LAYER
var/turf/T = get_step(src, EAST)
if (T.contents.Find(src.connected))
src.connected.connected = src
src.icon_state = "morgue0"
for(var/atom/movable/A as mob|obj in src)
A.loc = src.connected.loc
//Foreach goto(106)
src.connected.icon_state = "morguet"
else
//src.connected = null
del(src.connected)
return
/obj/structure/m_tray/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover, /obj/item/weapon/dummy))
return 1
else
return ..()
/obj/structure/m_tray/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/m_tray/attack_hand(mob/user as mob)
if (src.connected)
for(var/atom/movable/A as mob|obj in src.loc)
if (!( A.anchored ))
A.loc = src.connected
//Foreach goto(26)
src.connected.connected = null
src.connected.update()
add_fingerprint(user)
//SN src = null
del(src)
return
return
/obj/structure/m_tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if (istype(O, /obj/structure/closet/body_bag) || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src))
O.loc = src.loc
for(var/mob/B in viewers(user, 3))
if ((B.client && !( B.blinded )))
B << text("\red [] stuffs the bodybag into []!", user, src)
return
if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)))
return
if (!ismob(O))
return
O.loc = src.loc
if (user != O)
for(var/mob/B in viewers(user, 3))
if ((B.client && !( B.blinded )))
B << text("\red [] stuffs [] into []!", user, O, src)
//Foreach goto(99)
return
/obj/structure/crematorium/proc/update()
if (src.connected)
src.icon_state = "crema0"
else
if (src.contents.len)
src.icon_state = "crema2"
else
src.icon_state = "crema1"
return
/obj/structure/crematorium/ex_act(severity)
switch(severity)
if(1.0)
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
del(src)
return
if(2.0)
if (prob(50))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
del(src)
return
if(3.0)
if (prob(5))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
del(src)
return
return
/obj/structure/crematorium/alter_health()
return src.loc
/obj/structure/crematorium/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/crematorium/attack_hand(mob/user as mob)
// if (cremating) AWW MAN! THIS WOULD BE SO MUCH MORE FUN ... TO WATCH
// user.show_message("\red Uh-oh, that was a bad idea.", 1)
// //usr << "Uh-oh, that was a bad idea."
// src:loc:poison += 20000000
// src:loc:firelevel = src:loc:poison
// return
if (cremating)
usr << "\red It's locked."
return
if ((src.connected) && (src.locked == 0))
for(var/atom/movable/A as mob|obj in src.connected.loc)
if (!( A.anchored ))
A.loc = src
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
//src.connected = null
del(src.connected)
else if (src.locked == 0)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
src.connected = new /obj/structure/c_tray( src.loc )
step(src.connected, SOUTH)
src.connected.layer = OBJ_LAYER
var/turf/T = get_step(src, SOUTH)
if (T.contents.Find(src.connected))
src.connected.connected = src
src.icon_state = "crema0"
for(var/atom/movable/A as mob|obj in src)
A.loc = src.connected.loc
src.connected.icon_state = "cremat"
else
//src.connected = null
del(src.connected)
src.add_fingerprint(user)
update()
/obj/structure/crematorium/attackby(P as obj, mob/user as mob)
if (istype(P, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
if (user.equipped() != P)
return
if ((!in_range(src, usr) > 1 && src.loc != user))
return
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
if (t)
src.name = text("Crematorium- '[]'", t)
else
src.name = "Crematorium"
src.add_fingerprint(user)
return
/obj/structure/crematorium/relaymove(mob/user as mob)
if (user.stat || locked)
return
src.connected = new /obj/structure/c_tray( src.loc )
step(src.connected, SOUTH)
src.connected.layer = OBJ_LAYER
var/turf/T = get_step(src, SOUTH)
if (T.contents.Find(src.connected))
src.connected.connected = src
src.icon_state = "crema0"
for(var/atom/movable/A as mob|obj in src)
A.loc = src.connected.loc
//Foreach goto(106)
src.connected.icon_state = "cremat"
else
//src.connected = null
del(src.connected)
return
/obj/structure/crematorium/proc/cremate(atom/A, mob/user as mob)
// for(var/obj/machinery/crema_switch/O in src) //trying to figure a way to call the switch, too drunk to sort it out atm
// if(var/on == 1)
// return
if(cremating)
return //don't let you cremate something twice or w/e
if(length(contents) == 0)
for (var/mob/M in viewers(user))
M.show_message("\red You hear a hollow crackle.", 1)
return
else if(contents)
cremating = 1
locked = 1
for (var/mob/living/M in contents)
M:stunned = 100 //You really dont want to place this inside the loop.
spawn(1)
for(var/i=1 to 10)
sleep(10)
M.take_overall_damage(0,30)
if (M.stat!=2 && prob(30))
M.emote("scream")
new /obj/effect/decal/ash(src)
for (var/obj/item/W in M)
if (prob(10))
W.loc = src
M.death(1)
M.ghostize()
del(M)
cremating = 0
locked = 0
playsound(src.loc, 'ding.ogg', 50, 1)
for (var/mob/M in viewers(src))
M.show_message("\red You hear a roar as the crematorium activates.", 1)
return
/obj/structure/c_tray/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover, /obj/item/weapon/dummy))
return 1
else
return ..()
/obj/structure/c_tray/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/c_tray/attack_hand(mob/user as mob)
if (src.connected)
for(var/atom/movable/A as mob|obj in src.loc)
if (!( A.anchored ))
A.loc = src.connected
//Foreach goto(26)
src.connected.connected = null
src.connected.update()
add_fingerprint(user)
//SN src = null
del(src)
return
return
/obj/structure/c_tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)))
return
O.loc = src.loc
if (user != O)
for(var/mob/B in viewers(user, 3))
if ((B.client && !( B.blinded )))
B << text("\red [] stuffs [] into []!", user, O, src)
//Foreach goto(99)
return
/obj/machinery/crema_switch/attack_hand(mob/user as mob)
if(src.allowed(usr))
for (var/obj/structure/crematorium/C in world)
if (C.id == id)
if (!C.cremating)
C.cremate(user)
else
usr << "\red Access denied."
return