code:
/mob/living/carbon/send_item_attack_message(obj/item/I, mob/living/user, hit_area, obj/item/bodypart/hit_bodypart)
	if(!I.force && !length(I.attack_verb_simple) && !length(I.attack_verb_continuous))
		return
	var/intended_zone = check_zone(user.zone_selected)
	if(intended_zone == hit_bodypart.body_zone)
		var/message_verb_continuous = length(I.attack_verb_continuous) ? "[pick(I.attack_verb_continuous)]" : "attacks"
		var/message_verb_simple = length(I.attack_verb_simple) ? "[pick(I.attack_verb_simple)]" : "attack"

		var/extra_wound_details = ""
		/* In case of emergency, break glass
		if(I.damtype == BRUTE && hit_bodypart.can_dismember())
			var/mangled_state = hit_bodypart.get_mangled_state()
			var/bio_state = get_biological_state()
			if(mangled_state == BODYPART_MANGLED_BOTH || (mangled_state == BODYPART_MANGLED_BONE && bio_state == BIO_JUST_BONE) || (mangled_state == BODYPART_MANGLED_FLESH && bio_state == BIO_JUST_FLESH))
				extra_wound_details = ", threatening to [I.get_sharpness() & SHARP_EDGED ? "sever" : "destroy"] it"
			else if(mangled_state == BODYPART_MANGLED_FLESH && I.get_sharpness())
				extra_wound_details = ", [I.get_sharpness() & SHARP_EDGED ? "slicing" : "piercing"] the bone"
			else if(mangled_state == BODYPART_MANGLED_BONE && I.get_sharpness())
				extra_wound_details = ", [I.get_sharpness() & SHARP_EDGED ? "slicing" : "piercing"] the flesh"
		*/

		var/message_hit_area = ""
		if(hit_area)
			message_hit_area = " in the [hit_area]"
		var/attack_message_spectator = "[user] [message_verb_continuous] [src][message_hit_area] with [I][extra_wound_details]![wound_message]"
		var/attack_message_victim = "Something [message_verb_continuous][message_hit_area][extra_wound_details]![wound_message]"
		var/attack_message_attacker = "I [message_verb_simple] something with [I]!"
		if(user in fov_viewers(world.view, src))
			attack_message_attacker = "I [message_verb_simple] [src][message_hit_area] with [I]![wound_message]"
		if(src in fov_viewers(world.view, user))
			attack_message_victim = "[user] [message_verb_continuous] me[message_hit_area] with [I][extra_wound_details]![wound_message]"
		if(user == src)
			attack_message_victim = "I [message_verb_simple] myself[message_hit_area] with [I][extra_wound_details]![wound_message]"
		visible_message(span_danger("[attack_message_spectator]"),\
			span_userdanger("[attack_message_victim]"),
			span_hear("I hear a whoosh and a thud!"), \
			vision_distance = COMBAT_MESSAGE_RANGE, \
			ignored_mobs = user)
		if(user != src)
			to_chat(user, span_userdanger("[attack_message_attacker]"))
	else
		var/parsed_intended_zone = parse_zone(intended_zone)
		var/message_verb_continuous = length(I.attack_verb_continuous) ? "[pick(I.attack_verb_continuous)]" : "attacks"
		var/message_verb_simple = length(I.attack_verb_simple) ? "[pick(I.attack_verb_simple)]" : "attack"

		var/extra_wound_details = ""
		/* In case of emergency, break glass
		if(I.damtype == BRUTE && hit_bodypart.can_dismember())
			var/mangled_state = hit_bodypart.get_mangled_state()
			var/bio_state = get_biological_state()
			if(mangled_state == BODYPART_MANGLED_BOTH || (mangled_state == BODYPART_MANGLED_BONE && bio_state == BIO_JUST_BONE) || (mangled_state == BODYPART_MANGLED_FLESH && bio_state == BIO_JUST_FLESH))
				extra_wound_details = ", threatening to [I.get_sharpness() & SHARP_EDGED ? "sever" : "destroy"] it, "
			else if(mangled_state == BODYPART_MANGLED_FLESH && I.get_sharpness())
				extra_wound_details = ", [I.get_sharpness() & SHARP_EDGED ? "slicing" : "piercing"] the remaining bone, "
			else if(mangled_state == BODYPART_MANGLED_BONE && I.get_sharpness())
				extra_wound_details = ", [I.get_sharpness() & SHARP_EDGED ? "slicing" : "piercing"] the remaining flesh, "
		*/

		var/message_hit_area = ""
		if(hit_area)
			message_hit_area = " in the [hit_area]"
		var/attack_message_spectator = "[user] tries to [message_verb_simple] [src] in the [parsed_intended_zone] with [I], but [message_verb_simple][message_hit_area][extra_wound_details] instead![wound_message]"
		var/attack_message_victim = "Something [message_verb_continuous][message_hit_area][extra_wound_details]! [wound_message]"
		var/attack_message_attacker = "I [message_verb_simple] something with [I]!"
		if(user in fov_viewers(world.view, src))
			attack_message_attacker = "I try to [message_verb_simple] [src] in the [parsed_intended_zone] with [I], but [message_verb_simple][message_hit_area][extra_wound_details] instead!![wound_message]"
		if(src in fov_viewers(world.view, user))
			attack_message_victim = "[user] tries to [message_verb_simple] me in the [parsed_intended_zone] with [I], but [message_verb_simple][message_hit_area][extra_wound_details] instead![wound_message]"
		if(user == src)
			attack_message_victim = "I try to [message_verb_simple] myself in the [parsed_intended_zone] with [I], but [message_verb_simple][message_hit_area][extra_wound_details] instead![wound_message]"
		visible_message(span_danger("[attack_message_spectator]"),\
			span_userdanger("[attack_message_victim]"),
			span_hear("I hear a whoosh and a thud!"), \
			vision_distance = COMBAT_MESSAGE_RANGE, \
			ignored_mobs = user)
		if(user != src)
			to_chat(user, span_userdanger("[attack_message_attacker]"))
	SEND_SIGNAL(src, COMSIG_CARBON_CLEAR_WOUND_MESSAGE)
	return TRUE

//ATTACK HAND IGNORING PARENT RETURN VALUE
/mob/living/carbon/attack_hand(mob/living/carbon/human/user, list/modifiers)
	if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user) & COMPONENT_CANCEL_ATTACK_CHAIN)
		. = TRUE
	for(var/thing in diseases)
		var/datum/disease/D = thing
		if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN)
			user.ContactContractDisease(D)
	for(var/thing in user.diseases)
		var/datum/disease/D = thing
		if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN)
			ContactContractDisease(D)
	//surgeries have higher priority than wounds due to edge cases
	if(IS_HELP_INTENT(user, modifiers) || IS_DISARM_INTENT(user, modifiers))
		var/static/list/middleclick_steps = list(/datum/surgery_step/incise, /datum/surgery_step/mechanic_incise, /datum/surgery_step/dissect)
		for(var/datum/surgery_step/step as anything in GLOB.surgery_steps)
			if(step.type in middleclick_steps)
				continue
			if(step.try_op(user, src, user.zone_selected, user.get_active_held_item(), IS_DISARM_INTENT(user, modifiers)))
				return TRUE
	for(var/i in all_wounds)
		var/datum/wound/W = i
		if(W.try_handling(user))
			return TRUE

	return FALSE

/mob/living/carbon/attack_foot(mob/living/carbon/human/user, list/modifiers)
	if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_FOOT, user) & COMPONENT_CANCEL_ATTACK_CHAIN)
		. = TRUE
	for(var/thing in diseases)
		var/datum/disease/D = thing
		if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN)
			user.ContactContractDisease(D)
	for(var/thing in user.diseases)
		var/datum/disease/D = thing
		if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN)
			ContactContractDisease(D)

	return FALSE

/mob/living/carbon/attack_jaw(mob/living/carbon/human/user, list/modifiers)
	if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_FOOT, user) & COMPONENT_CANCEL_ATTACK_CHAIN)
		. = TRUE
	for(var/thing in diseases)
		var/datum/disease/D = thing
		if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN)
			user.ContactContractDisease(D)
	for(var/thing in user.diseases)
		var/datum/disease/D = thing
		if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN)
			ContactContractDisease(D)

	return FALSE

/mob/living/carbon/on_hit(obj/projectile/P)
	. = ..()
	SEND_SIGNAL(src, COMSIG_CARBON_CLEAR_WOUND_MESSAGE)

/mob/living/carbon/disarm(mob/living/carbon/target)
	var/aiming_for_hand = (zone_selected in list(BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND))
	var/obj/item/held_item = target.get_active_held_item()
	if(!aiming_for_hand || !held_item)
		return shove(target)
	var/modifier = 0
	//Target cannot view us = unaware
	//Target has no combat mode = unaware
	if(!(target in fov_viewers(2, src)) || !target.combat_mode)
		modifier += 8
	//Target took stimulants, harder to disarm
	var/stimulants = target.get_chem_effect(CE_STIMULANT)
	if(stimulants)
		modifier -= stimulants
	var/weapon_go_fwoosh = FALSE
	var/fwoosh_prob = 15
	var/obj/item/bodypart/disarming_part = get_active_hand()
	if(disarming_part)
		fwoosh_prob *= (LIMB_EFFICIENCY_OPTIMAL/disarming_part.limb_efficiency)
	if(prob(fwoosh_prob))
		weapon_go_fwoosh = TRUE
	var/direction = get_dir(src, target)
	do_attack_animation(target, ATTACK_EFFECT_DISARM)
	playsound(target, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
	target.gloves?.add_fingerprint(src)
	var/diceroll = diceroll(GET_MOB_ATTRIBUTE_VALUE(src, SKILL_MELEE)+modifier)
	//disarm succesfull
	if(diceroll >= DICE_SUCCESS)
		if(weapon_go_fwoosh)
			visible_message(span_danger("[src] tries to grab [held_item] from [target], and it flies out of [target.p_their()] hands!"),
						span_userdanger("I try to grab [target]'s [held_item], but it flies out of my reach!"),
						span_danger("I hear some loud shuffling, and something dropping forcefully on the ground!"),
						vision_distance = COMBAT_MESSAGE_RANGE,
						ignored_mobs = target)
			to_chat(target, span_userdanger("[src] grabs my [held_item], and it flies out of my hands!"))
			target.dropItemToGround(held_item)
			var/turf/target_turf = get_edge_target_turf(held_item, direction)
			held_item.throw_at(target_turf, held_item.throw_range, held_item.throw_speed, src, FALSE)
		else
			visible_message(span_danger("[src] tries to grab [held_item] from [target], but fails!"),
						span_userdanger("I try to grab [target]'s [held_item], but fumble and miss!"),
						span_danger("I hear some loud shuffling, and something dropping on the ground!"),
						vision_distance = COMBAT_MESSAGE_RANGE,
						ignored_mobs = target)
			to_chat(target, span_userdanger("[src] grabs my [held_item]!"))
			target.dropItemToGround(held_item)
			put_in_active_hand(held_item)
		return
	//epic disarm fail
	else
		visible_message(span_danger("[src] tries to grab [held_item] from [target], but fails!"),
					span_userdanger("I try to grab [target]'s [held_item], but fumble and miss!"),
					span_danger("I hear some loud shuffling!"),
					vision_distance = COMBAT_MESSAGE_RANGE,
					ignored_mobs = target)
		to_chat(target, span_userdanger("[src] tries to grab my [held_item], but fails!"))
		return

/mob/living/carbon/get_organic_health()
	. = getMaxHealth()
	for(var/obj/item/bodypart/bodypart in bodyparts)
		if(bodypart.status == BODYPART_ORGANIC)
			. -= bodypart.get_damage(FALSE, FALSE)
	. -= getCloneLoss()
	. -= getOxyLoss()
	. -= getToxLoss()

/mob/living/carbon/help_shake_act(mob/living/carbon/M)
	if(on_fire)
		to_chat(M, span_warning("I can't put [p_them()] out with just my bare hands!"))
		return

	if(M == src && check_self_for_injuries())
		return

	//Shake them up
	if(body_position == LYING_DOWN)
		if(buckled)
			to_chat(M, span_warning("I need to unbuckle [src] first to do that!"))
			return
		M.visible_message(span_notice("[M] shakes [src] trying to get [p_them()] up!"), \
						span_notice("I shake [src] trying to get [p_them()] up!"), \
						span_hear("I hear the rustling of clothes."), \
						DEFAULT_MESSAGE_RANGE, \
						src)
		to_chat(src, span_notice("[M] shakes me to get me up!"))
		AdjustStun(-60)
		AdjustKnockdown(-60)
		AdjustUnconscious(-60)
		AdjustSleeping(-100)
		AdjustParalyzed(-60)
		AdjustImmobilized(-60)
		set_resting(FALSE)
		if(body_position != STANDING_UP && !resting && !buckled && !HAS_TRAIT(src, TRAIT_FLOORED))
			get_up(TRUE)
		playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
	//Headpat them
	else if(check_zone(M.zone_selected) == BODY_ZONE_HEAD)
		headpat_act(M)
	//Hug them
	else
		hug_act(M)

	// Shake animation
	if(incapacitated())
		var/direction = prob(50) ? -1 : 1
		animate(src, pixel_x = pixel_x + 4 * direction, time = 1, easing = QUAD_EASING | EASE_OUT, flags = ANIMATION_PARALLEL)
		animate(pixel_x = pixel_x - (4 * 2 * direction), time = 1)
		animate(pixel_x = pixel_x + 4 * direction, time = 1, easing = QUAD_EASING | EASE_IN)

/mob/living/carbon/proc/headpat_act(mob/living/carbon/patter)
	if(!get_bodypart_nostump(BODY_ZONE_HEAD))
		return
	SEND_SIGNAL(src, COMSIG_CARBON_HEADPAT, patter)
	patter.visible_message(span_notice("[patter] gives [src] a pat on the head to make [p_them()] feel better!"), \
				span_notice("I give [src] a pat on the head to make [p_them()] feel better!"),
				span_hear("I hear a soft patter."), \
				DEFAULT_MESSAGE_RANGE, \
				src)
	to_chat(src, span_notice("[patter] gives me a pat on the head to make me feel better! "))
	if(HAS_TRAIT(src, TRAIT_BADTOUCH))
		to_chat(patter, span_warning("[src] looks visibly upset as i pat [p_them()] on the head."))
	AdjustStun(-60)
	AdjustKnockdown(-60)
	AdjustUnconscious(-60)
	AdjustSleeping(-100)
	AdjustParalyzed(-60)
	AdjustImmobilized(-60)
	playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)

