Skip to content

Commit f92ab11

Browse files
authored
Dying now shows a cause of death (#1082)
* initial build * death data * fix hard del * another harddel fix (lolo try catch) * verb for cod * fix compile error * remove old death message
1 parent 06c8518 commit f92ab11

File tree

109 files changed

+625
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+625
-242
lines changed

code/datums/components/genetic_damage.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
if (total_damage >= minimum_before_damage)
5353
var/mob/living/living_mob = parent
54-
living_mob.adjustToxLoss(toxin_damage_per_second * delta_time)
54+
living_mob.adjustToxLoss(toxin_damage_per_second * delta_time, cause_of_death = "Genetic breakdown")
5555

5656
total_damage -= remove_per_second * delta_time
5757
if (total_damage <= 0)

code/datums/diseases/beesease.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
if(DT_PROB(1, delta_time))
2929
to_chat(affected_mob, span_danger("Your stomach stings painfully."))
3030
if(prob(20))
31-
affected_mob.adjustToxLoss(2)
31+
affected_mob.adjustToxLoss(2, cause_of_death = "Beesease")
3232
if(4)
3333
if(DT_PROB(5, delta_time))
3434
affected_mob.visible_message(span_danger("[affected_mob] buzzes."), \

code/datums/diseases/dna_spread.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
if(DT_PROB(0.5, delta_time))
4949
affected_mob.apply_pain(1, BODY_ZONE_CHEST, "Your abdomen hurts.")
5050
if(prob(20))
51-
affected_mob.adjustToxLoss(2, FALSE)
51+
affected_mob.adjustToxLoss(2, FALSE, cause_of_death = "Retrovirus")
5252
if(4)
5353
if(!transformed && !carrier)
5454
//Save original dna for when the disease is cured.

code/datums/diseases/flu.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
if(DT_PROB(0.5, delta_time))
3131
affected_mob.apply_pain(5, BODY_ZONE_CHEST, "Your abdomen hurts.")
3232
if(prob(20))
33-
affected_mob.adjustToxLoss(1, FALSE)
33+
affected_mob.adjustToxLoss(1, FALSE, cause_of_death = "Influenza")
3434
if(affected_mob.body_position == LYING_DOWN && DT_PROB(10, delta_time))
3535
to_chat(affected_mob, span_notice("You feel better."))
3636
stage--
@@ -48,7 +48,7 @@
4848
if(DT_PROB(0.5, delta_time))
4949
affected_mob.apply_pain(5, BODY_ZONE_CHEST, "Your abdomen hurts.")
5050
if(prob(20))
51-
affected_mob.adjustToxLoss(1, FALSE)
51+
affected_mob.adjustToxLoss(1, FALSE, cause_of_death = "Influenza")
5252
if(affected_mob.body_position == LYING_DOWN && DT_PROB(7.5, delta_time))
5353
to_chat(affected_mob, span_notice("You feel better."))
5454
stage--

code/datums/status_effects/debuffs/debuffs.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
return
297297
owner.adjustBruteLoss(0.1)
298298
owner.adjustFireLoss(0.1)
299-
owner.adjustToxLoss(0.2, TRUE, TRUE)
299+
owner.adjustToxLoss(0.2, TRUE, TRUE, cause_of_death = "His wrath")
300300

301301
/datum/status_effect/cultghost //is a cult ghost and can't use manifest runes
302302
id = "cult_ghost"

code/datums/status_effects/debuffs/drunk.dm

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@
182182

183183
// Over 81, we will gain constant toxloss
184184
if(drunk_value >= 81)
185-
owner.adjustToxLoss(1)
185+
owner.adjustToxLoss(1, cause_of_death = "Alcohol poisoning")
186186
if(owner.stat == CONSCIOUS && prob(5))
187187
to_chat(owner, span_warning("Maybe you should lie down for a bit..."))
188188

189189
// Over 91, we gain even more toxloss, brain damage, and have a chance of dropping into a long sleep
190190
if(drunk_value >= 91)
191-
owner.adjustToxLoss(1)
191+
owner.adjustToxLoss(1, cause_of_death = "Alcohol poisoning")
192192
if(owner.stat == CONSCIOUS && prob(20))
193193
// Don't put us in a deep sleep if the shuttle's here. QoL, mainly.
194194
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(owner.z))
@@ -200,7 +200,7 @@
200200

201201
// And finally, over 100 - let's be honest, you shouldn't be alive by now.
202202
if(drunk_value >= 101)
203-
owner.adjustToxLoss(2)
203+
owner.adjustToxLoss(2, cause_of_death = "Alcohol poisoning")
204204

205205
/// Status effect for being fully drunk (not tipsy).
206206
/atom/movable/screen/alert/status_effect/drunk

code/modules/admin/admin_verbs.dm

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ GLOBAL_PROTECT(admin_verbs_admin)
3131
// /datum/admins/proc/show_traitor_panel, /*interface which shows a mob's mind*/ -Removed due to rare practical use. Moved to debug verbs ~Errorage
3232
/datum/admins/proc/show_lag_switch_panel,
3333
/datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/
34+
/datum/admins/proc/check_death_info, /*Shows the Time of Death interface for the given player*/
3435
/datum/verbs/menu/Admin/verb/playerpanel,
3536
/client/proc/game_panel, /*game panel, allows to change game-mode etc*/
3637
/client/proc/check_ai_laws, /*shows AI and borg laws*/

code/modules/admin/verbs/admingame.dm

+12
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,18 @@
146146
usr << browse(body, "window=adminplayeropts-[REF(M)];size=550x515")
147147
SSblackbox.record_feedback("tally", "admin_verb", 1, "Player Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
148148

149+
/datum/admins/proc/check_death_info(mob/living/carbon/human/H in GLOB.mob_list)
150+
set category = "Admin.Game"
151+
set name = "Show Death Info"
152+
153+
if(!check_rights())
154+
return
155+
156+
if(!ishuman(H))
157+
return
158+
159+
H.show_death_stats(usr)
160+
149161
/client/proc/cmd_admin_godmode(mob/M in GLOB.mob_list)
150162
set category = "Admin.Game"
151163
set name = "Godmode"

code/modules/antagonists/blob/blob_mobs.dm

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
if(!key)
197197
notify_ghosts("\A [src] has been created in \the [get_area(src)].", source = src, action = NOTIFY_ORBIT, flashwindow = FALSE, header = "Blob Zombie Created")
198198

199-
/mob/living/simple_animal/hostile/blob/blobspore/death(gibbed)
199+
/mob/living/simple_animal/hostile/blob/blobspore/death(gibbed, cause_of_death = "Unknown")
200200
// On death, create a small smoke of harmful gas (s-Acid)
201201
var/datum/effect_system/fluid_spread/smoke/chem/S = new
202202
var/turf/location = get_turf(src)
@@ -334,8 +334,8 @@
334334
melee_damage_upper = initial(melee_damage_upper)
335335
attack_verb_continuous = initial(attack_verb_continuous)
336336

337-
/mob/living/simple_animal/hostile/blob/blobbernaut/death(gibbed)
338-
..(gibbed)
337+
/mob/living/simple_animal/hostile/blob/blobbernaut/death(gibbed, cause_of_death = "Unknown")
338+
..()
339339
if(factory)
340340
factory.naut = null //remove this naut from its factory
341341
factory.max_integrity = initial(factory.max_integrity)

code/modules/antagonists/blob/blobstrains/cryogenic_poison.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/datum/reagent/blob/cryogenic_poison/affect_blood(mob/living/carbon/C, removed)
2929
C.adjustBruteLoss(1 * removed, FALSE)
3030
C.adjustFireLoss(1 * removed, FALSE)
31-
C.adjustToxLoss(1* removed, FALSE)
31+
C.adjustToxLoss(1* removed, FALSE, cause_of_death = "Cryogenic poison")
3232
return TRUE
3333

3434
/datum/reagent/blob/cryogenic_poison/affect_touch(mob/living/carbon/C, removed)

code/modules/antagonists/blob/blobstrains/regenerative_materia.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/datum/reagent/blob/regenerative_materia/affect_blood(mob/living/carbon/C, removed)
2828
. = ..()
29-
C.adjustToxLoss(1 * removed, FALSE)
29+
C.adjustToxLoss(1 * removed, FALSE, "Regenerative materia")
3030
C.hal_screwyhud = SCREWYHUD_HEALTHY //fully healed, honest
3131
return TRUE
3232

code/modules/antagonists/heretic/mobs/maid_in_mirror.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/// A list of REFs to people who recently examined us
3232
var/list/recent_examiner_refs = list()
3333

34-
/mob/living/simple_animal/hostile/heretic_summon/maid_in_the_mirror/death(gibbed)
34+
/mob/living/simple_animal/hostile/heretic_summon/maid_in_the_mirror/death(gibbed, cause_of_death = "Unknown")
3535
var/turf/death_turf = get_turf(src)
3636
death_turf.TakeTemperature(-40)
3737
return ..()

code/modules/antagonists/morph/morph.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138

139139
update_med_hud()
140140

141-
/mob/living/simple_animal/hostile/morph/death(gibbed)
141+
/mob/living/simple_animal/hostile/morph/death(gibbed, cause_of_death = "Unknown")
142142
if(morphed)
143143
visible_message(span_warning("[src] twists and dissolves into a pile of green flesh!"), \
144144
span_userdanger("Your skin ruptures! Your flesh breaks apart! No disguise can ward off de--"))

code/modules/antagonists/revenant/revenant.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
/mob/living/simple_animal/revenant/gib()
236236
death()
237237

238-
/mob/living/simple_animal/revenant/death()
238+
/mob/living/simple_animal/revenant/death(gibbed, cause_of_death = "Unknown")
239239
if(!revealed || stasis) //Revenants cannot die if they aren't revealed //or are already dead
240240
return
241241
stasis = TRUE

code/modules/antagonists/revenant/revenant_abilities.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
if(mob.reagents)
384384
mob.reagents.add_reagent(/datum/reagent/toxin/plasma, 5)
385385
else
386-
mob.adjustToxLoss(5)
386+
mob.adjustToxLoss(5, cause_of_death = "Blight")
387387
for(var/obj/structure/spacevine/vine in victim) //Fucking with botanists, the ability.
388388
vine.add_atom_colour("#823abb", TEMPORARY_COLOUR_PRIORITY)
389389
new /obj/effect/temp_visual/revenant(vine.loc)

code/modules/antagonists/revenant/revenant_blight.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
new /obj/effect/temp_visual/revenant(affected_mob.loc)
4141
if(stagedamage < stage)
4242
stagedamage++
43-
affected_mob.adjustToxLoss(1 * stage * delta_time, FALSE) //should, normally, do about 30 toxin damage.
43+
affected_mob.adjustToxLoss(1 * stage * delta_time, FALSE, cause_of_death = "Wasted away") //should, normally, do about 30 toxin damage.
4444
new /obj/effect/temp_visual/revenant(affected_mob.loc)
4545
if(DT_PROB(25, delta_time))
4646
affected_mob.stamina.adjust(-stage)

code/modules/awaymissions/mission_code/snowdin.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
if(!IS_ORGANIC_LIMB(burn_limb))
199199
robo_parts += burn_limb
200200

201-
burn_human.adjustToxLoss(15)
201+
burn_human.adjustToxLoss(15, cause_of_death = "Liquid plasma")
202202
burn_human.adjustFireLoss(25)
203203
if(plasma_parts.len)
204204
var/obj/item/bodypart/burn_limb = pick(plasma_parts) //using the above-mentioned list to get a choice of limbs

code/modules/cargo/gondolapod.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
opened = FALSE
7676
update_appearance()
7777

78-
/mob/living/simple_animal/pet/gondola/gondolapod/death()
78+
/mob/living/simple_animal/pet/gondola/gondolapod/death(gibbed, cause_of_death = "Unknown")
7979
QDEL_NULL(linked_pod) //Will cause the open() proc for the linked supplypod to be called with the "broken" parameter set to true, meaning that it will dump its contents on death
8080
qdel(src)
8181
..()

code/modules/events/spacevine.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@
132132
return
133133
if(prob(TOXICITY_MUTATION_PROB) && istype(crosser) && !isvineimmune(crosser))
134134
to_chat(crosser, span_alert("You accidentally touch the vine and feel a strange sensation."))
135-
crosser.adjustToxLoss(20)
135+
crosser.adjustToxLoss(20, cause_of_death = "Spacevine toxin")
136136

137137
/datum/spacevine_mutation/toxicity/on_eat(obj/structure/spacevine/holder, mob/living/eater)
138138
if(!isvineimmune(eater))
139-
eater.adjustToxLoss(20)
139+
eater.adjustToxLoss(20, cause_of_death = "Spacevine toxin")
140140

141141
/datum/spacevine_mutation/explosive // JC IT'S A BOMB
142142
name = "Explosive"

code/modules/mob/living/basic/basic.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
verb_say = pick(speak_emote)
100100
return ..()
101101

102-
/mob/living/basic/death(gibbed)
102+
/mob/living/basic/death(gibbed, cause_of_death = "Unknown")
103103
. = ..()
104104
if(basic_mob_flags & DEL_ON_DEATH)
105105
qdel(src)

code/modules/mob/living/basic/basic_defense.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@
177177
..()
178178

179179

180-
/mob/living/basic/update_stat()
180+
/mob/living/basic/update_stat(cause_of_death)
181181
if(status_flags & GODMODE)
182182
return
183183

184184
if(stat != DEAD)
185185
if(health <= 0)
186-
death()
186+
death(cause_of_death = cause_of_death)
187187
else
188188
set_stat(CONSCIOUS)
189189

code/modules/mob/living/basic/health_adjustment.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
else if(damage_coeff[OXY])
3737
. = adjust_health(amount * damage_coeff[OXY] * CONFIG_GET(number/damage_multiplier), updating_health, forced)
3838

39-
/mob/living/basic/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
39+
/mob/living/basic/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE, cause_of_death = "Systemic organ failure")
4040
if(forced)
4141
. = adjust_health(amount * CONFIG_GET(number/damage_multiplier), updating_health, forced)
4242
else if(damage_coeff[TOX])

code/modules/mob/living/basic/vermin/cockroach.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
AddComponent(/datum/component/squashable, squash_chance = 50, squash_damage = 1)
3737
ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT)
3838

