Files
CHOMPstation/code/game/machinery/morgue.dm
T
johnsonmt88@gmail.com ba18f631c0 Emergency Field Generators are now live!
- Now have an emp_act
- Can now be (un)locked by engineering IDs

Reverted ghosts getting mob attack logs and moving the ghost verb to clients
- This should fix the ghosting issues, but it's possible I've missed something. If there's any problems ping me(Nodrak) in #coderbus on IRC and I'll fix it.
- Attack logs moving to ghosts would be an amazing feature, it's not that admins can't get that information already but it makes it much easier. If it can be implemented without all of these bugs, it'd defiantly be an asset
- Fixes Issue 647

Removed logging from the cremator as it was causing runtimes and the cremator to lock up. Fixes Issue 649

Fixed an issue with unjobbanning players.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4044 316c924e-a436-60f5-8080-3fe189b3f50e
2012-07-11 19:55:20 +00:00

345 lines
9.7 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.get_active_hand() != 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, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O)))
return
if (!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
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)
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.get_active_hand() != 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(src))
M.show_message("\red You hear a hollow crackle.", 1)
return
else if(contents)
for (var/mob/M in viewers(src))
M.show_message("\red You hear a roar as the crematorium activates.", 1)
cremating = 1
locked = 1
if(locate(/mob/living/, src))
for (var/obj/item/I in contents)
del(I)
for (var/mob/living/M in contents)
M.Stun(100) //You really dont want to place this inside the loop.
spawn(1)
for(var/i=1 to 10)
sleep(10)
if(M)
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
//Logging for this runtimes and causes the cremator to lock up
//M.attack_log += "\[[time_stamp()]\] Has been cremated by <b>[user]/[user.ckey]</b>" //No point when the mob's about to be deleted
//user.attack_log +="\[[time_stamp()]\] Cremated <b>[M]/[M.ckey]</b>"
//log_attack("\[[time_stamp()]\] <b>[user]/[user.ckey]</b> gibbed <b>[M]/[M.ckey]</b>")
M.death(1)
M.ghostize()
del(M)
cremating = 0
locked = 0
playsound(src.loc, 'ding.ogg', 50, 1)
else
for(var/obj/item/I in contents)
if(!istype(I, /obj/item/weapon/disk/nuclear))
del(I)
new /obj/effect/decal/ash(src)
sleep(30)
cremating = 0
locked = 0
playsound(src.loc, 'ding.ogg', 50, 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) || user.contents.Find(O)))
return
if (!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
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