<commit_before>/obj/item/weapon/paper/talisman
	icon_state = "paper_talisman"
	var/imbue = null
	var/uses = 0


	examine()
		set src in view(2)
		..()
		return


	attack_self(mob/living/user as mob)
		if(iscultist(user))
			var/delete = 1
			switch(imbue)
				if("newtome")
					call(/obj/effect/rune/proc/tomesummon)()
				if("armor")
					call(/obj/effect/rune/proc/armor)()
				if("emp")
					call(/obj/effect/rune/proc/emp)(usr.loc,3)
				if("conceal")
					call(/obj/effect/rune/proc/obscure)(2)
				if("revealrunes")
					call(/obj/effect/rune/proc/revealrunes)(src)
				if("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
					call(/obj/effect/rune/proc/teleport)(imbue)
				if("communicate")
					//If the user cancels the talisman this var will be set to 0
					delete = call(/obj/effect/rune/proc/communicate)()
				if("deafen")
					call(/obj/effect/rune/proc/deafen)()
				if("blind")
					call(/obj/effect/rune/proc/blind)()
				if("runestun")
					user << "\red To use this talisman, attack your target directly."
					return
				if("supply")
					supply()
			user.take_organ_damage(5, 0)
			if(src && src.imbue!="supply" && src.imbue!="runestun")
				if(delete)
					del(src)
			return
		else
			user << "You see strange symbols on the paper. Are they supposed to mean something?"
			return


	attack(mob/living/carbon/T as mob, mob/living/user as mob)
		if(iscultist(user))
			if(imbue == "runestun")
				user.take_organ_damage(5, 0)
				call(/obj/effect/rune/proc/runestun)(T)
				del(src)
			else
				..()   ///If its some other talisman, use the generic attack code, is this supposed to work this way?
		else
			..()


	proc/supply(var/key)
		if (!src.uses)
			del(src)
			return

		var/dat = "<B>There are [src.uses] bloody runes on the parchment.</B><BR>"
		dat += "Please choose the chant to be imbued into the fabric of reality.<BR>"
		dat += "<HR>"
		dat += "<A href='?src=\ref[src];rune=newtome'>N'ath reth sh'yro eth d'raggathnor!</A> - Allows you to summon a new arcane tome.<BR>"
		dat += "<A href='?src=\ref[src];rune=teleport'>Sas'so c'arta forbici!</A> - Allows you to move to a rune with the same last word.<BR>"
		dat += "<A href='?src=\ref[src];rune=emp'>Ta'gh fara'qha fel d'amar det!</A> - Allows you to destroy technology in a short range.<BR>"
		dat += "<A href='?src=\ref[src];rune=conceal'>Kla'atu barada nikt'o!</A> - Allows you to conceal the runes you placed on the floor.<BR>"
		dat += "<A href='?src=\ref[src];rune=communicate'>O bidai nabora se'sma!</A> - Allows you to coordinate with others of your cult.<BR>"
		dat += "<A href='?src=\ref[src];rune=runestun'>Fuu ma'jin</A> - Allows you to stun a person by attacking them with the talisman.<BR>"
		dat += "<A href='?src=\ref[src];rune=armor'>Sa tatha najin</A> - Allows you to summon armoured robes and an unholy blade<BR>"
		dat += "<A href='?src=\ref[src];rune=soulstone'>Kal om neth</A> - Summons a soul stone<BR>"
		dat += "<A href='?src=\ref[src];rune=construct'>Da A'ig Osk</A> - Summons a construct shell for use with captured souls. It is too large to carry on your person.<BR>"
		usr << browse(dat, "window=id_com;size=350x200")
		return


	Topic(href, href_list)
		if(!src)	return
		if (usr.stat || usr.restrained() || !in_range(src, usr))	return

		if (href_list["rune"])
			switch(href_list["rune"])
				if("newtome")
					var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
					T.imbue = "newtome"
				if("teleport")
					var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
					T.imbue = "[pick("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri", "orkan", "allaq")]"
					T.info = "[T.imbue]"
				if("emp")
					var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
					T.imbue = "emp"
				if("conceal")
					var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
					T.imbue = "conceal"
				if("communicate")
					var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
					T.imbue = "communicate"
				if("runestun")
					var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
					T.imbue = "runestun"
				if("armor")
					var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr))
					T.imbue = "armor"
				if("soulstone")
					new /obj/item/device/soulstone(get_turf(usr))
				if("construct")
					new /obj/structure/constructshell(get_turf(usr))
			src.uses--
			supply()
		return