39-
/mob/living/basic/cockroach/death(gibbed)
39+
/mob/living/basic/cockroach/death(gibbed, cause_of_death = "Unknown")
4040
if(GLOB.station_was_nuked) //If the nuke is going off, then cockroaches are invincible. Keeps the nuke from killing them, cause cockroaches are immune to nukes.
4141
return
4242
..()

code/modules/mob/living/brain/brain_item.dm

+11-11
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,20 @@
274274
switch(blood_percent)
275275
if(BLOOD_CIRC_SAFE to INFINITY)
276276
if(can_heal)
277-
. |= applyOrganDamage(-1, updating_health = FALSE)
277+
applyOrganDamage(-1)
278278

279279
if(BLOOD_CIRC_OKAY to BLOOD_CIRC_SAFE)
280280
if(owner.stat == CONSCIOUS && prob(1))
281281
to_chat(owner, span_warning("You feel [pick("dizzy","woozy","faint")]..."))
282282
damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 30 : 60
283283
if(!past_damage_threshold(2) && prob(damprob))
284-
. |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE)
284+
applyOrganDamage(BRAIN_DECAY_RATE, cause_of_death = "Hypoxemia")
285285

286286
if(BLOOD_CIRC_BAD to BLOOD_CIRC_OKAY)
287287
owner.blur_eyes(6)
288288
damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 40 : 80
289289
if(!past_damage_threshold(4) && prob(damprob))
290-
. |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE)
290+
applyOrganDamage(BRAIN_DECAY_RATE, cause_of_death = "Hypoxemia")
291291