/mob/living/carbon/proc/hug_act(mob/living/carbon/hugger)
	SEND_SIGNAL(src, COMSIG_CARBON_HUGGED, hugger)
	SEND_SIGNAL(hugger, COMSIG_CARBON_HUG, src)
	hugger.visible_message(span_notice("[hugger] hugs [src] to make [p_them()] feel better!"), \
				span_notice("I hug [src] to make [p_them()] feel better!"), \
				span_hear("I hear the rustling of clothes."), \
				DEFAULT_MESSAGE_RANGE, \
				src)
	to_chat(src, span_notice("[hugger] hugs me to make me feel better!"))

	// Warm them up with hugs
	share_bodytemperature(hugger)

	// No moodlets for people who hate touches
	if(!HAS_TRAIT(src, TRAIT_BADTOUCH))
		if(bodytemperature > hugger.bodytemperature)
			if(!HAS_TRAIT(hugger, TRAIT_BADTOUCH))
				SEND_SIGNAL(hugger, COMSIG_ADD_MOOD_EVENT, "hug", /datum/mood_event/warmhug, src) // Hugger got a warm hug (Unless they hate hugs)
			SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "hug", /datum/mood_event/hug) // Reciver always gets a mood for being hugged
		else
			SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "hug", /datum/mood_event/warmhug, hugger) // You got a warm hug

	// Let people know if they hugged someone really warm or really cold
	if(hugger.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
		to_chat(src, span_warning("It feels like [hugger] is over heating as [hugger.p_they()] hug[hugger.p_s()] me."))
	else if(hugger.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
		to_chat(src, span_warning("It feels like [hugger] is freezing as [hugger.p_they()] hug[hugger.p_s()] me."))

	if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
		to_chat(hugger, span_warning("It feels like [src] is over heating as i hug [p_them()]."))
	else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
		to_chat(hugger, span_warning("It feels like [src] is freezing as you i [p_them()]."))

	if(HAS_TRAIT(hugger, TRAIT_FRIENDLY))
		var/datum/component/mood/hugger_mood = hugger.GetComponent(/datum/component/mood)
		if(hugger_mood.sanity >= SANITY_GREAT)
			new /obj/effect/temp_visual/heart(loc)
			SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/besthug, hugger)
		else if(hugger_mood.sanity >= SANITY_NEUTRAL)
			SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/betterhug, hugger)

	if(HAS_TRAIT(src, TRAIT_BADTOUCH))
		to_chat(hugger, span_warning("[src] looks visibly upset as i hug [p_them()]."))
	AdjustStun(-60)
	AdjustKnockdown(-60)
	AdjustUnconscious(-60)
	AdjustSleeping(-100)
	AdjustParalyzed(-60)
	AdjustImmobilized(-60)
	playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)

/mob/living/carbon/proc/shove(mob/living/carbon/target)
	do_attack_animation(target, ATTACK_EFFECT_DISARM)
	playsound(target, 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1)
	if(ishuman(target))
		var/mob/living/carbon/human/human_target = target
		human_target.w_uniform?.add_fingerprint(src)

	SEND_SIGNAL(target, COMSIG_HUMAN_DISARM_HIT, src, zone_selected)
	target.sound_hint()

	var/shove_power = GET_MOB_ATTRIBUTE_VALUE(src, STAT_STRENGTH)
	if(target.combat_mode && (target in fov_viewers(2, src)) && (shove_power < 20))
		visible_message(span_danger("[src] tries to shove [target]!"),
					span_userdanger("I try to shove [target], but they are too aware of me!"),
					span_hear("I hear some shuffling."),
					vision_distance = COMBAT_MESSAGE_RANGE,
					ignored_mobs = target)
		to_chat(target, span_userdanger("[src] tries to shove me!"))
		return

	var/shovedir = get_dir(src, target)
	var/obj/item/bodypart/shover = get_active_hand()
	if(shover)
		shove_power *= shover.limb_efficiency/LIMB_EFFICIENCY_OPTIMAL
	var/turf/shove_target = get_edge_target_turf(target, shovedir)
	var/shove_distance = FLOOR(shove_power/10, 1)
	visible_message(span_danger("[src] shoves [target]!"),
				span_userdanger("I shove [target]!"),
				span_hear("I hear some shuffling!"),
				vision_distance = COMBAT_MESSAGE_RANGE,
				ignored_mobs = target)
	to_chat(target, span_userdanger("[src] shoves me!"))
	target.Stumble(shove_power * 2)
	target.throw_at(shove_target, shove_distance, CEILING(shove_power/10, 1), src)

/mob/living/carbon/proc/pump_heart(mob/user, forced_pump)
	if(!forced_pump)
		var/heymedic = GET_MOB_ATTRIBUTE_VALUE(user, SKILL_MEDICINE)/SKILL_MASTER
		recent_heart_pump = list("[world.time]" = (0.3 + CEILING(heymedic, 0.1)))
	else
		recent_heart_pump = list("[world.time]" = (0.3 + CEILING(forced_pump, 0.1)))
	return TRUE


code:
/mob/living/carbon
	/// Basically used to know what are supposed to be our original genitals
	var/genitals = GENITALS_MALE
	/// Handedness impacts actionspeed
	var/handed_flags = DEFAULT_HANDEDNESS
	/// A collection of bodyparts used to stand
	var/list/leg_bodyparts = list()
	// Carbon mobs actually have 4 "legs" (the feet help, too!)
	default_num_legs = 4
	num_legs = 0
	usable_legs = 0
	/// A collection of bodyparts used to see
	var/list/eye_bodyparts = list()
	default_num_eyes = 2
	num_eyes = 0
	usable_eyes = 0
	/// Makes carbon account the new bodyparts
	bodyparts = BODYPARTS_PATH
	/// Associated list - zone = bodypart
	var/list/bodyparts_zones = list()
	/// All injuries we have accumulated on bodyparts
	var/list/datum/injury/all_injuries
	/// Speech modifiers
	var/list/datum/speech_modifier/speech_modifiers
	/// Descriptive string used in combat messages
	var/wound_message = ""
	/// Current immune system strength
	var/immunity = 100
	/// It will regenerate to this value
	var/default_immunity = 100
	/// Pulse can't be handled on an organ-by-organ basis, since we can have multiple hearts
	var/pulse = PULSE_NORM
	/// Used to handle the heartbeat sounds
	var/heartbeat_sound = BEAT_NONE
	/// How long effectively a pump lasts
	var/heart_pump_duration = 5 SECONDS
	/// Used by CPR and blood circulation - Time of the pumping associated with "effectiveness", from 0 to 1
	var/list/recent_heart_pump
	/// Total organ and bodypart blood requirement
	var/total_blood_req = DEFAULT_TOTAL_BLOOD_REQ
	/// Total organ and bodypart oxygen requirement
	var/total_oxygen_req = DEFAULT_TOTAL_OXYGEN_REQ
	/// Total organ and bodypart nutriment requirement
	var/total_nutriment_req = DEFAULT_TOTAL_NUTRIMENT_REQ
	/// Total organ and bodypart hydration requirement
	var/total_hydration_req  = DEFAULT_TOTAL_HYDRATION_REQ
	///Last time we got mouth to mouthed
	var/last_mtom = 0
	///Last time we got CPR'd
	var/last_cpr = 0
	///Only carbons are capable of having intents
	a_intent = INTENT_HELP
	possible_a_intents = DEFAULT_INTENTS_LIST
	hand_index_to_intent = list(INTENT_HELP, INTENT_HELP)
	hand_index_to_zone = list(BODY_ZONE_CHEST, BODY_ZONE_CHEST)
	hand_index_to_throw = list(FALSE, FALSE)

	///Pollution smell cooldown
	COOLDOWN_DECLARE(next_smell)

	// ~WEIGHT SYSTEM
	///Maximum weight we can carry, this point and beyond means maximum encumbrance
	var/maximum_carry_weight = 72
	///Weight we are currently carrying
	var/carry_weight = 0
	///State of encumbrance we are in, cheaper to store this than keeping calling update_carry_weight()
	var/encumbrance = ENCUMBRANCE_NONE

	// ~INVENTORY VARIABLES
	///Second ear slot
	var/obj/item/clothing/ears_extra = null

repo_name: AnalWerewolf/sundown

license: mit


code:
/mob/living/carbon/emote(act, m_type, message, intentional, force_silence)
	var/vocal_cord_efficiency = getorganslotefficiency(ORGAN_SLOT_VOICE)
	var/lung_efficiency = getorganslotefficiency(ORGAN_SLOT_LUNGS)
	var/obj/item/bodypart/mouth/shit = get_bodypart_nostump(BODY_ZONE_PRECISE_MOUTH)
	var/list/key_emotes = GLOB.emote_list[act]
	for(var/thing in key_emotes)
		var/datum/emote/emote = thing
		if(emote.emote_type == EMOTE_AUDIBLE)
			if(undergoing_cardiac_arrest() || (needs_lungs() && (lung_efficiency < ORGAN_FAILING_EFFICIENCY)) )
				if(act in list("scream", "screams", "agonyscream", "agonyscreams"))
					act = "loudnoise"
				else
					act = "quietnoise"
				return ..()
			else if(!shit || shit.bodypart_disabled || (vocal_cord_efficiency < ORGAN_FAILING_EFFICIENCY))
				act = "gargle"
				return ..()
	return ..()


code:
/mob/living/carbon/examine(mob/user)
	//hehe
	if(user.zone_selected in list(BODY_ZONE_PRECISE_L_EYE, BODY_ZONE_PRECISE_R_EYE))
		user.handle_eye_contact(src)

	var/t_He = p_they(TRUE)
	var/t_His = p_their(TRUE)
	var/t_his = p_their()
	var/t_him = p_them()
	var/t_has = p_have()
	var/t_is = p_are()
	var/obscured = check_obscured_slots()

	. = list()
	. += "
Oh, this is [icon2html(src, user)] \a [src]!"
	if(!isobserver(user) && !user.DirectAccess(src) && (get_dist(user, src) > EYE_CONTACT_RANGE))
		. += "[t_He] [t_is] too far away to see clearly."
		. += "
