|
274 | 274 | switch(blood_percent)
|
275 | 275 | if(BLOOD_CIRC_SAFE to INFINITY)
|
276 | 276 | if(can_heal)
|
277 |
| - . |= applyOrganDamage(-1, updating_health = FALSE) |
| 277 | + applyOrganDamage(-1) |
278 | 278 |
|
279 | 279 | if(BLOOD_CIRC_OKAY to BLOOD_CIRC_SAFE)
|
280 | 280 | if(owner.stat == CONSCIOUS && prob(1))
|
281 | 281 | to_chat(owner, span_warning("You feel [pick("dizzy","woozy","faint")]..."))
|
282 | 282 | damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 30 : 60
|
283 | 283 | if(!past_damage_threshold(2) && prob(damprob))
|
284 |
| - . |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE) |
| 284 | + applyOrganDamage(BRAIN_DECAY_RATE, cause_of_death = "Hypoxemia") |
285 | 285 |
|
286 | 286 | if(BLOOD_CIRC_BAD to BLOOD_CIRC_OKAY)
|
287 | 287 | owner.blur_eyes(6)
|
288 | 288 | damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 40 : 80
|
289 | 289 | if(!past_damage_threshold(4) && prob(damprob))
|
290 |
| - . |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE) |
| 290 | + applyOrganDamage(BRAIN_DECAY_RATE, cause_of_death = "Hypoxemia") |
291 | 291 |
|
292 | 292 | if(owner.stat == CONSCIOUS && prob(10))
|
293 | 293 | log_health(owner, "Passed out due to poor blood oxygenation, random chance.")
|
|
298 | 298 | owner.blur_eyes(6)
|
299 | 299 | damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 60 : 100
|
300 | 300 | 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") |
302 | 302 |
|
303 | 303 | if(owner.stat == CONSCIOUS && prob(15))
|
304 | 304 | log_health(owner, "Passed out due to poor blood oxygenation, random chance.")
|
|
309 | 309 | owner.blur_eyes(6)
|
310 | 310 | damprob = CHEM_EFFECT_MAGNITUDE(owner, CE_STABLE) ? 80 : 100
|
311 | 311 | if(prob(damprob))
|
312 |
| - . |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE) |
| 312 | + applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE, cause_of_death = "Hypoxemia") |
313 | 313 | if(prob(damprob))
|
314 |
| - . |= applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE) |
| 314 | + applyOrganDamage(BRAIN_DECAY_RATE, updating_health = FALSE, cause_of_death = "Hypoxemia") |
315 | 315 | . = ..()
|
316 | 316 |
|
317 | 317 | /obj/item/organ/brain/check_damage_thresholds(mob/M)
|
|
373 | 373 | to_chat(owner, span_danger("You black out!"))
|
374 | 374 | owner.Unconscious(5 SECOND)
|
375 | 375 |
|
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") |
377 | 377 | . = ..()
|
378 | 378 | if(. >= 20) //This probably won't be triggered by oxyloss or mercury. Probably.
|
379 | 379 | var/damage_secondary = min(. * 0.2, 20)
|
|
386 | 386 | /obj/item/organ/brain/getToxLoss()
|
387 | 387 | return 0
|
388 | 388 |
|
389 |
| -/obj/item/organ/brain/set_organ_dead(failing) |
| 389 | +/obj/item/organ/brain/set_organ_dead(failing, cause_of_death) |
390 | 390 | . = ..()
|
391 | 391 | if(!.)
|
392 | 392 | return
|
393 | 393 | if(failing)
|
394 | 394 | if(owner)
|
395 |
| - owner.death() |
| 395 | + owner.death(cause_of_death = cause_of_death) |
396 | 396 | else if(brainmob)
|
397 |
| - brainmob.death() |
| 397 | + brainmob.death(cause_of_death = cause_of_death) |
398 | 398 | return
|
399 | 399 | else
|
400 | 400 | if(owner)
|
|
602 | 602 |
|
603 | 603 | /obj/item/organ/brain/get_scan_results(tag)
|
604 | 604 | . = ..()
|
605 |
| - var/list/traumas = owner.get_traumas() |
| 605 | + var/list/traumas = owner?.get_traumas() |
606 | 606 | if(!length(traumas))
|
607 | 607 | return
|
608 | 608 |
|
|
0 commit comments