292292
if(owner.stat == CONSCIOUS && prob(10))
293293
log_health(owner, "Passed out due to poor blood oxygenation, random chance.")
@@ -298,7 +298,7 @@
298298
owner.blur_eyes(6)
299299
damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 60 : 100
300300
if(!past_damage_threshold(6) && prob(damprob))
301-
. |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE)
301+
applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE, cause_of_death = "Hypoxemia")
302302

303303
if(owner.stat == CONSCIOUS && prob(15))
304304
log_health(owner, "Passed out due to poor blood oxygenation, random chance.")
@@ -309,9 +309,9 @@
309309
owner.blur_eyes(6)
310310
damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 80 : 100
311311
if(prob(damprob))
312-
. |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE)
312+
applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE, cause_of_death = "Hypoxemia")
313313
if(prob(damprob))
314-
. |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE)
314+
applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE, cause_of_death = "Hypoxemia")
315315
. = ..()
316316

317317
/obj/item/organ/brain/check_damage_thresholds(mob/M)
@@ -373,7 +373,7 @@
373373
to_chat(owner, span_danger("You black out!"))
374374
owner.Unconscious(5 SECOND)
375375

376-
/obj/item/organ/brain/applyOrganDamage(damage_amount, maximum, silent, updating_health = TRUE)
376+
/obj/item/organ/brain/applyOrganDamage(damage_amount, maximum, silent, updating_health = TRUE, cause_of_death = "Organ failure")
377377
. = ..()
378378
if(. >= 20) //This probably won't be triggered by oxyloss or mercury. Probably.
379379
var/damage_secondary = min(. * 0.2, 20)
@@ -386,15 +386,15 @@
386386
/obj/item/organ/brain/getToxLoss()
387387
return 0
388388