" //div infobox
		return

	. += ""
	if(handcuffed && !(obscured & ITEM_SLOT_HANDCUFFED) && !(handcuffed.item_flags & EXAMINE_SKIP) && !(handcuffed.item_flags & EXAMINE_SKIP))
		. += "[t_He] [t_is] [icon2html(handcuffed, user)] handcuffed with [handcuffed]!"
	if(head && !(obscured & ITEM_SLOT_HEAD) && !(head.item_flags & EXAMINE_SKIP) && !(head.item_flags & ABSTRACT))
		. += "[t_He] [t_is] wearing [head.get_examine_string(user)] on [t_his] head. "
	if(wear_mask && !(obscured & ITEM_SLOT_MASK) && !(wear_mask.item_flags & EXAMINE_SKIP) && !(wear_mask.item_flags & ABSTRACT))
		. += "[t_He] [t_is] wearing [wear_mask.get_examine_string(user)] on [t_his] face."
	if(wear_neck && !(obscured & ITEM_SLOT_NECK) && !(wear_neck.item_flags & EXAMINE_SKIP) && !(wear_neck.item_flags & ABSTRACT))
		. += "[t_He] [t_is] wearing [wear_neck.get_examine_string(user)] around [t_his] neck."

	for(var/obj/item/I in held_items)
		if(!(I.item_flags & EXAMINE_SKIP) && !(I.item_flags & ABSTRACT))
			. += "[t_He] [t_is] holding [I.get_examine_string(user)] in [t_his] [get_held_index_name(get_held_index_of_item(I))]."

	if(back)
		. += "[t_He] [t_has] [back.get_examine_string(user)] on [t_his] back."

	var/list/msg = list("")
	var/list/missing = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
	var/list/disabled = list()
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		if(BP.bodypart_disabled)
			disabled += BP
		missing -= BP.body_zone

	for(var/X in disabled)
		var/obj/item/bodypart/BP = X
		var/damage_text
		if(!(BP.get_damage(include_stamina = FALSE) >= BP.max_damage)) //Stamina is disabling the limb
			damage_text = "limp and lifeless"
		else
			damage_text = (BP.brute_dam >= BP.burn_dam) ? BP.heavy_brute_msg : BP.heavy_burn_msg
		msg += "[capitalize(t_his)] [BP.name] is [damage_text]!\n"

	for(var/t in missing)
		if(t==BODY_ZONE_HEAD)
			msg += "[t_His] [parse_zone(t)] is missing!\n"
			continue
		msg += "[t_His] [parse_zone(t)] is missing!\n"

	var/temp = getBruteLoss()
	if(!(user == src && src.hal_screwyhud == SCREWYHUD_HEALTHY)) //fake healthy
		if(temp)
			if (temp < 25)
				msg += "[t_He] [t_has] minor bruising.\n"
			else if (temp < 50)
				msg += "[t_He] [t_has] moderate bruising!\n"
			else
				msg += "[t_He] [t_has] severe bruising!\n"

		temp = getFireLoss()
		if(temp)
			if (temp < 25)
				msg += "[t_He] [t_has] minor burns.\n"
			else if (temp < 50)
				msg += "[t_He] [t_has] moderate burns!\n"
			else
				msg += "[t_He] [t_has] severe burns!\n"

		temp = getCloneLoss()
		if(temp)
			if(temp < 25)
				msg += "[t_He] [t_is] slightly deformed.\n"
			else if (temp < 50)
				msg += "[t_He] [t_is] moderately deformed!\n"
			else
				msg += "[t_He] [t_is] severely deformed!\n"

	if(HAS_TRAIT(src, TRAIT_DUMB))
		msg += "[t_He] seem[p_s()] to be clumsy and unable to think.\n"

	if(fire_stacks > 0)
		msg += "[t_He] [t_is] covered in something flammable.\n"
	if(fire_stacks < 0)
		msg += "[t_He] look[p_s()] a little soaked.\n"

	if(pulledby?.grab_state)
		msg += "[t_He] [t_is] restrained by [pulledby]'s grip.\n"

	var/scar_severity = 0
	for(var/i in all_scars)
		var/datum/scar/S = i
		if(S.is_visible(user))
			scar_severity += S.severity

	switch(scar_severity)
		if(1 to 4)
			msg += "[t_He] [t_has] visible scarring, you can look again to take a closer look...\n"
		if(5 to 8)
			msg += "[t_He] [t_has] several bad scars, you can look again to take a closer look...\n"
		if(9 to 11)
			msg += "[t_He] [t_has] significantly disfiguring scarring, you can look again to take a closer look...\n"
		if(12 to INFINITY)
			msg += "[t_He] [t_is] just absolutely fucked up, you can look again to take a closer look...\n"

	msg += ""

	. += msg.Join("")

	switch(stat)
		if(SOFT_CRIT)
			. += "[t_His] breathing is shallow and labored."
		if(UNCONSCIOUS, HARD_CRIT)
			. += "[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep."

	var/trait_exam = common_trait_examine()
	if (!isnull(trait_exam))
		. += trait_exam

	var/datum/component/mood/mood = src.GetComponent(/datum/component/mood)
	if(mood)
		switch(mood.shown_mood)
			if(-INFINITY to MOOD_LEVEL_SAD4)
				. += "[t_He] look[p_s()] depressed."
			if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3)
				. += "[t_He] look[p_s()] very sad."
			if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2)
				. += "[t_He] look[p_s()] a bit down."
			if(MOOD_LEVEL_HAPPY2 to MOOD_LEVEL_HAPPY3)
				. += "[t_He] look[p_s()] quite happy."
			if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4)
				. += "[t_He] look[p_s()] very happy."
			if(MOOD_LEVEL_HAPPY4 to INFINITY)
				. += "[t_He] look[p_s()] ecstatic."
	. += "
" //info span, infobox div

	SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
	if(on_examined_check(user, FALSE))
		user.on_examine_atom(src, FALSE)

// this is stupid
/mob/living/carbon/examine_more(mob/user)
	if(!all_scars)
		return ..()

	var/list/visible_scars = list()
	for(var/i in all_scars)
		var/datum/scar/scar = i
		if(scar.is_visible(user))
			visible_scars |= scar

	if(!LAZYLEN(visible_scars))
		return ..()

	. = list(span_notice("I examine [src] closer, and note the following..."), "

")
	for(var/i in visible_scars)
		var/datum/scar/S = i
		var/scar_text = S.get_examine_description(user)
		if(scar_text)
			. += scar_text
	if(on_examined_check(user, TRUE))
		user.on_examine_atom(src, TRUE)

/// Examine messages
/mob/living/carbon/on_examine_atom(atom/examined, examine_more = FALSE)
	if(!client)
		return

	if((src == examined) || (!DirectAccess(examined) && get_dist(src, examined) > EYE_CONTACT_RANGE) || (stat >= UNCONSCIOUS) || is_blind())
		return

	if(CHECK_BITFIELD(wear_mask?.flags_inv, HIDEFACE) || CHECK_BITFIELD(head?.flags_inv, HIDEFACE) || CHECK_BITFIELD(glasses?.flags_inv, HIDEFACE))
		return

	if(!HAS_TRAIT(src, TRAIT_FLUORIDE_STARE))
		if(!ismob(examined))
			visible_message(span_emote(span_notice("[src] looks at [examined].")), \
							span_notice("I look at [examined]."), \
							vision_distance = EYE_CONTACT_RANGE)
		else
			var/mob/mob_examined = examined
			visible_message(span_emote(span_notice("[src] looks at \
							[examined].")), \
							span_notice("I look at [examined]."), \
							vision_distance = EYE_CONTACT_RANGE)
	else
		if(!ismob(examined))
			visible_message(span_emote(span_notice("[src] fluoride stares [examined].")), \
						span_notice("I fluoride stare [examined]."), \
						vision_distance = EYE_CONTACT_RANGE)
		else
			var/mob/mob_examined = examined
			visible_message(span_emote(span_notice("[src] fluoride stares \
						[examined].")), \
						span_notice("I fluoride stare [examined]."), \
						vision_distance = EYE_CONTACT_RANGE)


code:
/mob/living/carbon/update_health_hud(shown_health_amount)
	if(!client || !hud_used)
		return
	if(hud_used.healths)
		if(stat != DEAD)
			. = TRUE
			switch(pulse)
				if(PULSE_NONE)
					hud_used.healths.icon_state = "pulse7"
				if(PULSE_SLOW)
					hud_used.healths.icon_state = "pulse3"
				if(PULSE_NORM)
					hud_used.healths.icon_state = "pulse0"
				if(PULSE_FAST)
					hud_used.healths.icon_state = "pulse4"
				if(PULSE_FASTER)
					hud_used.healths.icon_state = "pulse5"
				if(PULSE_THREADY)
					hud_used.healths.icon_state = "pulse6"
				else
					hud_used.healths.icon_state = "pulse6"
		else
			hud_used.healths.icon_state = "pulse7"


code:
/mob/living/carbon/register_init_signals()
	. = ..()
	// Stimulant chemical stuff
	RegisterSignal(src, SIGNAL_ADDCHEMEFFECT(CE_SPEED), .proc/receive_speedboost)
	RegisterSignal(src, SIGNAL_REMOVECHEMEFFECT(CE_SPEED), .proc/remove_speedboost)
	// Combat message stuff
	RegisterSignal(src, COMSIG_CARBON_CLEAR_WOUND_MESSAGE, .proc/clear_wound_message)
	RegisterSignal(src, COMSIG_CARBON_ADD_TO_WOUND_MESSAGE, .proc/add_to_wound_message)

/mob/living/carbon/on_floored_start()
	if(body_position == STANDING_UP) //force them on the ground
		set_lying_angle(pick(90, 270))
		set_body_position(LYING_DOWN)
		on_fall()
		set_resting(TRUE)

/mob/living/carbon/on_floored_end()
	if(!resting)
		get_up()

/mob/living/carbon/proc/receive_speedboost(mob/living/carbon/source, chem_effect)
	var/speedboost = get_chem_effect(chem_effect)
	add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/chemical_effect/speedboost, TRUE, speedboost * SPEEDBOOST_SPEED_INCREASE)

/mob/living/carbon/proc/remove_speedboost(mob/living/carbon/source, chem_effect)
	remove_movespeed_modifier(/datum/movespeed_modifier/chemical_effect/speedboost, TRUE)

/mob/living/carbon/proc/clear_wound_message(datum/source)
	wound_message = ""

/mob/living/carbon/proc/add_to_wound_message(datum/source, new_message = "", clear_message = FALSE)
	if(clear_message)
		SEND_SIGNAL(src, COMSIG_CARBON_CLEAR_WOUND_MESSAGE)
	wound_message = "[wound_message][new_message]"


code:
/mob/living/carbon/Move(atom/newloc, direct = 0)
	. = ..()
	if(.)
		for(var/thing in all_injuries)
			var/datum/injury/injury = thing
			injury.movement_infect(src)
		for(var/thing in getorganslotlist(ORGAN_SLOT_BONE))
			var/obj/item/organ/bone/bone = thing
			bone.try_jostle(src)
		// Floating is easy
		if(!pulledby && !(movement_type & FLOATING))
			var/germ_level_increase = GERM_LEVEL_MOVEMENT_INCREASE
			//sprinting makes you sweaty faster
			if(combat_flags & COMBAT_FLAG_SPRINTING)
				germ_level_increase *= 2
			adjust_germ_level(germ_level_increase)
			if(HAS_TRAIT(src, TRAIT_NOHUNGER))
				set_nutrition(NUTRITION_LEVEL_FED - 1) //just less than feeling vigorous
			else if(nutrition && stat != DEAD)
				adjust_nutrition(-(total_nutriment_req/10))
				if(combat_flags & COMBAT_FLAG_SPRINTING)
					adjust_nutrition(-(total_nutriment_req/10))
			if(HAS_TRAIT(src, TRAIT_NOTHIRST))
				set_hydration(HYDRATION_LEVEL_HYDRATED - 1)
			else if(hydration && stat != DEAD)
				adjust_hydration(-(total_hydration_req/10))
				if(combat_flags & COMBAT_FLAG_SPRINTING)
					adjust_hydration(-(total_hydration_req/10))
			switch(encumbrance)
				if(ENCUMBRANCE_EXTREME)
					adjustFatigueLoss(5)
				if(ENCUMBRANCE_HEAVY)
					adjustFatigueLoss(2)
				if(ENCUMBRANCE_MEDIUM)
					adjustFatigueLoss(1)

/mob/living/carbon/set_usable_legs(new_value)
	. = ..()
	if(isnull(.))
		return

	if(. < 3 && usable_legs >= 3)
		REMOVE_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
		REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
	else if(usable_legs < 3 && !(movement_type & (FLYING | FLOATING))) //From having enough usable legs to no longer having them
		ADD_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
		if(!usable_hands)
			ADD_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)

	if(usable_legs < default_num_legs)
		ADD_TRAIT(src, TRAIT_SPRINT_LOCKED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
	else
		REMOVE_TRAIT(src, TRAIT_SPRINT_LOCKED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)

/mob/living/carbon/on_lying_down(new_lying_angle)
	. = ..()
	movement_locked = TRUE
	ADD_TRAIT(src, TRAIT_SPRINT_LOCKED, LYING_DOWN_TRAIT)

/mob/living/carbon/on_standing_up()
	. = ..()
	movement_locked = FALSE
	REMOVE_TRAIT(src, TRAIT_SPRINT_LOCKED, LYING_DOWN_TRAIT)

/mob/living/carbon/Bump(atom/A)
	. = ..()
	if(!CanPass(src, get_turf(A)) && ((combat_flags & COMBAT_FLAG_SPRINTING) || HAS_TRAIT(src, TRAIT_STUMBLE)))
		A.on_rammed(src)

/mob/living/carbon/proc/ram_stun()
	//Deal with knockdown
	switch(diceroll(GET_MOB_ATTRIBUTE_VALUE(src, STAT_DEXTERITY)))
		if(DICE_SUCCESS)
			Immobilize(2 SECONDS)
		if(DICE_FAILURE)
			Immobilize(2 SECONDS)
			CombatKnockdown(rand(50, 75))
		if(DICE_CRIT_FAILURE)
			drop_all_held_items()
			Immobilize(5 SECONDS)
			CombatKnockdown(rand(75, 100))
	//Deal with damage
	switch(diceroll(GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE)))
		if(DICE_SUCCESS)
			var/obj/item/bodypart/head = get_bodypart(BODY_ZONE_HEAD)
			if(head)
				head.receive_damage((ATTRIBUTE_MASTER - GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE))/2)
			else
				take_bodypart_damage((ATTRIBUTE_MASTER - GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE))/2)
		if(DICE_FAILURE)
			var/obj/item/bodypart/head = get_bodypart(BODY_ZONE_HEAD)
			if(head)
				head.receive_damage(ATTRIBUTE_MASTER - GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE))
			else
				take_bodypart_damage(ATTRIBUTE_MASTER - GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE))
		if(DICE_CRIT_FAILURE)
			var/obj/item/bodypart/head = get_bodypart(BODY_ZONE_HEAD)
			if(head)
				head.receive_damage((ATTRIBUTE_MASTER - GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE)) * 2)
			else
				take_bodypart_damage((ATTRIBUTE_MASTER - GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE)) * 2)
	SEND_SIGNAL(src, COMSIG_CARBON_CLEAR_WOUND_MESSAGE)

