Files
Bubberstation/code/modules/mob/living/carbon/death.dm
T
bf30153a12 [MIRROR] Few minor runtime fixes [MDB IGNORE] (#9116)
* Few minor runtime fixes

* Fixing merge conflicts

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2021-10-29 11:35:52 -04:00

79 lines
2.7 KiB
Plaintext

/mob/living/carbon/death(gibbed)
if(stat == DEAD)
return
silent = FALSE
losebreath = 0
if(!gibbed)
INVOKE_ASYNC(src, .proc/emote, "deathgasp")
reagents.end_metabolization(src)
add_memory_in_range(src, 7, MEMORY_DEATH, list(DETAIL_PROTAGONIST = src), memory_flags = MEMORY_FLAG_NOMOOD, story_value = STORY_VALUE_OKAY, memory_flags = MEMORY_CHECK_BLIND_AND_DEAF)
. = ..()
if(!gibbed)
attach_rot()
for(var/T in get_traumas())
var/datum/brain_trauma/BT = T
BT.on_death()
/mob/living/carbon/proc/inflate_gib() // Plays an animation that makes mobs appear to inflate before finally gibbing
addtimer(CALLBACK(src, .proc/gib, null, null, TRUE, TRUE), 25)
var/matrix/M = matrix()
M.Scale(1.8, 1.2)
animate(src, time = 40, transform = M, easing = SINE_EASING)
/mob/living/carbon/gib(no_brain, no_organs, no_bodyparts, safe_gib = FALSE)
add_memory_in_range(src, 7, MEMORY_GIBBED, list(DETAIL_PROTAGONIST = src), STORY_VALUE_AMAZING, MEMORY_FLAG_NOMOOD, memory_flags = MEMORY_CHECK_BLINDNESS)
if(safe_gib) // If you want to keep all the mob's items and not have them deleted
for(var/obj/item/W in src)
dropItemToGround(W)
if(prob(50))
step(W, pick(GLOB.alldirs))
var/atom/Tsec = drop_location()
for(var/mob/M in src)
M.forceMove(Tsec)
visible_message(span_danger("[M] bursts out of [src]!"))
. = ..()
/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
var/atom/Tsec = drop_location()
if(!no_bodyparts)
if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop.
for(var/X in internal_organs)
if(no_brain || !istype(X, /obj/item/organ/brain))
qdel(X)
else //we're going to drop all bodyparts except chest, so the only organs that needs spilling are those inside it.
for(var/X in internal_organs)
var/obj/item/organ/O = X
if(no_brain && istype(O, /obj/item/organ/brain))
qdel(O) //so the brain isn't transfered to the head when the head drops.
continue
var/org_zone = check_zone(O.zone) //both groin and chest organs.
if(org_zone == BODY_ZONE_CHEST)
O.Remove(src)
O.forceMove(Tsec)
O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
else
for(var/X in internal_organs)
var/obj/item/organ/I = X
if(no_brain && istype(I, /obj/item/organ/brain))
qdel(I)
continue
if(no_organs && !istype(I, (/obj/item/organ/brain || /obj/item/organ/corticalstack))) //Skyrat edit - Neural Laces - babyproofed
qdel(I)
continue
I.Remove(src)
I.forceMove(Tsec)
I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
/mob/living/carbon/spread_bodyparts()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
BP.drop_limb()
BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)