/obj/item/weapon/paper/talisman/supply
	imbue = "supply"
	uses = 5<commit_msg>Cult talismen from paper fix<commit_after>/obj/item/weapon/paper/talisman
	icon_state = "paper_talisman"
	var/imbue = null
	var/uses = 0


	examine()
		set src in view(2)
		..()
		return


	attack_self(mob/living/user as mob)
		if(iscultist(user))
			var/delete = 1
			switch(imbue)
				if("newtome")
					call(/obj/effect/rune/proc/tomesummon)()
				if("armor")
					call(/obj/effect/rune/proc/armor)()
				if("emp")
					call(/obj/effect/rune/proc/emp)(usr.loc,3)
				if("conceal")
					call(/obj/effect/rune/proc/obscure)(2)
				if("revealrunes")
					call(/obj/effect/rune/proc/revealrunes)(src)
				if("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
					call(/obj/effect/rune/proc/teleport)(imbue)
				if("communicate")
					//If the user cancels the talisman this var will be set to 0
					delete = call(/obj/effect/rune/proc/communicate)()
				if("deafen")
					call(/obj/effect/rune/proc/deafen)()
				if("blind")
					call(/obj/effect/rune/proc/blind)()
				if("runestun")
					user << "\red To use this talisman, attack your target directly."
					return
				if("supply")
					supply()
			user.take_organ_damage(5, 0)
			if(src && src.imbue!="supply" && src.imbue!="runestun")
				if(delete)
					del(src)
			return
		else
			user << "You see strange symbols on the paper. Are they supposed to mean something?"
			return


	attack(mob/living/carbon/T as mob, mob/living/user as mob)
		if(iscultist(user))
			if(imbue == "runestun")
				user.take_organ_damage(5, 0)
				call(/obj/effect/rune/proc/runestun)(T)
				del(src)
			else
				..()   ///If its some other talisman, use the generic attack code, is this supposed to work this way?
		else
			..()


	proc/supply(var/key)
		if (!src.uses)
			del(src)
			return

		var/dat = "<B>There are [src.uses] bloody runes on the parchment.</B><BR>"
		dat += "Please choose the chant to be imbued into the fabric of reality.<BR>"
		dat += "<HR>"
		dat += "<A href='?src=\ref[src];rune=newtome'>N'ath reth sh'yro eth d'raggathnor!</A> - Allows you to summon a new arcane tome.<BR>"
		dat += "<A href='?src=\ref[src];rune=teleport'>Sas'so c'arta forbici!</A> - Allows you to move to a rune with the same last word.<BR>"
		dat += "<A href='?src=\ref[src];rune=emp'>Ta'gh fara'qha fel d'amar det!</A> - Allows you to destroy technology in a short range.<BR>"
		dat += "<A href='?src=\ref[src];rune=conceal'>Kla'atu barada nikt'o!</A> - Allows you to conceal the runes you placed on the floor.<BR>"
		dat += "<A href='?src=\ref[src];rune=communicate'>O bidai nabora se'sma!</A> - Allows you to coordinate with others of your cult.<BR>"
		dat += "<A href='?src=\ref[src];rune=runestun'>Fuu ma'jin</A> - Allows you to stun a person by attacking them with the talisman.<BR>"
		dat += "<A href='?src=\ref[src];rune=armor'>Sa tatha najin</A> - Allows you to summon armoured robes and an unholy blade<BR>"
		dat += "<A href='?src=\ref[src];rune=soulstone'>Kal om neth</A> - Summons a soul stone<BR>"
		dat += "<A href='?src=\ref[src];rune=construct'>Da A'ig Osk</A> - Summons a construct shell for use with captured souls. It is too large to carry on your person.<BR>"
		usr << browse(dat, "window=id_com;size=350x200")
		return


	Topic(href, href_list)
		if(!src)	return
		if (usr.stat || usr.restrained() || !in_range(src, usr))	return

		if (href_list["rune"])
			if (istype(usr, /mob/living/carbon/human))
				var/mob/living/carbon/human/M = usr

				switch(href_list["rune"])
					if("newtome")

						var/obj/item/weapon/paper/talisman/T = new(M)
						T.imbue = "newtome"

						var/list/slots = list (
							"backpack" = slot_in_backpack,
							"left pocket" = slot_l_store,
							"right pocket" = slot_r_store,
							"left hand" = slot_l_hand,
							"right hand" = slot_r_hand,
						)

						var/where = M.equip_in_one_of_slots(T, slots)
						if (!where)
							M << "You need a space in your backpack, pocket or hand for the new paper."
						else
							M << "The [href_list["rune"]] talisman in your [where]"
							M.update_icons()
							src.uses--
							supply()


					if("teleport")
						var/obj/item/weapon/paper/talisman/T = new(M)
						T.imbue = "[pick("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri", "orkan", "allaq")]"
						T.info = "[T.imbue]"

						var/list/slots = list (
							"backpack" = slot_in_backpack,
							"left pocket" = slot_l_store,
							"right pocket" = slot_r_store,
							"left hand" = slot_l_hand,
							"right hand" = slot_r_hand,
						)

						var/where = M.equip_in_one_of_slots(T, slots)
						if (!where)
							M << "You need a space in your backpack, pocket or hand for the new paper."
						else
							M << "The [href_list["rune"]] talisman in your [where]"
							M.update_icons()
							src.uses--
							supply()

					if("emp")
						var/obj/item/weapon/paper/talisman/T = new(M)
						T.imbue = "emp"

						var/list/slots = list (
							"backpack" = slot_in_backpack,
							"left pocket" = slot_l_store,
							"right pocket" = slot_r_store,
							"left hand" = slot_l_hand,
							"right hand" = slot_r_hand,
						)

						var/where = M.equip_in_one_of_slots(T, slots)
						if (!where)
							M << "You need a space in your backpack, pocket or hand for the new paper."
						else
							M << "The [href_list["rune"]] talisman in your [where]"
							M.update_icons()
							src.uses--
							supply()

					if("conceal")
						var/obj/item/weapon/paper/talisman/T = new(M)
						T.imbue = "conceal"

						var/list/slots = list (
							"backpack" = slot_in_backpack,
							"left pocket" = slot_l_store,
							"right pocket" = slot_r_store,
							"left hand" = slot_l_hand,
							"right hand" = slot_r_hand,
						)

						var/where = M.equip_in_one_of_slots(T, slots)
						if (!where)
							M << "You need a space in your backpack, pocket or hand for the new paper."
						else
							M << "The [href_list["rune"]] talisman in your [where]"
							M.update_icons()
							src.uses--
							supply()

					if("communicate")
						var/obj/item/weapon/paper/talisman/T = new(M)
						T.imbue = "communicate"

						var/list/slots = list (
							"backpack" = slot_in_backpack,
							"left pocket" = slot_l_store,
							"right pocket" = slot_r_store,
							"left hand" = slot_l_hand,
							"right hand" = slot_r_hand,
						)

						var/where = M.equip_in_one_of_slots(T, slots)
						if (!where)
							M << "You need a space in your backpack, pocket or hand for the new paper."
						else
							M << "The [href_list["rune"]] talisman in your [where]"
							M.update_icons()
							src.uses--
							supply()

					if("runestun")
						var/obj/item/weapon/paper/talisman/T = new(M)
						T.imbue = "runestun"

						var/list/slots = list (
							"backpack" = slot_in_backpack,
							"left pocket" = slot_l_store,
							"right pocket" = slot_r_store,
							"left hand" = slot_l_hand,
							"right hand" = slot_r_hand,
						)

						var/where = M.equip_in_one_of_slots(T, slots)
						if (!where)
							M << "You need a space in your backpack, pocket or hand for the new paper."
						else
							M << "The [href_list["rune"]] talisman in your [where]"
							M.update_icons()
							src.uses--
							supply()

					if("armor")
						var/obj/item/weapon/paper/talisman/T = new(M)
						T.imbue = "armor"

						var/list/slots = list (
							"backpack" = slot_in_backpack,
							"left pocket" = slot_l_store,
							"right pocket" = slot_r_store,
							"left hand" = slot_l_hand,
							"right hand" = slot_r_hand,
						)

						var/where = M.equip_in_one_of_slots(T, slots)
						if (!where)
							M << "You need a space in your backpack, pocket or hand for the new paper."
						else
							M << "The [href_list["rune"]] talisman in your [where]"
							M.update_icons()
							src.uses--
							supply()

					if("soulstone")
						new /obj/item/device/soulstone(get_turf(usr))
						src.uses--
						supply()
					if("construct")
						new /obj/structure/constructshell(get_turf(usr))
						src.uses--
						supply()
			else
				return



		return


/obj/item/weapon/paper/talisman/supply
	imbue = "supply"
	uses = 5
{'fraction_non_alphanumeric': 0.1600964155197885, 'fraction_numerical': 0.0026436513490397323, 'mean_word_length': 2.8508982035928145, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 67, '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': '6066669', 'n_tokens_mistral': 6162, 'n_tokens_neox': 4829, 'n_words': 1110}