/// Proc to get a movespeed mod from stance limb efficiency
/mob/living/carbon/proc/update_stance_efficiency()
	var/stance_efficiency = 0
	for(var/thing in bodyparts)
		var/obj/item/bodypart/leg = thing
		if(leg.stance_index)
			stance_efficiency += (leg.limb_efficiency)/default_num_legs
	add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/limb_efficiency, multiplicative_slowdown = clamp((1 - (stance_efficiency/LIMB_EFFICIENCY_OPTIMAL)) * LIMB_EFFICIENCY_MAX_SLOWDOWN, LIMB_EFFICIENCY_MIN_SLOWDOWN, LIMB_EFFICIENCY_MAX_SLOWDOWN))


code:
/mob/living/carbon/can_feel_pain()
	if(HAS_TRAIT(src, TRAIT_NOPAIN))
		return FALSE
	return TRUE

/mob/living/carbon/update_shock()
	. = ..()
	if(!client || !hud_used)
		return
	if(traumatic_shock >= 30 && HAS_TRAIT(src, TRAIT_PAINLOVER))
		SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "pain", /datum/mood_event/paingood)
	else if(traumatic_shock >= 60)
		SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "pain", /datum/mood_event/painbad)
	if(hud_used.pain_guy)
		if(stat < DEAD)
			. = TRUE
			switch(traumatic_shock)
				if(-INFINITY to 5)
					hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]0"
				if(5 to 15)
					hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]1"
				if(15 to 30)
					hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]2"
				if(30 to 45)
					hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]3"
				if(45 to 60)
					hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]4"
				if(60 to 75)
					hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]5"
				if(75 to INFINITY)
					hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]6"
			if(!pulse)
				hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]dd"
			if(HAS_TRAIT(src, TRAIT_NOPAIN) || HAS_TRAIT(src, TRAIT_FAKEDEATH))
				hud_used.pain_guy.icon_state = "[hud_used.pain_guy.base_icon_state]u"
		else
			hud_used.pain_guy.icon_state = "paind"

/mob/living/carbon/handle_shock(delta_time, times_fired)
	. = ..()
	add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/traumatic_shock, TRUE, traumatic_shock * TRAUMATIC_SHOCK_SLOWDOWN_MULTIPLIER)
	if((stat >= UNCONSCIOUS) || !can_feel_pain())
		return

	var/maxbpshock = 0
	var/obj/item/bodypart/damaged_bodypart = null
	for(var/obj/item/bodypart/BP in bodyparts)
		if(!BP.can_feel_pain())
			continue
		var/bpshock = BP.get_shock(FALSE, TRUE)
		// make the choice of the organ depend on damage,
		// but also sometimes use one of the less damaged ones
		if(bpshock >= maxbpshock && (maxbpshock <= 0 || prob(70)) )
			damaged_bodypart = BP
			maxbpshock = bpshock

	if(damaged_bodypart && (get_chem_effect(CE_PAINKILLER) < maxbpshock))
		if((damaged_bodypart.held_index) && maxbpshock >= 15 && prob(maxbpshock/2))
			var/obj/item/droppy = get_item_for_held_index(damaged_bodypart.held_index)
			if(droppy)
				dropItemToGround(droppy)
		var/burning = (damaged_bodypart.burn_dam > damaged_bodypart.brute_dam)
		var/msg
		switch(maxbpshock)
			if(1 to 10)
				msg =  "My [damaged_bodypart.name] [burning ? "burns" : "hurts"]."
			if(11 to 90)
				msg = "My [damaged_bodypart.name] [burning ? "burns" : "hurts"] badly!"
			if(91 to INFINITY)
				msg = "OH GOD! My [damaged_bodypart.name] is [burning ? "on fire" : "hurting terribly"]!"
		custom_pain(msg, maxbpshock, FALSE, damaged_bodypart, TRUE)

	// Damage to internal organs hurts a lot.
	for(var/obj/item/organ/organ as anything in internal_organs)
		if(prob(1) && organ.can_feel_pain() && (organ.get_shock() >= 5))
			var/obj/item/bodypart/parent = get_bodypart(organ.current_zone)
			if(parent)
				var/pain = 10
				var/message = "I feel a dull pain in my [parent.name]."
				if(organ.is_failing())
					pain = 40
					message = "I feel a sharp pain in my [parent.name]!"
				else if(organ.damage >= organ.low_threshold)
					pain = 25
					message = "I feel a pain in my [parent.name]."
				custom_pain(message, pain, FALSE, parent)

	var/general_damage_message = null
	var/general_message_prob = 1
	var/general_damage = (getToxLoss() + getCloneLoss())
	switch(general_damage)
		if(1 to 5)
			general_message_prob = 1
			general_damage_message = "My body stings slightly."
		if(5 to 10)
			general_message_prob = 2
			general_damage_message = "My whole body hurts a little."
		if(10 to 20)
			general_message_prob = 2
			general_damage_message = "My whole body hurts."
		if(20 to 30)
			general_message_prob = 3
			general_damage_message = "My whole body hurts badly."
		if(30 to INFINITY)
			general_message_prob = 6
			general_damage_message = "My body aches all over, it's driving me mad!"

	if(general_damage_message && prob(general_message_prob))
		custom_pain(general_damage_message, general_damage)

/mob/living/carbon/proc/print_pain()
	return check_self_for_injuries()

