-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathdeath.dm
114 lines (90 loc) · 2.9 KB
/
death.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
GLOBAL_VAR_INIT(permadeath, FALSE)
/mob/living/proc/gib(no_brain, no_organs, no_bodyparts, no_items)
var/prev_lying = lying
if(stat != DEAD)
death(TRUE)
if(!no_items)
unequip_everything()
if(!prev_lying)
gib_animation()
spill_organs(no_brain, no_organs, no_bodyparts)
if(!no_bodyparts)
spread_bodyparts(no_brain, no_organs)
spawn_gibs(no_bodyparts)
SEND_SIGNAL(src, COMSIG_LIVING_GIBBED, no_brain, no_organs, no_bodyparts, no_items)
qdel(src)
/mob/living/proc/gib_animation()
return
/mob/living/proc/spawn_gibs()
new /obj/effect/gibspawner/generic(drop_location(), src, get_static_viruses())
/mob/living/proc/spill_organs()
return
/mob/living/proc/spread_bodyparts()
return
/**
* This is the proc for turning a mob into ash.
* Dusting robots does not eject the MMI, so it's a bit more powerful than gib()
*
* Arguments:
* * just_ash - If TRUE, ash will spawn where the mob was, as opposed to remains
* * drop_items - Should the mob drop their items before dusting?
* * force - Should this mob be FORCABLY dusted?
*/
/mob/living/proc/dust(just_ash, drop_items, force)
death(TRUE)
if(drop_items)
unequip_everything()
if(buckled)
buckled.unbuckle_mob(src, force = TRUE)
dust_animation()
spawn_dust(just_ash)
QDEL_IN(src,5) // since this is sometimes called in the middle of movement, allow half a second for movement to finish, ghosting to happen and animation to play. Looks much nicer and doesn't cause multiple runtimes.
/mob/living/proc/dust_animation()
return
/mob/living/proc/spawn_dust(just_ash = FALSE)
new /obj/effect/decal/cleanable/ash(loc)
/mob/living/proc/death(gibbed)
if(stat == DEAD)
return FALSE
set_stat(DEAD)
unset_machine()
timeofdeath = world.time
tod = station_time_timestamp()
var/turf/T = get_turf(src)
for(var/obj/item/I in contents)
I.on_mob_death(src, gibbed)
if(mind && mind.name && mind.active && !istype(T.loc, /area/centcom/ctf))
deadchat_broadcast(" has died at <b>[get_area_name(T)]</b>.", "<b>[mind.name]</b>", follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE)
if(mind)
mind.store_memory("Time of death: [tod]", 0)
remove_from_alive_mob_list()
if(!gibbed)
add_to_dead_mob_list()
set_drugginess(0)
set_disgust(0)
SetSleeping(0, 0)
blind_eyes(1)
reset_perspective(null)
reload_fullscreen()
update_mob_action_buttons()
update_damage_hud()
update_health_hud()
update_mobility()
med_hud_set_health()
med_hud_set_status()
if(!gibbed && !QDELETED(src))
addtimer(CALLBACK(src, PROC_REF(med_hud_set_status)), (DEFIB_TIME_LIMIT) + 1)
stop_pulling()
SEND_SIGNAL(src, COMSIG_LIVING_DEATH, gibbed)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MOB_DEATH, src, gibbed)
if (client)
client.move_delay = initial(client.move_delay)
for(var/s in ownedSoullinks)
var/datum/soullink/S = s
S.ownerDies(gibbed)
for(var/s in sharedSoullinks)
var/datum/soullink/S = s
S.sharerDies(gibbed)
if(GLOB.permadeath)
ghostize(FALSE)
return TRUE