389-
/obj/item/organ/brain/set_organ_dead(failing)
389+
/obj/item/organ/brain/set_organ_dead(failing, cause_of_death)
390390
. = ..()
391391
if(!.)
392392
return
393393
if(failing)
394394
if(owner)
395-
owner.death()
395+
owner.death(cause_of_death = cause_of_death)
396396
else if(brainmob)
397-
brainmob.death()
397+
brainmob.death(cause_of_death = cause_of_death)
398398
return
399399
else
400400
if(owner)
@@ -602,7 +602,7 @@
602602

603603
/obj/item/organ/brain/get_scan_results(tag)
604604
. = ..()
605-
var/list/traumas = owner.get_traumas()
605+
var/list/traumas = owner?.get_traumas()
606606
if(!length(traumas))
607607
return
608608

code/modules/mob/living/brain/death.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/mob/living/brain/death(gibbed)
1+
/mob/living/brain/death(gibbed, cause_of_death = "Unknown")
22
if(stat == DEAD)
33
return
44
set_stat(DEAD)

code/modules/mob/living/brain/life.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
. = ..()
88
handle_emp_damage(delta_time, times_fired)
99

10-
/mob/living/brain/update_stat()
10+
/mob/living/brain/update_stat(cause_of_death)
1111
if(status_flags & GODMODE)
1212
return
1313
if(health > HEALTH_THRESHOLD_DEAD)
1414
return
1515
if(stat != DEAD)
16-
death()
16+
death(cause_of_death = cause_of_death)
1717
var/obj/item/organ/brain/BR
1818
if(container?.brain)
1919
BR = container.brain

