<commit_before>mob/proc/flash_pain()
	flick("pain",pain)

mob/var/list/pain_stored = list()
mob/var/last_pain_message = ""
mob/var/next_pain_time = 0

// partname is the name of a body part
// amount is a num from 1 to 100
mob/proc/pain(var/partname, var/amount, var/force)
	if(stat >= 2) return
	if(world.time < next_pain_time && !force)
		return
	if(amount > 10 && istype(src,/mob/living/carbon/human))
		if(src:paralysis)
			src:paralysis = max(0, src:paralysis-round(amount/10))
	if(amount > 50 && prob(amount / 5))
		src:drop_item()
	var/msg
	switch(amount)
		if(1 to 10)
			msg = "<b>Your [partname] hurts a bit."
		if(11 to 90)
			flash_weak_pain()
			msg = "<b><font size=1>Ouch! Your [partname] hurts."
		if(91 to 10000)
			flash_pain()
			msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!"
	if(msg && (msg != last_pain_message || prob(10)))
		last_pain_message = msg
		src << msg
	next_pain_time = world.time + (100 - amount)

mob/living/carbon/human/proc/handle_pain()
	// not when sleeping
	if(stat >= 2) return
	var/maxdam = 0
	var/datum/organ/external/damaged_organ = null
	for(var/name in organs)
		var/datum/organ/external/E = organs[name]
		var/dam = E.get_damage()
		// make the choice of the organ depend on damage,
		// but also sometimes use one of the less damaged ones
		if(dam > maxdam && (maxdam == 0 || prob(70)) )
			damaged_organ = E
			maxdam = dam
	if(damaged_organ)
		pain(damaged_organ.display_name, maxdam, 0)
<commit_msg>fixed bad html on pain text<commit_after>mob/proc/flash_pain()
	flick("pain",pain)

mob/var/list/pain_stored = list()
mob/var/last_pain_message = ""
mob/var/next_pain_time = 0

// partname is the name of a body part
// amount is a num from 1 to 100
mob/proc/pain(var/partname, var/amount, var/force)
	if(stat >= 2) return
	if(world.time < next_pain_time && !force)
		return
	if(amount > 10 && istype(src,/mob/living/carbon/human))
		if(src:paralysis)
			src:paralysis = max(0, src:paralysis-round(amount/10))
	if(amount > 50 && prob(amount / 5))
		src:drop_item()
	var/msg
	switch(amount)
		if(1 to 10)
			msg = "<b>Your [partname] hurts a bit.</b>"
		if(11 to 90)
			flash_weak_pain()
			msg = "<b><font size=1>Ouch! Your [partname] hurts.</font></b>"
		if(91 to 10000)
			flash_pain()
			msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!</font></b>"
	if(msg && (msg != last_pain_message || prob(10)))
		last_pain_message = msg
		src << msg
	next_pain_time = world.time + (100 - amount)

mob/living/carbon/human/proc/handle_pain()
	// not when sleeping
	if(stat >= 2) return
	var/maxdam = 0
	var/datum/organ/external/damaged_organ = null
	for(var/name in organs)
		var/datum/organ/external/E = organs[name]
		var/dam = E.get_damage()
		// make the choice of the organ depend on damage,
		// but also sometimes use one of the less damaged ones
		if(dam > maxdam && (maxdam == 0 || prob(70)) )
			damaged_organ = E
			maxdam = dam
	if(damaged_organ)
		pain(damaged_organ.display_name, maxdam, 0)

{'fraction_non_alphanumeric': 0.14835900870730073, 'fraction_numerical': 0.027461486939048894, 'mean_word_length': 3.7792, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '901649', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1126, 'n_words': 287}