From fe79c53f04d03ad8796d91cb7a7252c643907f5c Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Sat, 18 Jul 2020 21:40:19 +0100
Subject: [PATCH] bugfixes
---
code/datums/wounds/burns.dm | 2 +-
.../mob/living/carbon/human/human_defense.dm | 83 +++++++++++++++++++
2 files changed, 84 insertions(+), 1 deletion(-)
diff --git a/code/datums/wounds/burns.dm b/code/datums/wounds/burns.dm
index feff9bf4de..6a6629a0c9 100644
--- a/code/datums/wounds/burns.dm
+++ b/code/datums/wounds/burns.dm
@@ -186,7 +186,7 @@
/// if someone is using ointment on our burns
/datum/wound/burn/proc/ointment(obj/item/stack/medical/ointment/I, mob/user)
user.visible_message("[user] begins applying [I] to [victim]'s [limb.name]...", "You begin applying [I] to [user == victim ? "your" : "[victim]'s"] [limb.name]...")
- if(!do_after(user, (user == victim ? I.self_delay : I.other_delay), extra_checks = CALLBACK(src, .proc/still_exists)))
+ if(!do_after(user, (user == victim ? I.self_delay : I.other_delay), target = victim))
return
limb.heal_damage(I.heal_brute, I.heal_burn)
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 714932af80..af1afb0f81 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -762,6 +762,89 @@
..()
+/mob/living/carbon/human/check_self_for_injuries()
+ if(stat == DEAD || stat == UNCONSCIOUS)
+ return
+
+ visible_message("[src] examines [p_them()]self.", \
+ "You check yourself for injuries.")
+
+ var/list/missing = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
+
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/LB = X
+ missing -= LB.body_zone
+ if(LB.is_pseudopart) //don't show injury text for fake bodyparts; ie chainsaw arms or synthetic armblades
+ continue
+ var/self_aware = FALSE
+ if(HAS_TRAIT(src, TRAIT_SELF_AWARE))
+ self_aware = TRUE
+ var/limb_max_damage = LB.max_damage
+ var/status = ""
+ var/brutedamage = LB.brute_dam
+ var/burndamage = LB.burn_dam
+ if(hallucination)
+ if(prob(30))
+ brutedamage += rand(30,40)
+ if(prob(30))
+ burndamage += rand(30,40)
+
+ if(HAS_TRAIT(src, TRAIT_SELF_AWARE))
+ status = "[brutedamage] brute damage and [burndamage] burn damage"
+ if(!brutedamage && !burndamage)
+ status = "no damage"
+
+ else
+ if(brutedamage > 0)
+ status = LB.light_brute_msg
+ if(brutedamage > (limb_max_damage*0.4))
+ status = LB.medium_brute_msg
+ if(brutedamage > (limb_max_damage*0.8))
+ status = LB.heavy_brute_msg
+ if(brutedamage > 0 && burndamage > 0)
+ status += " and "
+
+ if(burndamage > (limb_max_damage*0.8))
+ status += LB.heavy_burn_msg
+ else if(burndamage > (limb_max_damage*0.2))
+ status += LB.medium_burn_msg
+ else if(burndamage > 0)
+ status += LB.light_burn_msg
+
+ if(status == "")
+ status = "OK"
+ var/no_damage
+ if(status == "OK" || status == "no damage")
+ no_damage = TRUE
+ var/isdisabled = " "
+ if(LB.is_disabled())
+ isdisabled = " is disabled "
+ if(no_damage)
+ isdisabled += " but otherwise "
+ else
+ isdisabled += " and "
+ to_chat(src, "\t Your [LB.name][isdisabled][self_aware ? " has " : " is "][status].")
+
+ for(var/thing in LB.wounds)
+ var/datum/wound/W = thing
+ var/msg
+ switch(W.severity)
+ if(WOUND_SEVERITY_TRIVIAL)
+ msg = "\t Your [LB.name] is suffering [W.a_or_from] [lowertext(W.name)]."
+ if(WOUND_SEVERITY_MODERATE)
+ msg = "\t Your [LB.name] is suffering [W.a_or_from] [lowertext(W.name)]!"
+ if(WOUND_SEVERITY_SEVERE)
+ msg = "\t Your [LB.name] is suffering [W.a_or_from] [lowertext(W.name)]!"
+ if(WOUND_SEVERITY_CRITICAL)
+ msg = "\t Your [LB.name] is suffering [W.a_or_from] [lowertext(W.name)]!!"
+ to_chat(src, msg)
+
+ for(var/obj/item/I in LB.embedded_objects)
+ if(I.isEmbedHarmless())
+ to_chat(src, "\t There is \a [I] stuck to your [LB.name]!")
+ else
+ to_chat(src, "\t There is \a [I] embedded in your [LB.name]!")
+
/mob/living/carbon/human/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone)
if(damage_type != BRUTE && damage_type != BURN)