/mob/living/carbon/handle_shock_stage(delta_time, times_fired)
	. = ..()
	if(!can_feel_pain())
		setShockStage(0)
		return

	var/previous_shock_stage = shock_stage
	var/our_endurance = GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE)
	if(traumatic_shock >= (PAIN_GIVES_IN * (our_endurance/ATTRIBUTE_MIDDLING)))
		if(body_position == LYING_DOWN)
			Knockdown(4 SECONDS)
		else
			visible_message(span_danger("[src] gives in to the pain!"), \
					span_animatedpain("I give in to the pain!"))
			//Scream
			death_scream()
			//Blood on screen
			flash_pain(traumatic_shock)
			//Immobilize for a second
			Immobilize(1 SECONDS)
			//Fall down
			addtimer(CALLBACK(src, .proc/Knockdown, 4 SECONDS), 1 SECONDS)

	//Cardiac arrest automatically throws us into sofcrit territory
	if(undergoing_cardiac_arrest())
		setShockStage(max(shock_stage, SHOCK_STAGE_4))
		add_movespeed_modifier(/datum/movespeed_modifier/cardiac_arrest, TRUE)
	else
		remove_movespeed_modifier(/datum/movespeed_modifier/cardiac_arrest, TRUE)

	if(traumatic_shock >= max(SHOCK_STAGE_2, 0.8 * shock_stage))
		adjustShockStage(0.5 * delta_time * (ATTRIBUTE_MIDDLING/our_endurance))
	else if(!undergoing_cardiac_arrest())
		setShockStage(min(shock_stage, SHOCK_STAGE_7))
		var/recovery = 0.5 * delta_time
		//Lower shock faster the less pain we feel
		if(traumatic_shock < 0.5 * shock_stage)
			recovery += 0.5 * delta_time
		if(traumatic_shock < 0.25 * shock_stage)
			recovery += 0.5 * delta_time
		adjustShockStage(-recovery * (our_endurance/ATTRIBUTE_MIDDLING))

	//Shock makes us slow
	if(shock_stage >= (SHOCK_STAGE_2 * (our_endurance/ATTRIBUTE_MIDDLING)))
		add_movespeed_modifier(/datum/movespeed_modifier/shock_stage, TRUE)
	else
		remove_movespeed_modifier(/datum/movespeed_modifier/shock_stage, TRUE)

	if((stat >= UNCONSCIOUS) || (shock_stage <= 0))
		return

	if((shock_stage >= SHOCK_STAGE_1) && (previous_shock_stage < SHOCK_STAGE_1))
		// Please be very careful when calling custom_pain() from within code that relies on pain/trauma values. There's the
		// possibility of a feedback loop from custom_pain() being called with a positive power, incrementing pain on a limb,
		// which triggers this proc, which calls custom_pain(), etc. Make sure you call it with nopainloss = TRUE in these cases!
		custom_pain("[pick("It hurts so much", "I really need some painkillers", "OH GOD! The pain")]!", 10, nopainloss = TRUE)

	if((shock_stage >= SHOCK_STAGE_2) && (previous_shock_stage < SHOCK_STAGE_2))
		visible_message("is having trouble keeping [p_their()] eyes open.", visible_message_flags = EMOTE_MESSAGE)

	if((shock_stage >= SHOCK_STAGE_2) && (previous_shock_stage >= SHOCK_STAGE_2))
		if(prob(35))
			blur_eyes(rand(1, 2))
			stuttering = max(stuttering, 5)

	if((shock_stage >= SHOCK_STAGE_3) && (previous_shock_stage < SHOCK_STAGE_3))
		custom_pain("[pick("The pain is excruciating", "Please, just end the pain", "My whole body is going numb")]!", 40, nopainloss = TRUE)

	if((shock_stage >= SHOCK_STAGE_4) && (previous_shock_stage < SHOCK_STAGE_4))
		visible_message("becomes limp.", visible_message_flags = EMOTE_MESSAGE)
		Immobilize(rand(2, 5) SECONDS)

	if((shock_stage >= SHOCK_STAGE_4) && (previous_shock_stage >= SHOCK_STAGE_4))
		if(prob(2))
			custom_pain("[pick("The pain is excruciating", "Please, just end the pain", "My whole body is going numb")]!", shock_stage, nopainloss = TRUE)
			Knockdown(20 SECONDS)
		if(prob(2) && (getStaminaLoss() < 50))
			setStaminaLoss(50)
		if(prob(4))
			agony_gasp()

	if((shock_stage >= SHOCK_STAGE_5) && (previous_shock_stage >= SHOCK_STAGE_5))
		if(prob(5))
			custom_pain("[pick("The pain is excruciating", "Please, just end the pain", "My whole body is going numb")]!", shock_stage, nopainloss = TRUE)
			Paralyze(40 SECONDS)

	if((shock_stage >= SHOCK_STAGE_6) && (previous_shock_stage >= SHOCK_STAGE_6))
		if(prob(2))
			if(!IsUnconscious())
				custom_pain("[pick("I black out", "I feel like i could die at any moment now", "I'm about to lose consciousness")]!", shock_stage, nopainloss = TRUE)
			Unconscious(10 SECONDS)
		if(prob(2) && (getStaminaLoss() < 85))
			setStaminaLoss(85)

	if((shock_stage >= SHOCK_STAGE_7) && (previous_shock_stage < SHOCK_STAGE_7))
		if(body_position != LYING_DOWN)
			visible_message("[src] can no longer stand, collapsing!")
		adjustStaminaLoss(150)
		agony_gargle()
		Paralyze(40 SECONDS)

	if((shock_stage >= SHOCK_STAGE_7) && (previous_shock_stage >= SHOCK_STAGE_7))
		Paralyze(40 SECONDS)
		if(prob(2))
			Unconscious(10 SECONDS)
		if(prob(8))
			agony_gargle()

	if((shock_stage >= SHOCK_STAGE_8) && (previous_shock_stage < SHOCK_STAGE_8))
		//Death is near...
		death_scream()
		Unconscious(20 SECONDS)

	if((shock_stage >= SHOCK_STAGE_8) && (previous_shock_stage >= SHOCK_STAGE_8))
		//How the fuck are we still alive?
		if(!IsUnconscious())
			visible_message(PAIN_KNOCKOUT_MESSAGE, visible_message_flags = EMOTE_MESSAGE)
			custom_pain(PAIN_KNOCKOUT_MESSAGE_SELF, 100, nopainloss = TRUE)
			death_rattle()
		Unconscious(20 SECONDS)

/**
 * Adds pain onto a limb while giving the player a message styled depending on the powerf of the pain added.
 *
 * Arguments:
 * * Message is the custom message to be displayed
 * * Power decides how much painkillers will stop the message, as well as how much pain it causes
 * * Forced means it ignores anti-spam timer
 */
/mob/living/carbon/custom_pain(message, power, forced, obj/item/bodypart/affecting, nopainloss = FALSE)
	if((stat >= UNCONSCIOUS) || !can_feel_pain() || (world.time < next_pain_time))
		return FALSE

	if(affecting && !affecting.can_feel_pain())
		return FALSE

	// Take the edge off
	power -= get_chem_effect(CE_PAINKILLER)
	if(power <= 0)
		return FALSE

	// Le pain
	if(!nopainloss && power)
		if(affecting)
			affecting.add_pain(CEILING(power, 1))
		else
			adjustPainLoss(CEILING(power, 1))

	// Anti message spam checks
	if(forced || (message != last_pain_message) || (world.time >= next_pain_message_time))
		last_pain_message = message
		if(world.time >= next_pain_message_time)
			to_chat(src, span_animatedpain("[message]"))

		var/force_emote
		if(ishuman(src))
			var/mob/living/carbon/human/H = src
			if(H.dna?.species)
				force_emote = H.dna.species.get_pain_emote(power)
		if(force_emote && prob(power))
			emote(force_emote)

	// Briefly flash the pain overlay
	flash_pain(power)
	next_pain_time = world.time + (rand(100, 150) + power)
	next_pain_message_time = world.time + (200 + power)
	return TRUE

/mob/living/carbon/check_self_for_injuries()
	if(stat < UNCONSCIOUS)
		visible_message(span_notice("[src] examines [p_themselves()]."), \
						span_notice("I check myself."))

	var/list/return_text = list("
")
	return_text += span_notice("Let's see how I am doing.")
	if(stat < DEAD)
		return_text += span_notice("\nI am still alive[stat < UNCONSCIOUS ? "" : ", but i am [HAS_TRAIT(src, TRAIT_TRYINGTOSLEEP) ? "sleeping" :"unconscious"]"].")
	else
		return_text += span_dead("\nI am dead.")
	for(var/X in ALL_BODYPARTS)
		var/obj/item/bodypart/LB = get_bodypart(X)

		if(!LB)
			return_text += span_info("\n• [capitalize(parse_zone(X))]: MISSING")
			continue

		if(LB.is_stump())
			return_text += span_info("\n• [capitalize(parse_zone(X))]: STUMP")
			continue

		var/limb_max_damage = LB.max_damage
		var/limb_max_pain = min(100, LB.max_pain_damage)
		var/list/status = list()
		var/brutedamage = LB.brute_dam
		var/burndamage = LB.burn_dam
		var/paindamage = LB.get_shock(TRUE, TRUE)
		if(hallucination)
			if(prob(30))
				brutedamage += rand(30,40)
			if(prob(30))
				burndamage += rand(30,40)
			if(prob(30))
				paindamage += rand(30,40)

		if(HAS_TRAIT(src, TRAIT_SELF_AWARE))
			if(brutedamage)
				status += "= 5 ? "danger" : "notice"]'>[brutedamage] BRUTE"
			if(burndamage)
				status += "= 5 ? "danger" : "notice"]'>[burndamage] BURN"
			if(paindamage)
				status += "= 10 ? "danger" : "notice"]'>[paindamage] PAIN"
		else
			if(brutedamage >= (limb_max_damage*0.75))
				status += span_userdanger("[uppertext(LB.heavy_brute_msg)]")
			else if(brutedamage >= (limb_max_damage*0.5))
				status += span_userdanger("[uppertext(LB.heavy_brute_msg)]")
			else if(brutedamage >= (limb_max_damage*0.25))
				status += span_danger("[uppertext(LB.medium_brute_msg)]")
			else if(brutedamage > 0)
				status += span_warning("[uppertext(LB.light_brute_msg)]")

			if(burndamage >= (limb_max_damage*0.75))
				status += span_userdanger("[uppertext(LB.heavy_burn_msg)]")
			else if(burndamage >= (limb_max_damage*0.5))
				status += span_userdanger("[uppertext(LB.heavy_burn_msg)]")
			else if(burndamage >= (limb_max_damage*0.25))
				status += span_danger("[uppertext(LB.medium_burn_msg)]")
			else if(burndamage > 0)
				status += span_warning("[uppertext(LB.light_burn_msg)]")

			if(paindamage >= (limb_max_pain*0.75))
				status += span_userdanger("[uppertext(LB.heavy_pain_msg)]")
			else if(paindamage >= (limb_max_pain*0.5))
				status += span_danger("[uppertext(LB.heavy_pain_msg)]")
			else if(paindamage >= (limb_max_pain*0.25))
				status += span_lowpain("[uppertext(LB.medium_pain_msg)]")
			else if(paindamage > 0)
				status += span_lowestpain("[lowertext(LB.light_pain_msg)]")

		for(var/thing in LB.wounds)
			var/datum/wound/hurted = thing
			var/woundmsg
			woundmsg = "[uppertext(hurted.name)]"
			switch(hurted.severity)
				if(WOUND_SEVERITY_TRIVIAL)
					status += span_warning("[woundmsg]")
				if(WOUND_SEVERITY_MODERATE)
					status += span_warning("[woundmsg]")
				if(WOUND_SEVERITY_SEVERE)
					status += span_danger("[woundmsg]")
				if(WOUND_SEVERITY_CRITICAL)
					status += span_userdanger("[woundmsg]")
			if(hurted.show_wound_topic(src))
				status = "[woundmsg]"

		if(LB.embedded_objects)
			for(var/obj/item/I in LB.embedded_objects)
				status += span_warning("[I.isEmbedHarmless() ? "STUCK" : "EMBEDDED"] [uppertext(I.name)]")

		if(LB.get_bleed_rate())
			if(LB.get_bleed_rate() >= 3) //Totally arbitrary value
				status += span_danger("BLEEDING")
			else
				status += span_danger("BLEEDING")

		if(LB.bodypart_disabled)
			status += span_danger("DISABLED")

		if(LB.body_zone == BODY_ZONE_PRECISE_MOUTH)
			var/obj/item/bodypart/mouth/jaw = LB
			if(jaw.tapered)
				if(!wear_mask)
					status += span_warning("TAPED")

		if(LB.current_gauze)
			status += span_info("GAUZED")

		if(LB.current_splint)
			status += span_info("SPLINTED")

		if(!length(status))
			status += span_nicegreen("OK")

		return_text += span_info("\n• [capitalize(LB.name)]: [jointext(status, " | ")]")
	return_text += "
" //div infobox
	to_chat(src, jointext(return_text, ""))
	return TRUE


code:
// asystole or no lung niggas cant emote proper
/mob/living/carbon/say(message, bubble_type, list/spans, sanitize, datum/language/language, ignore_spam, forced, filterproof = FALSE)
	var/lung_efficiency = getorganslotefficiency(ORGAN_SLOT_LUNGS)
	if(undergoing_cardiac_arrest() || losebreath || (needs_lungs() && (lung_efficiency < ORGAN_FAILING_EFFICIENCY)))
		return emote("loudnoise")
	var/vocal_cord_efficiency = getorganslotefficiency(ORGAN_SLOT_VOICE)
	var/obj/item/bodypart/mouth/jaw = get_bodypart_nostump(BODY_ZONE_PRECISE_MOUTH)
	if(!jaw || jaw.bodypart_disabled || (vocal_cord_efficiency < ORGAN_FAILING_EFFICIENCY))
		message = handle_vocal_cord_torn(message)
	return ..()

/mob/living/carbon/proc/handle_vocal_cord_torn(message)
	message = uppertext(message)
	if(prob(20))
		message = pick("GHHHHHH...", "GLLLL...", "ZZRRRRR...")
	else
		var/new_message = ""
		var/m_len = length(message)
		var/tracker = 1
		while(tracker < m_len)
			var/nletter = copytext(message, tracker, tracker + 1)
			if(!(nletter in list("A", "E", "I", "O", "U", " ")) && (tracker % 2))
				nletter = pick("GH", "SHK", "KSS", "SS", "GNHH")
			else if((nletter == " ") && prob(50))
				nletter = "... "
			new_message += nletter
			tracker++
		for(var/uhoh in list("E", "I", "O"))
			new_message = replacetext(new_message, uhoh, pick("H", "G", "GHHH", "GRRR", "GLLL", "ZZZGH", "GLRG", "... ", "RRR"))
		new_message = replacetext(new_message, "U", pick("UHHH", "UH... "))
		message = new_message
	return message


code:
/mob/living/carbon/update_sight()
	if(!client)
		return

	if(stat == DEAD)
		sight = (SEE_TURFS|SEE_MOBS|SEE_OBJS)
		see_in_dark = 8
		see_invisible = SEE_INVISIBLE_OBSERVER
		return

	sight = initial(sight)
	lighting_alpha = initial(lighting_alpha)
	var/obj/item/bodypart/left_eyesocket = LAZYACCESS(eye_bodyparts, 1)
	var/obj/item/bodypart/right_eyesocket = LAZYACCESS(eye_bodyparts, 2)
	var/obj/item/organ/eyes/LE
	var/obj/item/organ/eyes/RE
	for(var/obj/item/organ/eyes/eye in left_eyesocket?.get_organs())
		LE = eye
		break
	for(var/obj/item/organ/eyes/eye in right_eyesocket?.get_organs())
		RE = eye
		break
	if(LE || RE)
		see_in_dark = max(RE?.see_in_dark, LE?.see_in_dark)
		see_invisible = max(RE?.see_invisible, LE?.see_invisible)
		sight |= RE?.sight_flags
		sight |= LE?.sight_flags
		if(!isnull(RE?.lighting_alpha) && !isnull(LE?.lighting_alpha))
			lighting_alpha = min(RE?.lighting_alpha, LE?.lighting_alpha)
		else if(!isnull(RE?.lighting_alpha))
			lighting_alpha = RE?.lighting_alpha
		else if(!isnull(LE?.lighting_alpha))
			lighting_alpha = LE?.lighting_alpha
	else
		update_tint()

	if(client.eye != src)
		var/atom/A = client.eye
		if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
			return

	if(glasses)
		var/obj/item/clothing/glasses/G = glasses
		sight |= G.vision_flags
		see_in_dark = max(G.darkness_view, see_in_dark)
		if(G.invis_override)
			see_invisible = G.invis_override
		else
			see_invisible = min(G.invis_view, see_invisible)
		if(!isnull(G.lighting_alpha))
			lighting_alpha = min(lighting_alpha, G.lighting_alpha)

	if(HAS_TRAIT(src, TRAIT_THERMAL_VISION))
		sight |= (SEE_MOBS)
		lighting_alpha = min(lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)

	if(HAS_TRAIT(src, TRAIT_XRAY_VISION))
		sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
		see_in_dark = max(see_in_dark, 8)

	if(see_override)
		see_invisible = see_override

	if(SSmapping.level_trait(z, ZTRAIT_NOXRAY))
		sight = null

	return ..()

/mob/living/carbon/set_usable_eyes(new_value)
	. = ..()
	if(isnull(.))
		return
	update_eyes()
	update_sight()
	update_tint()

/mob/living/carbon/proc/update_eyes()
	if(!client)
		return

	var/obj/item/bodypart/left_eyesocket = LAZYACCESS(eye_bodyparts, 1)
	var/obj/item/bodypart/right_eyesocket = LAZYACCESS(eye_bodyparts, 2)
	var/obj/item/organ/eyes/LE
	var/obj/item/organ/eyes/RE
	for(var/obj/item/organ/eyes/eye in left_eyesocket?.get_organs())
		LE = eye
		break
	for(var/obj/item/organ/eyes/eye in right_eyesocket?.get_organs())
		RE = eye
		break
	var/left_damage = (LE ? LE.get_eye_damage_level() : 3)
	var/right_damage = (RE ? RE.get_eye_damage_level() : 3)
	if((left_damage >= 3) && (right_damage >= 3))
		become_blind(EYE_DAMAGE)
		return TRUE
	else
		cure_blind(EYE_DAMAGE)

	var/fuck_with_fov = TRUE
	if(head && (head.fov_angle || head.fov_shadow_angle))
		fuck_with_fov = FALSE

	var/datum/component/field_of_vision/fov = GetComponent(/datum/component/field_of_vision)
	if(fuck_with_fov && fov)
		if(left_damage >= 3)
			fov.generate_fov_holder(source = src, _angle = 45, _shadow_angle = FOV_180PLUS45_DEGREES, register = FALSE, delete_holder = TRUE)
		else if(right_damage >= 3)
			fov.generate_fov_holder(source = src, _angle = -45, _shadow_angle = FOV_180MINUS45_DEGREES, register = FALSE, delete_holder = TRUE)

	if((left_damage in 1 to 2) && !fov)
		overlay_fullscreen("left_eye_damage", /atom/movable/screen/fullscreen/impaired/left, left_damage)
	else
		clear_fullscreen("left_eye_damage")
	if(!left_damage && fuck_with_fov && fov && fov.shadow_angle == FOV_180PLUS45_DEGREES)
		fov.generate_fov_holder(source = src, _angle = 0, _shadow_angle = FOV_90_DEGREES, register = FALSE, delete_holder = TRUE)

	if((right_damage in 1 to 2) && !fov)
		overlay_fullscreen("right_eye_damage", /atom/movable/screen/fullscreen/impaired/right, right_damage)
	else
		clear_fullscreen("right_eye_damage")
	if(!right_damage && fuck_with_fov && fov && fov.shadow_angle == FOV_180MINUS45_DEGREES)
		fov.generate_fov_holder(source = src, _angle = 0, _shadow_angle = FOV_90_DEGREES, register = FALSE, delete_holder = TRUE)

	return TRUE

/mob/living/carbon/proc/get_total_tint()
	. = 0
	if(isclothing(head))
		. += head.tint
	if(isclothing(wear_mask))
		. += wear_mask.tint

	var/obj/item/bodypart/left_eyesocket = LAZYACCESS(eye_bodyparts, 1)
	var/obj/item/bodypart/right_eyesocket = LAZYACCESS(eye_bodyparts, 2)
	var/obj/item/organ/eyes/LE
	var/obj/item/organ/eyes/RE
	for(var/obj/item/organ/eyes/eye in left_eyesocket?.get_organs())
		LE = eye
		break
	for(var/obj/item/organ/eyes/eye in right_eyesocket?.get_organs())
		RE = eye
		break

	if(!RE && !LE)
		return INFINITY //we blind


code:
/mob/living/carbon/update_inv_hands()
	remove_overlay(HANDS_LAYER)
	if (handcuffed)
		drop_all_held_items()
		return

	var/list/hands = list()
	for(var/obj/item/I in held_items)
		if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
			I.screen_loc = ui_hand_position(get_held_index_of_item(I))
			client.screen += I
			if(length(observers))
				for(var/mob/dead/observe as anything in observers)
					if(observe.client && observe.client.eye == src)
						observe.client.screen += I
					else
						observers -= observe
						if(!observers.len)
							observers = null
							break

		var/icon_file = I.lefthand_file
		if(get_held_index_of_item(I) % 2 == 0)
			icon_file = I.righthand_file

		hands += I.build_worn_icon(default_layer = HANDS_LAYER, default_icon_file = icon_file, isinhands = TRUE)

	if(length(hands))
		overlays_standing[HANDS_LAYER] = hands

	apply_overlay(HANDS_LAYER)

/mob/living/carbon/update_inv_head()
	remove_overlay(HEAD_LAYER)

	if(!get_bodypart_nostump(BODY_ZONE_HEAD)) //Decapitated
		return

	if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1])
		var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_HEAD) + 1]
		inv.update_icon()

	if(head)
		var/desired_icon = head.worn_icon
		var/used_style = NONE
		if(dna?.species?.mutant_bodyparts["snout"])
			var/datum/sprite_accessory/snouts/S = GLOB.sprite_accessories["snout"][dna.species.mutant_bodyparts["snout"][MUTANT_INDEX_NAME]]
			if(S.use_muzzled_sprites && head.mutant_variants & STYLE_MUZZLE)
				used_style = STYLE_MUZZLE
		switch(used_style)
			if(STYLE_MUZZLE)
				desired_icon = head.worn_icon_muzzled || 'modular_septic/icons/mob/clothing/head_muzzled.dmi'

		overlays_standing[HEAD_LAYER] = head.build_worn_icon(default_layer = HEAD_LAYER, default_icon_file = 'icons/mob/clothing/head.dmi', override_icon = desired_icon, mutant_styles = used_style)
		update_hud_head(head)

	apply_overlay(HEAD_LAYER)

