<commit_before>//

/datum/artifact_effect
	var/artifact_id = ""       // Display ID of the spawning artifact
	var/trigger = "touch"      // What activates it?
	var/triggerX = "none"      // Used for more varied triggers
	var/effecttype = "healing" // What does it do?
	var/effectmode = "aura"    // How does it carry out the effect?
	var/aurarange = 4          // How far the artifact will extend an aura effect.
	var/list/created_field
	var/archived_loc

/datum/artifact_effect/New()
	//
	created_field = new()

/datum/artifact_effect/proc/GetOriginString(var/origin)

/datum/artifact_effect/proc/GetEffectString(var/effect)

/datum/artifact_effect/proc/GetTriggerString(var/trigger)

/datum/artifact_effect/proc/GetRangeString(var/range)
	switch(effectmode)
		if("aura") return "Constant Short-Range Energy Field"
		if("pulse")
			if(aurarange > 7) return "Long Range Energy Pulses"
			else return "Medium Range Energy Pulses"
		if("worldpulse") return "Extreme Range Energy Pulses"
		if("contact") return "Requires contact with subject"
		else return "Unknown Range"

/datum/artifact_effect/proc/HaltEffect()
	for(var/obj/effect/energy_field/F in created_field)
		created_field.Remove(F)
		del F

/datum/artifact_effect/proc/UpdateEffect(var/atom/originator)
	/*for(var/obj/effect/energy_field/F in created_field)
		created_field.Remove(F)
		del F*/
	if(originator.loc != archived_loc)
		archived_loc = originator.loc
		update_move(originator)

	for(var/obj/effect/energy_field/E in created_field)
		if(E.strength < 5)
			E.Strengthen(0.2)

/datum/artifact_effect/proc/DoEffect(var/atom/originator)
	archived_loc = originator.loc
	if (src.effectmode == "contact")
		var/mob/living/user = originator
		if(!user)
			return
		switch(src.effecttype)
			if("healing")
				//caeltodo
				if (istype(user, /mob/living/carbon/human/))
					user << "\blue You feel a soothing energy invigorate you."

					var/mob/living/carbon/human/H = user
					for(var/A in H.organs)
						var/datum/organ/external/affecting = null
						if(!H.organs[A])    continue
						affecting = H.organs[A]
						if(!istype(affecting, /datum/organ/external))    continue
						affecting.heal_damage(25, 25)    //fixes getting hit after ingestion, killing you when game updates organ health
						//user:heal_organ_damage(25, 25)
						//
						user.adjustOxyLoss(-25)
						user.adjustToxLoss(-25)
						user.adjustBruteLoss(-25)
						user.adjustFireLoss(-25)
						user.adjustBrainLoss(-25)
						user.radiation -= min(user.radiation, 25)
						user.nutrition += 50
						H.bodytemperature = initial(H.bodytemperature)
						//
						H.vessel.add_reagent("blood",50)
						spawn(1)
							H.fixblood()
						H.regenerate_icons()<commit_msg>Fixed something with artifacts. I have no idea what but it was broken and now is fixed. Possibly runtime, most likely just artifact's effect is not working on any organ.<commit_after>//

/datum/artifact_effect
	var/artifact_id = ""       // Display ID of the spawning artifact
	var/trigger = "touch"      // What activates it?
	var/triggerX = "none"      // Used for more varied triggers
	var/effecttype = "healing" // What does it do?
	var/effectmode = "aura"    // How does it carry out the effect?
	var/aurarange = 4          // How far the artifact will extend an aura effect.
	var/list/created_field
	var/archived_loc

/datum/artifact_effect/New()
	//
	created_field = new()

/datum/artifact_effect/proc/GetOriginString(var/origin)

/datum/artifact_effect/proc/GetEffectString(var/effect)

/datum/artifact_effect/proc/GetTriggerString(var/trigger)

/datum/artifact_effect/proc/GetRangeString(var/range)
	switch(effectmode)
		if("aura") return "Constant Short-Range Energy Field"
		if("pulse")
			if(aurarange > 7) return "Long Range Energy Pulses"
			else return "Medium Range Energy Pulses"
		if("worldpulse") return "Extreme Range Energy Pulses"
		if("contact") return "Requires contact with subject"
		else return "Unknown Range"

/datum/artifact_effect/proc/HaltEffect()
	for(var/obj/effect/energy_field/F in created_field)
		created_field.Remove(F)
		del F

/datum/artifact_effect/proc/UpdateEffect(var/atom/originator)
	/*for(var/obj/effect/energy_field/F in created_field)
		created_field.Remove(F)
		del F*/
	if(originator.loc != archived_loc)
		archived_loc = originator.loc
		update_move(originator)

	for(var/obj/effect/energy_field/E in created_field)
		if(E.strength < 5)
			E.Strengthen(0.2)

/datum/artifact_effect/proc/DoEffect(var/atom/originator)
	archived_loc = originator.loc
	if (src.effectmode == "contact")
		var/mob/living/user = originator
		if(!user)
			return
		switch(src.effecttype)
			if("healing")
				//caeltodo
				if (istype(user, /mob/living/carbon/human/))
					user << "\blue You feel a soothing energy invigorate you."

					var/mob/living/carbon/human/H = user
					for(var/datum/organ/external/affecting in H.organs)
						if(!affecting)    continue
						if(!istype(affecting, /datum/organ/external))    continue
						affecting.heal_damage(25, 25)    //fixes getting hit after ingestion, killing you when game updates organ health
						//user:heal_organ_damage(25, 25)
						//
						user.adjustOxyLoss(-25)
						user.adjustToxLoss(-25)
						user.adjustBruteLoss(-25)
						user.adjustFireLoss(-25)
						user.adjustBrainLoss(-25)
						user.radiation -= min(user.radiation, 25)
						user.nutrition += 50
						H.bodytemperature = initial(H.bodytemperature)
						//
						H.vessel.add_reagent("blood",50)
						spawn(1)
							H.fixblood()
						H.regenerate_icons()
{'fraction_non_alphanumeric': 0.11824263243536431, 'fraction_numerical': 0.010847947929849937, 'mean_word_length': 3.4044585987261144, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '7656685', 'n_tokens_mistral': 2269, 'n_tokens_neox': 1859, 'n_words': 402}