code/modules/mob/living/carbon/alien/damage_procs.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
return FALSE
44

55
///alien immune to tox damage
6-
/mob/living/carbon/alien/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
6+
/mob/living/carbon/alien/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE, cause_of_death = "Systemic organ failure")
77
return FALSE
88

99
///aliens are immune to stamina damage.

code/modules/mob/living/carbon/alien/humanoid/death.dm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/mob/living/carbon/alien/humanoid/death(gibbed)
1+
/mob/living/carbon/alien/humanoid/death(gibbed, cause_of_death = "Unknown")
22
if(stat == DEAD)
33
return
44

@@ -8,7 +8,7 @@
88
status_flags |= CANPUSH
99

1010
//When the alien queen dies, all others must pay the price for letting her die.
11-
/mob/living/carbon/alien/humanoid/royal/queen/death(gibbed)
11+
/mob/living/carbon/alien/humanoid/royal/queen/death(gibbed, cause_of_death = "Unknown")
1212
if(stat == DEAD)
1313
return
1414

code/modules/mob/living/carbon/alien/larva/death.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/mob/living/carbon/alien/larva/death(gibbed)
1+
/mob/living/carbon/alien/larva/death(gibbed, cause_of_death = "Unknown")
22
if(stat == DEAD)
33
return
44

0 commit comments

Comments
 (0)