/mob/living/carbon/update_inv_wear_mask()
	remove_overlay(FACEMASK_LAYER)

	if(!get_bodypart_nostump(BODY_ZONE_HEAD)) //Decapitated
		return

	if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1])
		var/atom/movable/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1]
		inv.update_icon()

	if(wear_mask)
		var/desired_icon = wear_mask.worn_icon
		var/used_style = NONE
		if(dna?.species?.mutant_bodyparts["snout"])
			var/datum/sprite_accessory/snouts/S = GLOB.sprite_accessories["snout"][dna.species.mutant_bodyparts["snout"][MUTANT_INDEX_NAME]]
			if(S.use_muzzled_sprites && wear_mask.mutant_variants & STYLE_MUZZLE)
				used_style = STYLE_MUZZLE
		switch(used_style)
			if(STYLE_MUZZLE)
				desired_icon = wear_mask.worn_icon_muzzled || 'modular_septic/icons/mob/clothing/mask_muzzled.dmi'

		if(!(ITEM_SLOT_MASK in check_obscured_slots()))
			overlays_standing[FACEMASK_LAYER] = wear_mask.build_worn_icon(default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/clothing/mask.dmi', override_icon = desired_icon, mutant_styles = used_style)
		update_hud_wear_mask(wear_mask)

	apply_overlay(FACEMASK_LAYER)

/mob/living/carbon/update_body()
	if(status_flags & BUILDING_ORGANS)
		return
	update_body_parts()

/mob/living/carbon/update_body_parts()
	//CHECK FOR UPDATE
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		BP.update_limb()
	var/oldkey = icon_render_key
	icon_render_key = generate_icon_render_key()
	if(oldkey == icon_render_key)
		return

	remove_overlay(BODYPARTS_LAYER)

	//LOAD ICONS
	if(limb_icon_cache[icon_render_key])
		load_limb_from_cache()
		return

	var/is_taur = FALSE
	if(dna?.species.mutant_bodyparts["taur"])
		var/datum/sprite_accessory/taur/S = GLOB.sprite_accessories["taur"][dna.species.mutant_bodyparts["taur"][MUTANT_INDEX_NAME]]
		if(S.hide_legs)
			is_taur = TRUE

	//GENERATE NEW LIMBS
	var/list/new_limbs = list()
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		if(is_taur && (BP.body_part & LEGS|FEET))
			continue
		var/bp_icon = BP.get_limb_icon()
		if(islist(bp_icon) && length(bp_icon))
			new_limbs |= bp_icon
	if(length(new_limbs))
		overlays_standing[BODYPARTS_LAYER] = new_limbs
		limb_icon_cache[icon_render_key] = new_limbs

	apply_overlay(BODYPARTS_LAYER)

	update_damage_overlays()
	update_medicine_overlays()

/mob/living/carbon/generate_icon_render_key()
	. = "carbon"
	var/husked = FALSE
	if(dna?.species)
		. += "-markingalpha[dna.species.markings_alpha]"
	if(dna?.species?.mutant_bodyparts["taur"])
		. += "-taur[dna.species.mutant_bodyparts["taur"][MUTANT_INDEX_NAME]]"
	if(HAS_TRAIT(src, TRAIT_HUSK))
		husked = TRUE
		. += "-husk"
	if(dna.check_mutation(HULK))
		. += "-coloured-hulk"
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		. += "-[BP.body_zone]"
		if(BP.is_stump())
			. += "-stump"
		if(BP.animal_origin)
			. += "-[BP.animal_origin]"
		if(BP.status == BODYPART_ORGANIC)
			. += "-organic"
		else if(BP.status == BODYPART_ROBOTIC)
			. += "-robotic"
		if(BP.body_gender && BP.gender_rendering)
			. += "-gender[BP.body_gender]"
		if(BP.species_id)
			. += "-[BP.species_id]"
		if(BP.color)
			. += "-color[BP.color]"
		if(BP.use_digitigrade)
			. += "-digitigrade[BP.use_digitigrade]"
		if(BP.dmg_overlay_type)
			. += "-[BP.dmg_overlay_type]"
		if(HAS_TRAIT(BP, TRAIT_ROTTEN))
			. += "-rotten"
		else if(HAS_TRAIT(BP, TRAIT_PLASMABURNT))
			. += "-plasmaburnt"
		else if(HAS_TRAIT(BP, TRAIT_HUSK))
			. += "-husk"
		if(BP.advanced_rendering)
			. += "-advanced_render"
		for(var/zone in BP.body_markings)
			for(var/key in BP.body_markings[zone])
				var/datum/body_marking/marking = GLOB.body_markings[key]
				var/marking_string = "-marking-[marking.icon_state]"
				if(husked || HAS_TRAIT(BP, TRAIT_HUSK))
					marking_string += "-markingcolor888888"
				else
					marking_string += "-markingcolor[BP.body_markings[zone][key]]"
				. += marking_string

//change the mob's icon to the one matching its key
/mob/living/carbon/load_limb_from_cache()
	remove_overlay(BODYPARTS_LAYER)

	if(limb_icon_cache[icon_render_key])
		overlays_standing[BODYPARTS_LAYER] = limb_icon_cache[icon_render_key]

	apply_overlay(BODYPARTS_LAYER)

	update_damage_overlays()
	update_medicine_overlays()

/mob/living/carbon/update_fire(fire_icon = "generic_mob_burning")
	remove_overlay(FIRE_LAYER)

	if(on_fire || HAS_TRAIT(src, TRAIT_PERMANENTLY_ONFIRE))
		var/mutable_appearance/new_fire_overlay = mutable_appearance('modular_septic/icons/mob/human/overlays/onfire.dmi', fire_icon, -FIRE_LAYER)
		new_fire_overlay.appearance_flags = RESET_COLOR
		overlays_standing[FIRE_LAYER] = new_fire_overlay

	apply_overlay(FIRE_LAYER)

/mob/living/carbon/update_damage_overlays()
	remove_overlay(DAMAGE_LAYER)

	var/mutable_appearance/damage_overlays = mutable_appearance('modular_septic/icons/mob/human/overlays/damage.dmi', "blank", -DAMAGE_LAYER)
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		if(BP.is_stump())
			continue
		if(BP.dmg_overlay_type)
			var/image/damage = image('modular_septic/icons/mob/human/overlays/damage.dmi', "[BP.dmg_overlay_type]_[BP.body_zone]_[BP.brutestate]0")
			damage.layer = -DAMAGE_LAYER
			if(BP.render_layer == HANDS_PART_LAYER)
				damage.layer = -UPPER_DAMAGE_LAYER
			damage_overlays.add_overlay(damage)
	overlays_standing[DAMAGE_LAYER] = damage_overlays

	apply_overlay(DAMAGE_LAYER)

/mob/living/carbon/proc/update_medicine_overlays()
	remove_overlay(MEDICINE_LAYER)

	var/mutable_appearance/medicine_overlays = mutable_appearance('modular_septic/icons/mob/human/overlays/medicine_overlays.dmi', "blank", -MEDICINE_LAYER)
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		if(BP.is_stump())
			continue
		var/image/gauze
		if(BP.current_gauze?.medicine_overlay_prefix)
			gauze = image('modular_septic/icons/mob/human/overlays/medicine_overlays.dmi', "[BP.current_gauze.medicine_overlay_prefix]_[BP.body_zone][BP.use_digitigrade ? "_digitigrade" : "" ]")
			gauze.layer = -MEDICINE_LAYER
			if(BP.render_layer == HANDS_PART_LAYER)
				gauze.layer = -UPPER_MEDICINE_LAYER
			medicine_overlays.add_overlay(gauze)
		var/image/splint
		if(BP.current_splint?.medicine_overlay_prefix)
			splint = image('modular_septic/icons/mob/human/overlays/medicine_overlays.dmi', "[BP.current_splint.medicine_overlay_prefix]_[check_zone(BP.body_zone)][BP.use_digitigrade ? "_digitigrade" : "" ]")
			splint.layer = -MEDICINE_LAYER
			if(BP.render_layer == HANDS_PART_LAYER)
				splint.layer = -UPPER_MEDICINE_LAYER
			medicine_overlays.add_overlay(splint)
	overlays_standing[MEDICINE_LAYER] = medicine_overlays

	apply_overlay(MEDICINE_LAYER)

/mob/living/carbon/proc/update_artery_overlays()
	remove_overlay(ARTERY_LAYER)

	var/mutable_appearance/arteries = mutable_appearance('modular_septic/icons/mob/human/overlays/artery.dmi', "blank", -MEDICINE_LAYER)
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		if(BP.is_stump() || !BP.is_organic_limb() || !BP.get_bleed_rate())
			continue
		var/image/artery
		if(BP.is_artery_torn())
			artery = image('modular_septic/icons/mob/human/overlays/artery.dmi', "[BP.body_zone]_artery1")
			artery.layer = -ARTERY_LAYER
			arteries.add_overlay(artery)
	overlays_standing[ARTERY_LAYER] = arteries

	apply_overlay(ARTERY_LAYER)

/mob/living/carbon/proc/update_smelly()
	remove_overlay(SMELL_LAYER)


code:
/mob/living/carbon/proc/update_maximum_carry_weight()
	maximum_carry_weight = (GET_MOB_ATTRIBUTE_VALUE(src, STAT_STRENGTH) + GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE)) * 3.6

/mob/living/carbon/proc/update_carry_weight()
	. = 0
	var/list/inventory_items = list(back, wear_mask, wear_neck, head, gloves, shoes, glasses)
	//we do need a typecheck here to avoid nulls
	for(var/obj/item/thing in inventory_items)
		. += thing.get_carry_weight()
	for(var/obj/item/thing in held_items)
		. += thing.get_carry_weight()
	carry_weight = .
	update_encumbrance()

/mob/living/carbon/proc/update_encumbrance()
	if(carry_weight >= (maximum_carry_weight * 1.1))
		encumbrance = ENCUMBRANCE_EXTREME
		add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/carry_weight, TRUE, 10)
		add_or_update_variable_fatigue_modifier(/datum/fatigue_modifier/weight, TRUE, -75)
	else if(carry_weight >= maximum_carry_weight)
		encumbrance = ENCUMBRANCE_HEAVY
		add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/carry_weight, TRUE, 1.2)
		add_or_update_variable_fatigue_modifier(/datum/fatigue_modifier/weight, TRUE, -50)
	else if(carry_weight >= (maximum_carry_weight * 0.75))
		encumbrance = ENCUMBRANCE_MEDIUM
		add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/carry_weight, TRUE, 0.8)
		add_or_update_variable_fatigue_modifier(/datum/fatigue_modifier/weight, TRUE, -25)
	else if(carry_weight >= (maximum_carry_weight * 0.5))
		encumbrance = ENCUMBRANCE_LIGHT
		add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/carry_weight, TRUE, 0.4)
		add_or_update_variable_fatigue_modifier(/datum/fatigue_modifier/weight, TRUE, 0)
	else
		encumbrance = ENCUMBRANCE_NONE
		add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/carry_weight, TRUE, 0)

/mob/living/carbon/proc/encumbrance_text()
	switch(encumbrance)
		if(ENCUMBRANCE_EXTREME)
			return span_flashinguserdanger("EXTREME!!")
		if(ENCUMBRANCE_HEAVY)
			return span_animatedpain("Heavy!")
		if(ENCUMBRANCE_MEDIUM)
			return span_boldnotice("Medium.")
		if(ENCUMBRANCE_LIGHT)
			return span_notice("Light.")
		if(ENCUMBRANCE_NONE)
			return span_tinynotice("None.")


code:
//proc for switching combat styles
/mob/living/proc/switch_combat_style(new_style, silent = FALSE)
	if(new_style == combat_style)
		return
	combat_style = new_style
	switch(combat_style)
		if(CS_NONE, CS_FEINT, CS_GUARD, CS_DEFEND, CS_STRONG, CS_FURY, CS_AIMED)
			attributes?.remove_attribute_modifier(/datum/attribute_modifier/combat_style)
		if(CS_DUAL)
			attributes?.add_or_update_variable_attribute_modifier(/datum/attribute_modifier/combat_style, TRUE, list(STAT_DEXTERITY = -2))
		if(CS_WEAK)
			attributes?.add_or_update_variable_attribute_modifier(/datum/attribute_modifier/combat_style, TRUE, list(STAT_STRENGTH = GET_MOB_ATTRIBUTE_VALUE_RAW(src, STAT_STRENGTH)/2))
	if(!silent)
		print_combat_style(combat_style)
	return TRUE

//proc for printing info about a combat style
/mob/living/proc/print_combat_style(print_style = combat_style)
	var/msg = "
"
	switch(print_style)
		if(CS_NONE)
			msg += span_info("
None
")
			msg += span_info("Right click will perform no special attacks - Useful to perform miscellaneous item interactions.")
		if(CS_FEINT)
			msg += span_info("
Feint
")
			msg += span_info("Right click to perform a feint attack. If successful, victim will parry prematurely, leaving them open for a real attack. A bad idea if the enemy is not planning to parry.")
		if(CS_DUAL)
			msg += span_info("
Dual
")
			msg += span_info("Right click to attack with the item in your offhand.\nPrice: You will be less accurate with either hand.")
		if(CS_GUARD)
			msg += span_info("
Guard
")
			msg += span_info("RMB in combat mode to automatically attack anyone who approaches you. A shooting weapon allows you to target any tile in vision. Switching to another combat style will reset your guard.")
		if(CS_DEFEND)
			msg += span_info("
Defend
")
			msg += span_info("Your dodge and parry abilities are greatly heightened.\nPrice: Reduced damage output, reduced movespeed and vulnerability to feint attacks.")
			attributes?.remove_attribute_modifier(/datum/attribute_modifier/combat_style)
		if(CS_STRONG)
			msg += span_info("
Strong
")
			msg += span_info("Right click to perform a strong attack. You will hit for maximum damage.\nPrice: Attack is slow, and quickly fatigues.")
		if(CS_FURY)
			msg += span_info("
Fury
")
			msg += span_info("Right click to attack quickly and recklessly. Parrying furious attacks will greatly hinder your target's dodge and parry.\nPrice: -2 STR.")
			attributes?.remove_attribute_modifier(/datum/attribute_modifier/combat_style)
		if(CS_AIMED)
			msg += span_info("
Aimed
")
			msg += span_info("Right click for an aimed attack. You are far less likely to miss attack attempts, but these attacks are very slow.")
		if(CS_WEAK)
			msg += span_info("
Weak
")
			msg += span_info("Halves your strength on most activities - Useful for a friendly brawl or to non-lethally subdue someone.")
	msg += "
"
	to_chat(src, msg)


code:
//proc for switching between dodging and parrying
/mob/living/proc/toggle_dodge_parry(new_dp, silent = FALSE)
	if(!ishuman(src))
		if(!silent)
			to_chat(src, span_warning("My inhuman form is incapable of dodging or parrying."))
		return

	if(!new_dp)
		switch(dodge_parry)
			if(DP_DODGE)
				dodge_parry = DP_PARRY
				if(!silent)
					to_chat(src, span_notice("I will now parry incoming attacks."))
			if(DP_PARRY)
				dodge_parry = DP_DODGE
				if(!silent)
					to_chat(src, span_notice("I will now dodge incoming attacks."))
	else
		if(dodge_parry == new_dp)
			return
		dodge_parry = new_dp
		if(!silent)
			switch(dodge_parry)
				if(DP_PARRY)
					to_chat(src, span_notice("I will now parry incoming attacks."))
				if(DP_DODGE)
					to_chat(src, span_notice("I will now dodge incoming attacks."))


code:
/mob/living/carbon/update_fatigue()
	. = ..()
	var/tired = getFatigueLoss()
	if(tired >= SPRINT_MAX_FATIGUELOSS)
		ADD_TRAIT(src, TRAIT_SPRINT_LOCKED, FATIGUE)
	else if(HAS_TRAIT_FROM(src, TRAIT_SPRINT_LOCKED, FATIGUE))
		REMOVE_TRAIT(src, TRAIT_SPRINT_LOCKED, FATIGUE)
	if(tired >= FATIGUE_CRIT_THRESHOLD)
		enter_fatiguecrit()
	else if(HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, FATIGUE))
		REMOVE_TRAIT(src, TRAIT_INCAPACITATED, FATIGUE)
		REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, FATIGUE)
		REMOVE_TRAIT(src, TRAIT_FLOORED, FATIGUE)

/mob/living/carbon/handle_fatigue(delta_time, times_fired)
	//regenerate fatigue if possible
	if(COOLDOWN_FINISHED(src, fatigue_cooldown) && !combat_mode && getFatigueLoss())
		adjustFatigueLoss(-FATIGUE_REGEN_FACTOR * (body_position == LYING_DOWN ? FATIGUE_REGEN_LYING_MULTIPLIER : 1) * 0.5 * delta_time)

/mob/living/carbon/proc/enter_fatiguecrit()
	if(!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE))
		return
	if(HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, FATIGUE)) //Already in fatiguecrit
		return
	if(absorb_stun(0)) //continuous effect, so we don't want it to increment the stuns absorbed.
		return
	ADD_TRAIT(src, TRAIT_INCAPACITATED, FATIGUE)
	ADD_TRAIT(src, TRAIT_IMMOBILIZED, FATIGUE)
	ADD_TRAIT(src, TRAIT_FLOORED, FATIGUE)
	setFatigueLoss(FATIGUE_CRIT_THRESHOLD + 20, FALSE)
	fatigue_grunt()
	//rip
	if(diceroll(GET_MOB_ATTRIBUTE_VALUE(src, STAT_ENDURANCE)) <= DICE_CRIT_FAILURE)
		set_heartattack(TRUE)


code:
/mob/living/carbon/MiddleClickJump(atom/jump_target, proximity_flag, list/modifiers)
	//We can't jump if it's the same damn tile
	//TODO: Multi-z jumping when certain requirements are met
	if(get_dist(src, jump_target) < 1)
		return FALSE
	//Not while thrown/jumping
	if(throwing)
		return FALSE
	//Not while knocked down
	if(body_position != STANDING_UP)
		to_chat(span_warning("I need to stand up."))
		return FALSE
	//Not while buckled
	if(buckled)
		to_chat(span_warning("I need to unbuckle."))
		return FALSE
	var/range = FLOOR(GET_MOB_ATTRIBUTE_VALUE(src, STAT_STRENGTH)/(ATTRIBUTE_MIDDLING/2), 1)
	if(range < 1)
		to_chat(src, span_warning("I'm too weak to do this..."))
		return FALSE
	if(ismob(jump_target))
		visible_message(span_warning("[src] jumps at [jump_target]!"), \
					span_userdanger("I jump at [jump_target]!"), \
					ignored_mobs = jump_target)
		to_chat(jump_target, span_userdanger("[src] jumps at me!"))
	else
		visible_message(span_warning("[src] jumps at [jump_target]!"), \
					span_userdanger("I jump at [jump_target]!"))
	jump_grunt()
	sound_hint()
	safe_throw_at(jump_target, range, throw_speed, src, FALSE, callback = CALLBACK(src, .proc/jump_callback))

/mob/living/carbon/proc/jump_callback()
	sound_hint()
	switch(diceroll(GET_MOB_ATTRIBUTE_VALUE(src, STAT_DEXTERITY)))
		if(DICE_CRIT_SUCCESS)
			adjustStaminaLoss(25)
		if(DICE_SUCCESS)
			adjustStaminaLoss(30)
		if(DICE_FAILURE)
			CombatKnockdown(35, 1 SECONDS)
		if(DICE_CRIT_FAILURE)
			CombatKnockdown(70, 4 SECONDS)


code:
//Proc for switching between jump, kick and bite
/mob/living/proc/toggle_special_attack(new_attack, silent = FALSE)
	if(!ishuman(src))
		if(!silent)
			to_chat(src, span_warning("My inhuman form is incapable of doing special attacks."))
		return

	if(!new_attack || new_attack == special_attack)
		special_attack = SPECIAL_ATK_NONE
		if(!silent)
			to_chat(src, span_notice("I will now attack my targets normally. (MMB will not perform special attacks)"))
	else
		switch(new_attack)
			if(SPECIAL_ATK_KICK)
				special_attack = SPECIAL_ATK_KICK
				if(!silent)
					to_chat(src, span_notice("I will now try to kick my targets. (MMB to kick)"))
			if(SPECIAL_ATK_BITE)
				special_attack = SPECIAL_ATK_BITE
				if(!silent)
					to_chat(src, span_notice("I will now try to bite my targets. (MMB to bite)"))
			if(SPECIAL_ATK_JUMP)
				special_attack = SPECIAL_ATK_JUMP
				if(!silent)
					to_chat(src, span_notice("I will now attempt to tackle at my targets. (MMB to jump at a target)"))
			if(SPECIAL_ATK_STEAL)
				special_attack = SPECIAL_ATK_STEAL
				if(!silent)
					to_chat(src, span_notice("I will now attempt to steal from my targets. (MMB to pickpocket)"))


code:
//Pain stuff
/mob/living/carbon/getPainLoss()
	var/amount = 0
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		amount += BP.pain_dam * BP.pain_damage_coeff
	return amount

/mob/living/carbon/adjustPainLoss(amount, updating_health = TRUE, forced = FALSE, required_status)
	if(!forced && (status_flags & GODMODE))
		return FALSE
	var/old_amount = amount
	var/list/obj/item/bodypart/parts
	if(amount > 0)
		parts = get_painable_bodyparts()
	else
		parts = get_pained_bodyparts()
	var/update = FALSE
	while(parts.len && amount)
		var/obj/item/bodypart/picked = pick(parts)
		var/pain_per_part
		if(amount < 0)
			pain_per_part = FLOOR(amount/parts.len, DAMAGE_PRECISION)
		else
			pain_per_part = CEILING(amount/parts.len, DAMAGE_PRECISION)

		var/pain_was = picked.pain_dam
		if(amount < 0)
			update |= picked.remove_pain(abs(pain_per_part))
		else
			update |= picked.add_pain(abs(pain_per_part))

		if(pain_per_part < 0)
			pain_per_part = FLOOR(amount - (picked.pain_dam - pain_was), DAMAGE_PRECISION)
		else
			pain_per_part = CEILING(amount - (picked.pain_dam - pain_was), DAMAGE_PRECISION)

		parts -= picked
	if(updating_health)
		updatehealth()
	if(update)
		update_damage_overlays()
	return old_amount

/mob/living/carbon/setPainLoss(amount, updating_health = TRUE, forced = FALSE)
	var/current = getPainLoss()
	var/diff = amount - current
	if(!diff)
		return
	adjustPainLoss(diff, updating_health, forced)

/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE, wound_bonus = 0, bare_wound_bonus = 0, sharpness = NONE)
	SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMAGE, damage, damagetype, def_zone)
	var/hit_percent = (100-blocked)/100
	if(!damage || (!forced && hit_percent <= 0))
		return 0

	var/obj/item/bodypart/BP = null
	if(!spread_damage)
		if(isbodypart(def_zone)) //we specified a bodypart object
			BP = def_zone
		else
			if(!def_zone)
				def_zone = ran_zone(def_zone)
			BP = get_bodypart(check_zone(def_zone))
			if(!BP)
				BP = bodyparts[1]

	var/damage_amount = forced ? damage : damage * hit_percent
	switch(damagetype)
		if(BRUTE)
			if(BP)
				if(BP.receive_damage(damage_amount, 0, wound_bonus = wound_bonus, bare_wound_bonus = bare_wound_bonus, sharpness = sharpness))
					update_damage_overlays()
			else //no bodypart, we deal damage with a more general method.
				adjustBruteLoss(damage_amount, forced = forced)
		if(BURN)
			if(BP)
				if(BP.receive_damage(0, damage_amount, wound_bonus = wound_bonus, bare_wound_bonus = bare_wound_bonus, sharpness = sharpness))
					update_damage_overlays()
			else
				adjustFireLoss(damage_amount, forced = forced)
		if(TOX)
			adjustToxLoss(damage_amount, forced = forced)
		if(OXY)
			adjustOxyLoss(damage_amount, forced = forced)
		if(CLONE)
			adjustCloneLoss(damage_amount, forced = forced)
		if(STAMINA)
			if(BP)
				if(BP.receive_damage(0, 0, damage_amount))
					update_damage_overlays()
			else
				adjustStaminaLoss(damage_amount, forced = forced)
		if(PAIN, SHOCK_PAIN)
			if(BP)
				BP.add_pain(damage_amount)
			else
				adjustPainLoss(damage_amount, forced = forced)
	return TRUE

/mob/living/carbon/proc/get_painable_bodyparts(status)
	var/list/obj/item/bodypart/parts = list()
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		if(status && (BP.status != status))
			continue
		if(BP.pain_dam < BP.max_pain_damage)
			parts += BP
	return parts

/mob/living/carbon/proc/get_pained_bodyparts(status)
	var/list/obj/item/bodypart/parts = list()
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		if(status && (BP.status != status))
			continue
		if(BP.pain_dam)
			parts += BP
	return parts

/mob/living/carbon/getShock(painkiller_included = TRUE)
	if(!can_feel_pain())
		return 0

	var/shock = 0
	shock += SHOCK_MOD_CLONE * getCloneLoss()
	for(var/X in bodyparts)
		var/obj/item/bodypart/BP = X
		shock += BP.get_shock(FALSE, TRUE)

	if(painkiller_included)
		shock = max(0, shock - get_chem_effect(CE_PAINKILLER))

	return max(0, shock)

/mob/living/carbon/proc/InShock()
	return (shock_stage >= SHOCK_STAGE_4)

/mob/living/carbon/proc/InFullShock()
	return (shock_stage >= SHOCK_STAGE_6)

/mob/living/carbon/getToxLoss()
	. = 0
	if(HAS_TRAIT(src, TRAIT_TOXIMMUNE) || HAS_TRAIT(src, TRAIT_NOMETABOLISM))
		return
	var/list/livers = getorganslotlist(ORGAN_SLOT_LIVER)
	var/lacking_livers = max(1 - length(livers), 0)
	if(lacking_livers)
		. += LIVER_MAX_TOXIN * lacking_livers
	for(var/thing in livers)
		var/obj/item/organ/liver/liver = thing
		. += liver.get_toxins()

	var/list/kidneys = getorganslotlist(ORGAN_SLOT_KIDNEYS)
	var/lacking_kidneys = max(2 - length(kidneys), 0)
	if(lacking_kidneys)
		. += KIDNEY_MAX_TOXIN * lacking_kidneys
	for(var/thing in kidneys)
		var/obj/item/organ/kidneys/kidney = thing
		. += kidney.get_toxins()

/mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
	. = 0
	if(!forced && (status_flags & GODMODE))
		return FALSE
	if(!forced && HAS_TRAIT(src, TRAIT_TOXINLOVER)) //damage becomes healing and healing becomes damage
		amount = -amount
		if(HAS_TRAIT(src, TRAIT_TOXIMMUNE)) //Prevents toxin damage, but not healing
			amount = min(amount, 0)
		if(amount > 0)
			adjust_bloodvolume(-5*amount)
		else
			adjust_bloodvolume(-amount)
	else if(HAS_TRAIT(src, TRAIT_TOXIMMUNE)) //Prevents toxin damage, but not healing
		amount = min(amount, 0)
	var/list/obj/item/organ/organs_to_affect = list()
	organs_to_affect |= getorganslotlist(ORGAN_SLOT_KIDNEYS)
	organs_to_affect |= getorganslotlist(ORGAN_SLOT_LIVER)
	// still have healing or damage to give out? keep looping
	while(organs_to_affect.len && amount)
		var/futility_check_failed = TRUE
		for(var/thing in organs_to_affect)
			var/obj/item/organ/organ = thing
			if(amount > 0)
				if(organ.can_add_toxins())
					futility_check_failed = FALSE
					break
			else if(amount < 0)
				if(organ.can_remove_toxins())
					futility_check_failed = FALSE
					break
		if(futility_check_failed)
			break
		for(var/thing in organs_to_affect)
			var/obj/item/organ/organ = thing
			if(amount < 0)
				if(organ.can_remove_toxins())
					amount = round(amount - organ.remove_toxins(abs(amount)), DAMAGE_PRECISION)
			else if(amount > 0)
				if(organ.can_add_toxins())
					amount = round(amount - organ.add_toxins(abs(amount)), DAMAGE_PRECISION)
			else if(!amount)
				break
	if(updating_health)
		updatehealth()
		update_health_hud()

/mob/living/carbon/setToxLoss(amount, updating, forced)
	if(!needs_lungs() || (amount < 0))
		return
	var/delta = amount - getToxLoss()
	if(delta)
		adjustToxLoss(delta, updating, forced)

//Oxyloss stuff
/mob/living/carbon/getOxyLoss()
	. = 0
	if(!needs_lungs())
		return
	var/list/lungs = getorganslotlist(ORGAN_SLOT_LUNGS)
	var/lacking_lungs = max(2 - length(lungs), 0)
	if(lacking_lungs)
		. += LUNG_MAX_OXYLOSS * lacking_lungs
	for(var/thing in lungs)
		var/obj/item/organ/lungs/lung = thing
		. += lung.get_oxygen_deprivation()

/mob/living/carbon/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE)
	. = 0
	if(!forced && ((status_flags & GODMODE) || !needs_lungs()))
		return FALSE
	var/list/lungs_to_affect = list()
	lungs_to_affect |= getorganslotlist(ORGAN_SLOT_LUNGS)
	// still have healing or damage to give out? keep looping
	while(lungs_to_affect.len && amount)
		var/futility_check_failed = TRUE
		for(var/thing in lungs_to_affect)
			var/obj/item/organ/lungs/lung = thing
			if(amount > 0)
				if(lung.can_oxy_deprive())
					futility_check_failed = FALSE
					break
			else if(amount < 0)
				if(lung.can_oxy_heal())
					futility_check_failed = FALSE
					break
		if(futility_check_failed)
			break
		for(var/thing in lungs_to_affect)
			var/obj/item/organ/lungs/lung = thing
			if(amount < 0)
				if(lung.can_oxy_heal())
					amount = round(amount - lung.remove_oxygen_deprivation(abs(amount)), DAMAGE_PRECISION)
			else if(amount > 0)
				if(lung.can_oxy_deprive())
					amount = round(amount - lung.add_oxygen_deprivation(abs(amount)), DAMAGE_PRECISION)
			else if(!amount)
				break
	if(getOxyLoss() > 50)
		ADD_TRAIT(src, TRAIT_KNOCKEDOUT, OXYLOSS_TRAIT)
	else if(getOxyLoss() <= 50)
		REMOVE_TRAIT(src, TRAIT_KNOCKEDOUT, OXYLOSS_TRAIT)
	if(updating_health)
		updatehealth()
		update_health_hud()

/mob/living/carbon/setOxyLoss(amount, updating, forced)
	if(!needs_lungs() || (amount < 0))
		return
	var/delta = amount - getOxyLoss()
	if(delta)
		adjustOxyLoss(delta, updating, forced)

//Organ loss stuff
/mob/living/carbon/getOrganLoss(slot)
	. = 0
	var/list/organs = getorganslotlist(slot)
	for(var/thing in organs)
		var/obj/item/organ/organ = thing
		. += organ.damage

/mob/living/carbon/adjustOrganLoss(slot, amount, maximum)
	var/list/organs = getorganslotlist(slot)
	for(var/thing in organs)
		if(amount <= 0)
			break
		var/obj/item/organ/organ = thing
		organ.applyOrganDamage(amount)
		amount -= (organ.damage - organ.prev_damage)

/mob/living/carbon/setOrganLoss(slot, amount)
	var/list/organs = getorganslotlist(slot)
	var/num_organs = length(organs)
	for(var/thing in organs)
		var/obj/item/organ/organ = thing
		organ.setOrganDamage(amount/num_organs)


code:
/mob/living/carbon/human/dummy
	num_hands = 2
	num_legs = 4
	num_eyes = 2
	attributes = null

/mob/living/carbon/human/dummy/update_smelly()
	return

/mob/living/carbon/human/dummy/set_usable_legs(new_value)
	return

/mob/living/carbon/human/dummy/set_usable_hands(new_value)
	return

/mob/living/carbon/human/dummy/set_usable_eyes(new_value)
	return

/mob/living/carbon/human/dummy/set_num_legs(new_value)
	return

/mob/living/carbon/human/dummy/set_num_hands(new_value)
	return

/mob/living/carbon/human/dummy/set_num_legs(new_value)
	return

/mob/living/carbon/human/dummy/update_organ_requirements()
	return

/mob/living/carbon/human/dummy/update_limb_efficiencies()
	return


code:
//Hygiene stuff
/mob/living/carbon/human/Initialize(mapload)
	. = ..()
	//values are quite low due to the way dirty clothing dirtifies you
	set_germ_level(rand(GERM_LEVEL_START_MIN, GERM_LEVEL_START_MAX))
	//hehe horny
	set_arousal(rand(AROUSAL_LEVEL_START_MIN, AROUSAL_LEVEL_START_MAX))

//Fixeye component
/mob/living/carbon/human/ComponentInitialize()
	. = ..()
	AddComponent(/datum/component/fixeye)
	AddComponent(/datum/component/interactable)

//OVERRIDE IGNORING PARENT RETURN VALUE
/mob/living/carbon/human/updatehealth()
	if(status_flags & GODMODE)
		return
	var/total_burn = 0
	var/total_brute = 0
	var/total_stamina = 0
	for(var/X in bodyparts) //hardcoded to streamline things a bit
		var/obj/item/bodypart/BP = X
		total_brute += (BP.brute_dam * BP.body_damage_coeff)
		total_burn += (BP.burn_dam * BP.body_damage_coeff)
		total_stamina += (BP.stamina_dam * BP.stam_damage_coeff)
	staminaloss = round(total_stamina, DAMAGE_PRECISION)
	set_health(maxHealth - GETBRAINLOSS(src))

	update_pain()
	update_shock()
	update_stat()
	if((maxHealth - total_burn <= HEALTH_THRESHOLD_DEAD*2) && (stat == DEAD))
		become_husk(BURN)

	med_hud_set_health()

/mob/living/carbon/human/genital_visible(genital_slot = ORGAN_SLOT_PENIS)
	var/list/genitals = getorganslotlist(genital_slot)
	if(!length(genitals))
		var/obj/item/bodypart/bp_required
		switch(genital_slot)
			if(ORGAN_SLOT_WOMB)
				return FALSE
			if(ORGAN_SLOT_PENIS, ORGAN_SLOT_VAGINA)
				bp_required = get_bodypart_nostump(BODY_ZONE_PRECISE_GROIN)
				return (bp_required && !LAZYLEN(clothingonpart(bp_required)))
			if(ORGAN_SLOT_BREASTS)
				bp_required = get_bodypart_nostump(BODY_ZONE_CHEST)
				return (bp_required && !LAZYLEN(clothingonpart(bp_required)))
	else
		for(var/obj/item/organ/genital/genital as anything in genitals)
			if(genital.is_visible())
				return TRUE

/mob/living/carbon/human/should_have_genital(genital_slot = ORGAN_SLOT_PENIS)
	. = FALSE
	if((genital_slot in GLOB.genital_sets[genitals]) && !(AGENDER in dna.species.species_traits))
		return TRUE

/mob/living/carbon/human/getMaxHealth()
	var/obj/item/organ/brain = getorganslot(ORGAN_SLOT_BRAIN)
	if(brain)
		return brain.maxHealth
	else
		return BRAIN_DAMAGE_DEATH

/mob/living/carbon/human/update_lips(new_style, new_colour, apply_trait)
	lip_style = new_style
	lip_color = new_colour
	update_body()

	var/obj/item/bodypart/mouth/hopefully_a_jaw = get_bodypart(check_zone(BODY_ZONE_PRECISE_MOUTH))
	REMOVE_TRAITS_IN(src, LIPSTICK_TRAIT)
	hopefully_a_jaw?.stored_lipstick_trait = null

	if(new_style && apply_trait)
		ADD_TRAIT(src, apply_trait, LIPSTICK_TRAIT)
		hopefully_a_jaw?.stored_lipstick_trait = apply_trait

///Get all the clothing on a specific body part
/mob/living/carbon/human/clothingonpart(obj/item/bodypart/def_zone)
	//body zone
	if(istext(def_zone))
		def_zone = GLOB.bodyzone_to_bitflag[def_zone]
	//bodypart
	else if(istype(def_zone))
		def_zone = def_zone.body_part
	//hopefully already a bitflag otherwise
	var/list/covering_part = list()
	var/list/body_parts = list(head, wear_mask, wear_suit, w_uniform, back, gloves, shoes, belt, s_store, glasses, ears, wear_id, wear_neck) //Everything but pockets. Pockets are l_store and r_store. (if pockets were allowed, putting something armored, gloves or hats for example, would double up on the armor)
	for(var/bp in body_parts)
		if(!bp)
			continue
		if(bp && istype(bp , /obj/item/clothing))
			var/obj/item/clothing/clothing_item = bp
			if(clothing_item.body_parts_covered & def_zone)
				covering_part += clothing_item
	return covering_part

/mob/living/carbon/human/proc/get_middle_status_tab()
	. = list()
	. += ""
	. += "Combat Mode: [combat_mode ? "On" : "Off"]"
	. += "Intent: [capitalize(a_intent)]"
	if(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
		. += "Move Mode: Sprint"
	else
		. += "Move Mode: [capitalize(m_intent)]"

///Adjust the arousal of a human
/mob/living/carbon/human/proc/adjust_arousal(change)
	arousal = max(0, arousal + change)
	var/genital_arousal = AROUSAL_NONE
	switch(arousal)
		if(AROUSAL_LEVEL_HORNY to INFINITY)
			genital_arousal = AROUSAL_FULL
		if(AROUSAL_LEVEL_AROUSED to AROUSAL_LEVEL_HORNY)
			genital_arousal = AROUSAL_PARTIAL
		else
			genital_arousal = AROUSAL_NONE
	for(var/obj/item/organ/genital/genital in internal_organs)
		if(genital.arousal_state == AROUSAL_CANT)
			continue
		genital.arousal_state = genital_arousal

///Force set the arousal
/mob/living/carbon/human/proc/set_arousal(change)
	var/delta = (change - arousal)
	return adjust_arousal(delta)

///Adjust the lust
/mob/living/carbon/human/proc/adjust_lust(change)
	lust = clamp(lust + change, 0, LUST_CLIMAX)

///Force set the lust
/mob/living/carbon/human/proc/set_lust(change)
	var/delta = (change - lust)
	return adjust_lust(delta)


code:
// handled by organ process system
/mob/living/carbon/human/handle_blood(delta_time, times_fired)
	return