code:
/obj/effect/proc_holder/changeling/sting
	name = "Tiny Prick"
	desc = "Stabby stabby"
	var/sting_icon = null

/obj/effect/proc_holder/changeling/sting/Click()
	var/mob/user = usr
	if(!user || !user.mind || !user.mind.changeling)
		return
	if(!(user.mind.changeling.chosen_sting))
		set_sting(user)
	else
		unset_sting(user)
	return

/obj/effect/proc_holder/changeling/sting/proc/set_sting(var/mob/user)
	user << "We prepare our sting, use alt+click or middle mouse button on target to sting them."
	user.mind.changeling.chosen_sting = src
	user.hud_used.lingstingdisplay.icon_state = sting_icon
	user.hud_used.lingstingdisplay.invisibility = 0

/obj/effect/proc_holder/changeling/sting/proc/unset_sting(var/mob/user)
	user << "We retract our sting, we can't sting anyone for now."
	user.mind.changeling.chosen_sting = null
	user.hud_used.lingstingdisplay.icon_state = null
	user.hud_used.lingstingdisplay.invisibility = 101

/mob/living/carbon/proc/unset_sting()
	if(mind && mind.changeling && mind.changeling.chosen_sting)
		src.mind.changeling.chosen_sting.unset_sting(src)

/obj/effect/proc_holder/changeling/sting/can_sting(var/mob/user, var/mob/target)
	if(!..())
		return
	if(!user.mind.changeling.chosen_sting)
		user << "We haven't prepared our sting yet!"
	if(!iscarbon(target))
		return
	if(!isturf(user.loc))
		return
	if(get_dist(user, target) > (user.mind.changeling.sting_range))
		return //sanity check as AStar is still throwing insane stunts
	if(!AStar(user.loc, target.loc, null, /turf/proc/Distance, user.mind.changeling.sting_range))
		return //hope this ancient magic still works
	if(target.mind && target.mind.changeling)
		sting_feedback(user,target)
		take_chemical_cost(user.mind.changeling)
		return
	return 1

/obj/effect/proc_holder/changeling/sting/sting_feedback(var/mob/user, var/mob/target)
	if(!target)
		return
	user << "We stealthily sting [target.name]."
	if(target.mind && target.mind.changeling)
		target << "You feel a tiny prick."
		add_logs(user, target, "unsuccessfully stung")
	return 1

/obj/effect/proc_holder/changeling/sting/transformation
	name = "Transformation Sting"
	desc = "We silently sting a human, injecting a retrovirus that forces them to transform."
	helptext = "Does not provide a warning to others. The victim will transform much like a changeling would."
	sting_icon = "sting_transform"
	chemical_cost = 40
	dna_cost = 2
	var/datum/dna/selected_dna = null

/obj/effect/proc_holder/changeling/sting/transformation/Click()
	var/mob/user = usr
	var/datum/changeling/changeling = user.mind.changeling
	if(changeling.chosen_sting)
		unset_sting(user)
		return
	selected_dna = changeling.select_dna("Select the target DNA: ", "Target DNA")
	if(!selected_dna)
		return
	..()

/obj/effect/proc_holder/changeling/sting/transformation/can_sting(var/mob/user, var/mob/target)
	if(!..())
		return
	if((target.disabilities & HUSK) || !check_dna_integrity(target))
		user << "Our sting appears ineffective against its DNA."
		return 0
	return 1

/obj/effect/proc_holder/changeling/sting/transformation/sting_action(var/mob/user, var/mob/target)
	add_logs(user, target, "stung", object="transformation sting", addition=" new identity is [selected_dna.real_name]")
	var/datum/dna/NewDNA = selected_dna
	if(ismonkey(target))
		user << "We stealthily sting [target.name]."
	hardset_dna(target, NewDNA.uni_identity, NewDNA.struc_enzymes, NewDNA.real_name, NewDNA.blood_type, NewDNA.species.type, NewDNA.mutant_color)
	updateappearance(target)
	feedback_add_details("changeling_powers","TS")
	return 1

obj/effect/proc_holder/changeling/sting/extract_dna
	name = "Extract DNA Sting"
	desc = "We stealthily sting a target and extract their DNA."
	helptext = "Will give you the DNA of your target, allowing you to transform into them."
	sting_icon = "sting_extract"
	chemical_cost = 25
	dna_cost = 0

/obj/effect/proc_holder/changeling/sting/extract_dna/can_sting(var/mob/user, var/mob/target)
	if(..())
		return user.mind.changeling.can_absorb_dna(user, target)

/obj/effect/proc_holder/changeling/sting/extract_dna/sting_action(var/mob/user, var/mob/living/carbon/human/target)
	add_logs(user, target, "stung", object="extraction sting")
	if(!(user.mind.changeling.has_dna(target.dna)))
		user.mind.changeling.absorb_dna(target, user)
	feedback_add_details("changeling_powers","ED")
	return 1

obj/effect/proc_holder/changeling/sting/mute
	name = "Mute Sting"
	desc = "We silently sting a human, completely silencing them for a short time."
	helptext = "Does not provide a warning to the victim that they have been stung, until they try to speak and cannot."
	sting_icon = "sting_mute"
	chemical_cost = 20
	dna_cost = 2

/obj/effect/proc_holder/changeling/sting/mute/sting_action(var/mob/user, var/mob/living/carbon/target)
	add_logs(user, target, "stung", object="mute sting")
	target.silent += 30
	feedback_add_details("changeling_powers","MS")
	return 1

obj/effect/proc_holder/changeling/sting/blind
	name = "Blind Sting"
	desc = "Temporarily blinds the target."
	helptext = "This sting completely blinds a target for a short time."
	sting_icon = "sting_blind"
	chemical_cost = 25
	dna_cost = 1

/obj/effect/proc_holder/changeling/sting/blind/sting_action(var/mob/user, var/mob/target)
	add_logs(user, target, "stung", object="blind sting")
	target << "Your eyes burn horrifically!"
	target.disabilities |= NEARSIGHT
	target.eye_blind = 20
	target.eye_blurry = 40
	feedback_add_details("changeling_powers","BS")
	return 1

obj/effect/proc_holder/changeling/sting/LSD
	name = "Hallucination Sting"
	desc = "Causes terror in the target."
	helptext = "We evolve the ability to sting a target with a powerful hallucinogenic chemical. The target does not notice they have been stung, and the effect occurs after 30 to 60 seconds."
	sting_icon = "sting_lsd"
	chemical_cost = 10
	dna_cost = 1

/obj/effect/proc_holder/changeling/sting/LSD/sting_action(var/mob/user, var/mob/living/carbon/target)
	add_logs(user, target, "stung", object="LSD sting")
	spawn(rand(300,600))
		if(target)
			target.hallucination = max(400, target.hallucination)
	feedback_add_details("changeling_powers","HS")
	return 1

obj/effect/proc_holder/changeling/sting/cryo
	name = "Cryogenic Sting"
	desc = "We silently sting a human with a cocktail of chemicals that freeze them."
	helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing."
	sting_icon = "sting_cryo"
	chemical_cost = 15
	dna_cost = 2

/obj/effect/proc_holder/changeling/sting/cryo/sting_action(var/mob/user, var/mob/target)
	add_logs(user, target, "stung", object="cryo sting")
	if(target.reagents)
		target.reagents.add_reagent("frostoil", 30)
	feedback_add_details("changeling_powers","CS")
	return 1

/*
honk // this code has only been partially updated, and probably doesn't work (also has no icons)
obj/effect/proc_holder/changeling/sting/deaf
	name = "Deaf sting"
	sting_icon = "sting_deaf"
	chemical_cost = 5
	dna_cost = 1
	desc = "We silently sting a human with a cocktail of chemicals that rapidly expands their ear drums, deafening them temporarily."

/obj/effect/proc_holder/changeling/sting/deaf/sting_action(var/mob/user, var/mob/target)
	var/mob/living/carbon/T = changeling_sting(5,/mob/living/carbon/proc/changeling_deaf_sting)
	if(!T)	return 0
	T << "Your ears pop and begin ringing loudly!"
	T.sdisabilities |= DEAF
	spawn(300)	T.sdisabilities &= ~DEAF
	feedback_add_details("changeling_powers","DS")
	return 1

obj/effect/proc_holder/changeling/sting/para
	name = "Paralysis sting"
	sting_icon = "sting_para"
	chemical_cost = 30
	dna_cost = 2
	desc = "We sting a human with a cocktail of chemicals that forces their muscles to quickly contract, resulting in temporary paralysis."

/obj/effect/proc_holder/changeling/sting/para/sting_action(var/mob/user, var/mob/target)
	var/mob/living/carbon/T = changeling_sting(30,/mob/living/carbon/proc/changeling_paralysis_sting)
	if(!T)	return 0
	T << "Your muscles begin to painfully tighten."
	T.Weaken(20)
	feedback_add_details("changeling_powers","PS")
	return 1

obj/effect/proc_holder/changeling/sting/death
	name = "Death Sting"
	sting_icon = "sting_death"
	chemical_cost = 40
	dna_cost = 3
	desc = "Causes spasms onto death."

/obj/effect/proc_holder/changeling/sting/death/sting_action(var/mob/user, var/mob/target)
	var/mob/living/carbon/T = changeling_sting(40,/mob/living/carbon/proc/changeling_DEATHsting)
	if(!T)	return 0
	T << "You feel a small prick and your chest becomes tight."
	T.silent = 10
	T.Paralyse(10)
	T.make_jittery(1000)
	if(T.reagents)	T.reagents.add_reagent("lexorin", 40)
	feedback_add_details("changeling_powers","DTHS")
	return 1
*/


code:
/obj/effect/proc_holder/changeling/transform
	name = "Transform"
	desc = "We take on the appearance and voice of one we have absorbed."
	chemical_cost = 5
	dna_cost = 0
	req_dna = 1
	req_human = 1
	max_genetic_damage = 3

//Change our DNA to that of somebody we've absorbed.
/obj/effect/proc_holder/changeling/transform/sting_action(var/mob/living/carbon/human/user)
	var/datum/changeling/changeling = user.mind.changeling
	var/datum/dna/chosen_dna = changeling.select_dna("Select the target DNA: ", "Target DNA")

	if(!chosen_dna)
		return

	user.dna = chosen_dna
	user.real_name = chosen_dna.real_name
	hardset_dna(user, null, null, null, null, chosen_dna.species.type)
	user.dna.mutant_color = chosen_dna.mutant_color
	updateappearance(user)
	domutcheck(user)

	feedback_add_details("changeling_powers","TR")
	return 1

/datum/changeling/proc/select_dna(var/prompt, var/title)
	var/list/names = list()
	for(var/datum/dna/DNA in (absorbed_dna+protected_dna))
		names += "[DNA.real_name]"

	var/chosen_name = input(prompt, title, null) as null|anything in names
	if(!chosen_name)
		return
	var/datum/dna/chosen_dna = get_dna(chosen_name)
	return chosen_dna

license: mit


code:
/datum/game_mode/traitor/changeling
	name = "traitor+changeling"
	config_tag = "traitorchan"
	traitors_possible = 3 //hard limit on traitors if scaling is turned off
	restricted_jobs = list("AI", "Cyborg", "MoMMI")
	required_players = 0
	required_enemies = 1	// how many of each type are required
	recommended_enemies = 3

	var/list/possible_changelings = list()
	var/const/changeling_amount = 1 //hard limit on changelings if scaling is turned off

/datum/game_mode/traitor/changeling/announce()
	world << "The current game mode is - Traitor+Changeling!"
	world << "There are alien creatures on the station along with some syndicate operatives out for their own gain! Do not let the changelings or the traitors succeed!"

/datum/game_mode/traitor/changeling/can_start()
	if(!..())
		return 0
	possible_changelings = get_players_for_role(BE_CHANGELING)
	if(possible_changelings.len < required_enemies)
		return 0
	return 1

/datum/game_mode/traitor/changeling/pre_setup()
	if(config.protect_roles_from_antagonist)
		restricted_jobs += protected_jobs

	if(config.protect_assistant_from_antagonist)
		restricted_jobs += "Assistant"

	var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING)

	var/num_changelings = 1

	if(config.changeling_scaling_coeff)
		num_changelings = max(1, min( round(num_players()/(config.changeling_scaling_coeff*4))+2, round(num_players()/(config.changeling_scaling_coeff*2)) ))
	else
		num_changelings = max(1, min(num_players(), changeling_amount/2))

	if(possible_changelings.len>0)
		for(var/j = 0, j < num_changelings, j++)
			if(!possible_changelings.len) break
			var/datum/mind/changeling = pick(possible_changelings)
			possible_changelings -= changeling
			changelings += changeling
			changeling.restricted_roles = restricted_jobs
			modePlayer += changelings
		return ..()
	else
		return 0

/datum/game_mode/traitor/changeling/post_setup()
	for(var/datum/mind/changeling in changelings)
		changeling.current.make_changeling(changeling.current)
		changeling.special_role = "Changeling"
		forge_changeling_objectives(changeling)
		greet_changeling(changeling)
	..()
	return

/datum/game_mode/traitor/changeling/make_antag_chance(var/mob/living/carbon/human/character) //Assigns changeling to latejoiners
	var/changelingcap = min( round(joined_player_list.len/(config.changeling_scaling_coeff*4))+2, round(joined_player_list.len/(config.changeling_scaling_coeff*2)) )
	if(changelings.len >= changelingcap) //Caps number of latejoin antagonists
		..()
		return
	if(changelings.len <= (changelingcap - 2) || prob(100 / (config.changeling_scaling_coeff * 4)))
		if(character.client.prefs.be_special & BE_CHANGELING)
			if(!jobban_isbanned(character.client, "changeling") && !jobban_isbanned(character.client, "Syndicate"))
				if(age_check(character.client))
					if(!(character.job in ticker.mode.restricted_jobs))
						character.mind.make_Changling()
	..()


code:
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31

/datum/game_mode
	var/list/datum/mind/cult = list()
	var/list/allwords = list("travel","self","see","hell","blood","join","tech","destroy", "other", "hide")
	var/list/grantwords = list("travel", "see", "hell", "tech", "destroy", "other", "hide")
	var/list/cult_objectives = list()

/proc/iscultist(mob/living/M as mob)
	return istype(M) && M.mind && ticker && ticker.mode && (M.mind in ticker.mode.cult)

/proc/is_convertable_to_cult(datum/mind/mind)
	if(!istype(mind))	return 0
	if(istype(mind.current, /mob/living/carbon/human) && (mind.assigned_role in list("Captain", "Chaplain")))	return 0
	if(isloyal(mind.current))
		return 0
	if (ticker.mode.name == "cult")		//redundent?
		if(mind.current == ticker.mode.sacrifice_target)	return 0
	return 1

/datum/game_mode/cult
	name = "cult"
	config_tag = "cult"
	antag_flag = BE_CULTIST
	restricted_jobs = list("Chaplain","AI", "Cyborg", "MoMMI",  "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel")
	protected_jobs = list()
	required_players = 10
	required_enemies = 2
	recommended_enemies = 4

	var/finished = 0

	var/list/startwords = list("blood","join","self","hell")
	var/list/secondwords = list("travel", "see", "tech", "destroy", "other", "hide")

	var/eldergod = 1 //for the summon god objective

	var/acolytes_needed = 7 //for the survive objective
	var/acolytes_survived = 0

/datum/game_mode/cult/announce()
	world << "The current game mode is - Cult!"
	world << "Some crewmembers are attempting to start a cult!
\nCultists - complete your objectives. Convert crewmembers to your cause by using the convert rune. Remember - there is no you, there is only the cult.
\nPersonnel - Do not let the cult succeed in its mission. Brainwashing them with the chaplain's bible reverts them to whatever Centcom-allowed faith they had."

/datum/game_mode/cult/pre_setup()
	if(prob(50))
		cult_objectives += "survive"
		cult_objectives += "sacrifice"
	else
		cult_objectives += "eldergod"
		cult_objectives += "sacrifice"

	//adjust game mode for player numbers
	if(num_players() < 20)
		set_runecults(setELDERGOD_CULTS=6, setCONVERT_CULTS=2, setSACRIFICE_CULTS=2)

	if(num_players() >= 20)
		required_enemies = 4
		recommended_enemies = 6
		acolytes_needed = 10

	if(num_players() >= 30)
		required_enemies = 6
		recommended_enemies = 9	// 3+3+3 - d' magic number o' magic numbars mon
		acolytes_needed = 15

	if(config.protect_roles_from_antagonist)
		restricted_jobs += protected_jobs

	if(config.protect_assistant_from_antagonist)
		restricted_jobs += "Assistant"

	for(var/cultists_number = 1 to recommended_enemies)
		if(!antag_candidates.len)
			break
		var/datum/mind/cultist = pick(antag_candidates)
		antag_candidates -= cultist
		cult += cultist
		cultist.restricted_roles = restricted_jobs
		cultist.special_role = "Cultist"
		log_game("[cultist.key] (ckey) has been selected as a cultist")

	return (cult.len>=required_enemies)

/datum/game_mode/cult/post_setup()
	modePlayer += cult
	if("sacrifice" in cult_objectives)
		var/list/possible_targets = get_unconvertables()

		if(!possible_targets.len)
			message_admins("Cult Sacrifice: Could not find unconvertable target, checking for convertable target.")
			for(var/mob/living/carbon/human/player in player_list)
				if(player.mind && !(player.mind in cult))
					possible_targets += player.mind

		if(possible_targets.len > 0)
			sacrifice_target = pick(possible_targets)
			if(!sacrifice_target)
				message_admins("Cult Sacrifice: ERROR -  Null target chosen!")
		else
			message_admins("Cult Sacrifice: Could not find unconvertable or convertable target. WELP!")

	for(var/datum/mind/cult_mind in cult)
		equip_cultist(cult_mind.current)
//		grant_runeword(cult_mind.current)
//		grant_secondword(cult_mind.current)
		update_cult_icons_added(cult_mind)
		cult_mind.current << "You are a member of the cult!"
		memorize_cult_objectives(cult_mind)
	..()

/datum/game_mode/cult/proc/memorize_cult_objectives(var/datum/mind/cult_mind)
	for(var/obj_count = 1,obj_count <= cult_objectives.len,obj_count++)
		var/explanation
		switch(cult_objectives[obj_count])
			if("survive")
				explanation = "Our knowledge must live on. Make sure at least [acolytes_needed] acolytes escape on the shuttle to spread their work on an another station."
			if("sacrifice")
				if(sacrifice_target)
					explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. You will need the sacrifice rune (Hell blood join) and three acolytes to do so."
				else
					explanation = "Free objective."
			if("eldergod")
				explanation = "Summon Nar-Sie via the use of the appropriate rune (Hell join self). It will only work if [ELDERGOD_CULTS] cultists stand on and around it."
		cult_mind.current << "Objective #[obj_count]: [explanation]"
		cult_mind.memory += "Objective #[obj_count]: [explanation]
"
	cult_mind.current << "The Geometer of Blood grants you the knowledge to sacrifice non-believers. (Hell Blood Join)"
	cult_mind.memory += "The Geometer of Blood grants you the knowledge to sacrifice non-believers. (Hell Blood Join)
"
	for(var/startingword in startwords)
		grant_runeword(cult_mind.current,startingword)
//	grant_runeword(cult_mind.current,"blood")
//	grant_runeword(cult_mind.current,"hell")

/datum/game_mode/proc/equip_cultist(mob/living/carbon/human/mob)
	if(!istype(mob))
		return

	if (mob.mind)
		if (mob.mind.assigned_role == "Clown")
			mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself."
			mob.dna.remove_mutation(CLOWNMUT)

	var/obj/item/weapon/paper/talisman/supply/T = new(mob)
	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 = mob.equip_in_one_of_slots(T, slots)
	if (!where)
		mob << "Unfortunately, you weren't able to get a talisman. This is very bad and you should adminhelp immediately."
	else
		mob << "You have a talisman in your [where], one that will help you start the cult on this station. Use it well and remember - there are others."
		mob.update_icons()
		return 1

//datum/game_mode/cult/proc/grant_secondword(mob/living/carbon/human/cult_mob, var/word)
//	if (!word)
//		if(secondwords.len > 0)
//			word=pick(secondwords)
//			secondwords -= word
//			grant_runeword(cult_mob,word)

//datum/game_mode/cult/grant_runeword(mob/living/carbon/human/cult_mob, var/word)
//	if (!word)
//		if(startwords.len > 0)
//			word=pick(startwords)
//			startwords -= word
//	return ..(cult_mob,word)

/datum/game_mode/proc/grant_runeword(mob/living/carbon/human/cult_mob, var/word)
	if(!wordtravel)
		runerandom()
	if (!word)
		word=pick(grantwords)
	var/wordexp
	switch(word)
		if("travel")
			wordexp = "[wordtravel] is travel..."
		if("blood")
			wordexp = "[wordblood] is blood..."
		if("join")
			wordexp = "[wordjoin] is join..."
		if("hell")
			wordexp = "[wordhell] is Hell..."
		if("self")
			wordexp = "[wordself] is self..."
		if("see")
			wordexp = "[wordsee] is see..."
		if("tech")
			wordexp = "[wordtech] is technology..."
		if("destroy")
			wordexp = "[worddestr] is destroy..."
		if("other")
			wordexp = "[wordother] is other..."
//		if("hear")
//			wordexp = "[wordhear] is hear..."
//		if("free")
//			wordexp = "[wordfree] is free..."
		if("hide")
			wordexp = "[wordhide] is hide..."
	cult_mob << "[pick("You remember something from the dark teachings of your master","You hear a dark voice on the wind","Black blood oozes into your vision and forms into symbols","You catch a brief glimmer of the otherside")]... [wordexp]"
	cult_mob.mind.store_memory("You remember that [wordexp]", 0, 0)
	cult_mob.mind.cult_words += word
	if(cult_mob.mind.cult_words.len == allwords.len)
		cult_mob << "\green You feel enlightened, as if you have gained all the secrets of the other side."

/datum/game_mode/proc/add_cultist(datum/mind/cult_mind) //BASE
	if (!istype(cult_mind))
		return 0
	if(!(cult_mind in cult) && is_convertable_to_cult(cult_mind))
		cult += cult_mind
		cult_mind.current.cult_add_comm()
		update_cult_icons_added(cult_mind)
		cult_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the cult!"
		return 1

/datum/game_mode/cult/add_cultist(datum/mind/cult_mind) //INHERIT
	if (!..(cult_mind))
		return
	memorize_cult_objectives(cult_mind)

/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, show_message = 1)
	if(cult_mind in cult)
		cult -= cult_mind
		cult_mind.current.verbs -= /mob/living/proc/cult_innate_comm
		cult_mind.current << "An unfamiliar white light flashes through your mind, cleansing the taint of the dark-one and the memories of your time as his servant with it."
		cult_mind.memory = ""
		cult_mind.cult_words = initial(cult_mind.cult_words)
		update_cult_icons_removed(cult_mind)
		cult_mind.current.attack_log += "\[[time_stamp()]\] Has renounced the cult!"
		if(show_message)
			for(var/mob/M in viewers(cult_mind.current))
				M << "[cult_mind.current] looks like they just reverted to their old faith!"

/datum/game_mode/proc/update_cult_icons_added(datum/mind/cult_mind)
	var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT]
	culthud.join_hud(cult_mind.current)
	set_antag_hud(cult_mind.current, "cult")

/datum/game_mode/proc/update_cult_icons_removed(datum/mind/cult_mind)
	var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT]
	culthud.leave_hud(cult_mind.current)
	set_antag_hud(cult_mind.current, null)

/datum/game_mode/cult/proc/get_unconvertables()
	var/list/ucs = list()
	for(var/mob/living/carbon/human/player in player_list)
		if(player.mind && !is_convertable_to_cult(player.mind))
			ucs += player.mind
	return ucs

/datum/game_mode/cult/proc/check_cult_victory()
	var/cult_fail = 0
	if(cult_objectives.Find("survive"))
		cult_fail += check_survive() //the proc returns 1 if there are not enough cultists on the shuttle, 0 otherwise
	if(cult_objectives.Find("eldergod"))
		cult_fail += eldergod //1 by default, 0 if the elder god has been summoned at least once
	if(cult_objectives.Find("sacrifice"))
		if(sacrifice_target && !sacrificed.Find(sacrifice_target)) //if the target has been sacrificed, ignore this step. otherwise, add 1 to cult_fail
			cult_fail++

	return cult_fail //if any objectives aren't met, failure

/datum/game_mode/cult/proc/check_survive()
	acolytes_survived = 0
	for(var/datum/mind/cult_mind in cult)
		if (cult_mind.current && cult_mind.current.stat != DEAD)
			if(cult_mind.current.onCentcom())
				acolytes_survived++
	if(acolytes_survived>=acolytes_needed)
		return 0
	else
		return 1

/datum/game_mode/cult/declare_completion()

	if(!check_cult_victory())
		feedback_set_details("round_end_result","win - cult win")
		feedback_set("round_end_result",acolytes_survived)
		world << "The cult wins! It has succeeded in serving its dark masters!"
	else
		feedback_set_details("round_end_result","loss - staff stopped the cult")
		feedback_set("round_end_result",acolytes_survived)
		world << "The staff managed to stop the cult!"

	var/text = ""

	if(cult_objectives.len)
		text += "
The cultists' objectives were:"
		for(var/obj_count=1, obj_count <= cult_objectives.len, obj_count++)
			var/explanation
			switch(cult_objectives[obj_count])
				if("survive")
					if(!check_survive())
						explanation = "Make sure at least [acolytes_needed] acolytes escape on the shuttle. ([acolytes_survived] escaped) Success!"
						feedback_add_details("cult_objective","cult_survive|SUCCESS|[acolytes_needed]")
					else
						explanation = "Make sure at least [acolytes_needed] acolytes escape on the shuttle. ([acolytes_survived] escaped) Fail."
						feedback_add_details("cult_objective","cult_survive|FAIL|[acolytes_needed]")
				if("sacrifice")
					if(sacrifice_target)
						if(sacrifice_target in sacrificed)
							explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. Success!"
							feedback_add_details("cult_objective","cult_sacrifice|SUCCESS")
						else if(sacrifice_target && sacrifice_target.current)
							explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. Fail."
							feedback_add_details("cult_objective","cult_sacrifice|FAIL")
						else
							explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. Fail (Gibbed)."
							feedback_add_details("cult_objective","cult_sacrifice|FAIL|GIBBED")
				if("eldergod")
					if(!eldergod)
						explanation = "Summon Nar-Sie. Success!"
						feedback_add_details("cult_objective","cult_narsie|SUCCESS")
					else
						explanation = "Summon Nar-Sie. Fail."
						feedback_add_details("cult_objective","cult_narsie|FAIL")
			text += "
Objective #[obj_count]: [explanation]"

	world << text
	..()
	return 1

/datum/game_mode/proc/auto_declare_completion_cult()
	if( cult.len || (ticker && istype(ticker.mode,/datum/game_mode/cult)) )
		var/text = "
The cultists were:"
		for(var/datum/mind/cultist in cult)
			text += printplayer(cultist)

		text += "
"

		world << text


code:
/obj/item/weapon/melee/cultblade
	name = "cult blade"
	desc = "An arcane weapon wielded by the followers of Nar-Sie"
	icon_state = "cultblade"
	item_state = "cultblade"
	flags = CONDUCT
	w_class = 4
	force = 30
	throwforce = 10
	hitsound = 'sound/weapons/bladeslice.ogg'
	attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")

/obj/item/weapon/melee/cultblade/attack(mob/living/target as mob, mob/living/carbon/human/user as mob)
	if(iscultist(user))
		return ..()
	else
		user.Paralyse(5)
		user << "An unexplicable force powerfully repels the sword from [target]!"
		var/organ = ((user.hand ? "l_":"r_") + "arm")
		var/obj/item/organ/limb/affecting = user.get_organ(organ)
		if(affecting.take_damage(rand(force/2, force))) //random amount of damage between half of the blade's force and the full force of the blade.
			user.update_damage_overlays(0)
	return

/obj/item/weapon/melee/cultblade/pickup(mob/living/user as mob)
	if(!iscultist(user))
		user << "An overwhelming feeling of dread comes over you as you pick up the cultist's sword. It would be wise to be rid of this blade quickly."
		user.Dizzy(120)

/obj/item/clothing/head/culthood
	name = "cult hood"
	icon_state = "culthood"
	desc = "A hood worn by the followers of Nar-Sie."
	flags_inv = HIDEFACE
	flags = HEADCOVERSEYES
	armor = list(melee = 30, bullet = 10, laser = 5,energy = 5, bomb = 0, bio = 0, rad = 0)
	cold_protection = HEAD
	min_cold_protection_temperature = HELMET_MIN_TEMP_PROTECT
	heat_protection = HEAD
	max_heat_protection_temperature = HELMET_MAX_TEMP_PROTECT

/obj/item/clothing/head/culthood/alt
	icon_state = "cult_hoodalt"
	item_state = "cult_hoodalt"

/obj/item/clothing/suit/cultrobes/alt
	icon_state = "cultrobesalt"
	item_state = "cultrobesalt"

/obj/item/clothing/suit/cultrobes
	name = "cult robes"
	desc = "A set of armored robes worn by the followers of Nar-Sie"
	icon_state = "cultrobes"
	item_state = "cultrobes"
	body_parts_covered = CHEST|GROIN|LEGS|ARMS
	allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade)
	armor = list(melee = 50, bullet = 30, laser = 50,energy = 20, bomb = 25, bio = 10, rad = 0)
	flags_inv = HIDEJUMPSUIT
	cold_protection = CHEST|GROIN|LEGS|ARMS
	min_cold_protection_temperature = ARMOR_MIN_TEMP_PROTECT
	heat_protection = CHEST|GROIN|LEGS|ARMS
	max_heat_protection_temperature = ARMOR_MAX_TEMP_PROTECT

/obj/item/clothing/head/magus
	name = "magus helm"
	icon_state = "magus"
	item_state = "magus"
	desc = "A helm worn by the followers of Nar-Sie."
	flags_inv = HIDEFACE
	flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
	armor = list(melee = 30, bullet = 30, laser = 30,energy = 20, bomb = 0, bio = 0, rad = 0)

/obj/item/clothing/suit/magusred
	name = "magus robes"
	desc = "A set of armored robes worn by the followers of Nar-Sie"
	icon_state = "magusred"
	item_state = "magusred"
	body_parts_covered = CHEST|GROIN|LEGS|ARMS
	allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade)
	armor = list(melee = 50, bullet = 30, laser = 50,energy = 20, bomb = 25, bio = 10, rad = 0)
	flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT

/obj/item/clothing/head/helmet/space/cult
	name = "cult helmet"
	desc = "A space worthy helmet used by the followers of Nar-Sie"
	icon_state = "cult_helmet"
	item_state = "cult_helmet"
	armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30)

/obj/item/clothing/suit/space/cult
	name = "cult armor"
	icon_state = "cult_armor"
	item_state = "cult_armor"
	desc = "A bulky suit of armor, bristling with spikes. It looks space proof."
	w_class = 3
	allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade,/obj/item/weapon/tank/internals/emergency_oxygen)
	slowdown = 1
	armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30)


code:
/obj/structure/cult
	density = 1
	anchored = 1
	icon = 'icons/obj/cult.dmi'

/obj/structure/cult/talisman
	name = "altar"
	desc = "A bloodstained altar dedicated to Nar-Sie"
	icon_state = "talismanaltar"

/obj/structure/cult/forge
	name = "daemon forge"
	desc = "A forge used in crafting the unholy weapons used by the armies of Nar-Sie"
	icon_state = "forge"

/obj/structure/cult/pylon
	name = "Pylon"
	desc = "A floating crystal that hums with an unearthly energy"
	icon_state = "pylon"
	var/isbroken = 0
	light_range = 10
	light_power = 2
	light_color = LIGHT_COLOR_RED
	var/obj/item/wepon = null

/obj/structure/cult/pylon/attack_hand(mob/M as mob)
	attackpylon(M, 5)

/obj/structure/cult/pylon/attack_animal(mob/living/simple_animal/user as mob)
	attackpylon(user, user.melee_damage_upper)

/obj/structure/cult/pylon/attackby(obj/item/W as obj, mob/user as mob)
	attackpylon(user, W.force)

/obj/structure/cult/pylon/proc/attackpylon(mob/user as mob, var/damage)
	if(!isbroken)
		if(prob(1+ damage * 5))
			user << "You hit the pylon, and its crystal breaks apart!"
			for(var/mob/M in viewers(src))
				if(M == user)
					continue
				M.show_message("[user.name] smashed the pylon!", 3, "You hear a tinkle of crystal shards", 2)
			playsound(get_turf(src), 'sound/effects/Glassbr3.ogg', 75, 1)
			isbroken = 1
			density = 0
			icon_state = "pylon-broken"
			set_light(0)
		else
			user << "You hit the pylon!"
			playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
	else
		if(prob(damage * 2))
			user << "You pulverize what was left of the pylon!"
			qdel(src)
		else
			user << "You hit the pylon!"
		playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)

/obj/structure/cult/pylon/proc/repair(mob/user as mob)
	if(isbroken)
		user << "You repair the pylon."
		isbroken = 0
		density = 1
		icon_state = "pylon"
		set_light(5)

/obj/structure/cult/tome
	name = "desk"
	desc = "A desk covered in arcane manuscripts and tomes in unknown languages. Looking at the text makes your skin crawl"
	icon_state = "tomealtar"
//	luminosity = 5

//sprites for this no longer exist	-Pete
//(they were stolen from another game anyway)
/*
/obj/structure/cult/pillar
	name = "Pillar"
	desc = "This should not exist"
	icon_state = "pillar"
	icon = 'magic_pillar.dmi'
*/

/obj/effect/gateway
	name = "gateway"
	desc = "You're pretty sure that abyss is staring back"
	icon = 'icons/obj/cult.dmi'
	icon_state = "hole"
	density = 1
	unacidable = 1
	anchored = 1.0
	var/spawnable = null

/obj/effect/gateway/Bumped(mob/M as mob|obj)
	spawn(0)
		return
	return

/obj/effect/gateway/Crossed(AM as mob|obj)
	spawn(0)
		return
	return

/obj/effect/gateway/active
	light_range = 5
	light_color = LIGHT_COLOR_RED
	spawnable=list(
//		/mob/living/simple_animal/hostile/scarybat,
		/mob/living/simple_animal/hostile/creature,
		/mob/living/simple_animal/hostile/faithless
	)

/obj/effect/gateway/active/cult
	light_range = 5
	light_color = LIGHT_COLOR_RED
	spawnable=list(
//		/mob/living/simple_animal/hostile/scarybat/cult,
		/mob/living/simple_animal/hostile/creature/cult,
		/mob/living/simple_animal/hostile/faithless/cult
	)

/obj/effect/gateway/active/cult/narsie_act()
	return

/obj/effect/gateway/active/New()
	spawn(rand(30,60) SECONDS)
		var/t = pick(spawnable)
		new t(src.loc)
		qdel(src)

/obj/effect/gateway/active/Crossed(var/atom/A)
	if(!istype(A, /mob/living))
		return

	var/mob/living/M = A

	if(M.stat != DEAD)
//		if(M.monkeyizing)
//			return
		if(M.has_brain_worms())
			return //Borer stuff - RR

		if(iscultist(M)) return
		if(!ishuman(M) && !isrobot(M)) return

		M.narsie_act()
/*
//		M.monkeyizing = 1
		M.canmove = 0
		M.icon = null
		M.overlays.len = 0
		M.invisibility = 101

		if(istype(M, /mob/living/silicon/robot))
			var/mob/living/silicon/robot/Robot = M
			if(Robot.mmi)
				del(Robot.mmi)
		else
			for(var/obj/item/W in M)
				if(istype(W, /obj/item/weapon/implant))	//TODO: Carn. give implants a dropped() or something
					qdel(W)
					continue
				W.layer = initial(W.layer)
				W.loc = M.loc
				W.dropped(M)

		var/mob/living/new_mob = new /mob/living/simple_animal/hostile/retaliate/cluwne(A.loc)
		new_mob.setGender(gender)
		new_mob.name = pick(clown_names)
		new_mob.real_name = new_mob.name
//		new_mob.mutations += M_CLUMSY
//		new_mob.mutations += M_FAT
		new_mob.setBrainLoss(100)

//		new_mob.a_intent = I_HURT
		if(M.mind)
			M.mind.transfer_to(new_mob)
		else
			new_mob.key = M.key

		new_mob << "<B>Your form morphs into that of a cluwne.</B>"
*/


code:
/*

In short:
 * Random area alarms
 * All areas jammed
 * Random gateways spawning hellmonsters (and turn people into cluwnes if ran into)
 * Broken APCs/Fire Alarms
 * Scary music
 * Random tiles changing to culty tiles.

*/
/datum/universal_state/hell
	name = "Hell Rising"
	desc = "OH FUCK OH FUCK OH FUCK"

	decay_rate = 5 // 5% chance of a turf decaying on lighting update/airflow (there's no actual tick for turfs)

/datum/universal_state/hell/OnShuttleCall(var/mob/user)
	return 1
	/*
	if(user)
		user << "All you hear on the frequency is static and panicked screaming. There will be no shuttle call today."
	return 0
	*/

/datum/universal_state/hell/DecayTurf(var/turf/T)
	if(!T)
		return
	T.narsie_act()
	for(var/obj/machinery/light/L in T.contents)
		new /obj/structure/cult/pylon(L.loc)
		qdel(L)
	return

/datum/universal_state/hell/OnTurfChange(var/turf/T)
	if(istype(T, /turf/space))
		T.overlays += "hell01"
		T.underlays -= "hell01"
	else
		T.overlays -= "hell01"

// Apply changes when entering state
/datum/universal_state/hell/OnEnter()
	set background = 1
	/*
	if(emergency_shuttle.direction==2)
		captain_announce("The emergency shuttle has returned due to bluespace distortion.")

	emergency_shuttle.force_shutdown()
	*/

	escape_list = get_area_turfs(locate(/area/hallway/secondary/exit))

//	suspend_alert = 1

	//Separated into separate procs for profiling
	AreaSet()
	MiscSet()
	APCSet()
	KillMobs()
	OverlayAndAmbientSet()

	runedec += 9000	//basically removing the rune cap

//	ticker.StartThematic("endgame")

/datum/universal_state/hell/proc/AreaSet()
	for(var/area/A in areas)
		if(!istype(A,/area) || A.name=="Space")
			continue

		// No cheating~
//		A.jammed=2

		// Reset all alarms.
		A.fire     = null
		A.atmos    = 1
		A.atmosalm = 0
		A.poweralm = 1
		A.party    = null

/*
		// Slap random alerts on shit
		if(prob(25))
			switch(rand(1,4))
				if(1)
					A.fire=1
				if(2)
					A.atmosalm=1
				if(3)
					A.radalert=1
				if(4)
					A.party=1
*/

		A.updateicon()

/datum/universal_state/hell/OverlayAndAmbientSet()
	for(var/turf/T in turfs)
		if(istype(T, /turf/space))
			T.overlays += "hell01"
		else
			T.underlays += "hell01"
	for(var/atom/movable/lighting_overlay/L in all_lighting_overlays)
		L.update_lumcount(0.5, 0, 0)

/datum/universal_state/hell/proc/MiscSet()
	for(var/turf/simulated/floor/T in turfs)
		if(prob(1))
			new /obj/effect/gateway/active/cult(T)

	for (var/obj/machinery/firealarm/alm in machines)
		if (!(alm.stat & BROKEN))
			alm.ex_act(2)

/datum/universal_state/hell/proc/APCSet()
	for (var/obj/machinery/power/apc/APC in machines)
		if (!(APC.stat & BROKEN) && !istype(APC.area,/area/turret_protected/ai))
			APC.chargemode = 0
			if(APC.cell)
				APC.cell.charge = 0
			APC.emagged = 1
			APC.locked = 0
			APC.queue_icon_update()

/datum/universal_state/hell/proc/KillMobs()
	for(var/mob/living/simple_animal/M in mob_list)
		if(M && !M.client)
			M.stat = DEAD


code:
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32

var/wordtravel = null
var/wordself = null
var/wordsee = null
var/wordhell = null
var/wordblood = null
var/wordjoin = null
var/wordtech = null
var/worddestr = null
var/wordother = null
//var/wordhear = null
//var/wordfree = null
var/wordhide = null
var/runedec = 0
var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", "self", "see", "other", "hide")

/client/proc/check_words() // -- Urist
	set category = "Special Verbs"
	set name = "Check Rune Words"
	set desc = "Check the rune-word meaning"
	if(!wordtravel)
		runerandom()
	usr << "[wordtravel] is travel, [wordblood] is blood, [wordjoin] is join, [wordhell] is Hell, [worddestr] is destroy, [wordtech] is technology, [wordself] is self, [wordsee] is see, [wordother] is other, [wordhide] is hide."

/mob/proc/cult_add_comm()
	verbs += /mob/living/proc/cult_innate_comm

/mob/living/proc/cult_innate_comm()
	set category = "Cultist"
	set name = "Communicate"

	if(!iscultist(usr))		//they shouldn't have this verb, but just to be sure...
		return

	if(usr.incapacitated())
		return	//dead men tell no tales

	var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
	if(!input)					// TO-DO: Add some kind of filter to corrupt the inputted text
		return

	if(ishuman(usr) || ismonkey(usr))	//Damage only applies to humans and monkeys, to allow constructs to communicate
		usr.visible_message("[usr.name] starts clawing at his arms like a mad man!")
		apply_damage(25,BRUTE, "l_arm")
		apply_damage(25,BRUTE, "r_arm")
		sleep(50)
		if(usr.incapacitated())
			return	//Hard to drawn intrinsic symbols when you're bleeding out in your cell.
		var/turf/location = loc
		if(istype(location, /turf/simulated))	// tearing your arms apart is going to spill a bit of blood, in fact thats the idea
			location.add_blood(usr)				// TO-DO change this to a badly drawn rune
		apply_damage(15,BRUTE, "l_arm")		// does a metric fuck ton of damage because this meant to be an emergency method of communication.
		apply_damage(15,BRUTE, "r_arm")
		if(usr.incapacitated())
			return
		usr.visible_message("[usr.name] paints strange symbols with their own blood")
		sleep(20)

	usr.say("O bidai nabora se[pick("'","`")]sma!")
	sleep(10)
	usr.say("[input]")
	for(var/mob/M in mob_list)
		if((M.mind && (M.mind in ticker.mode.cult)) || (M in dead_mob_list))
			M << "[input]"
	return

/proc/runerandom() //randomizes word meaning
	var/list/runewords=list("ire","ego","nahlizet","certum","veri","jatkaa","mgar","balaq", "karazet", "geeri") ///"orkan" and "allaq" removed.
	wordtravel=pick(runewords)
	runewords-=wordtravel
	wordself=pick(runewords)
	runewords-=wordself
	wordsee=pick(runewords)
	runewords-=wordsee
	wordhell=pick(runewords)
	runewords-=wordhell
	wordblood=pick(runewords)
	runewords-=wordblood
	wordjoin=pick(runewords)
	runewords-=wordjoin
	wordtech=pick(runewords)
	runewords-=wordtech
	worddestr=pick(runewords)
	runewords-=worddestr
	wordother=pick(runewords)
	runewords-=wordother
//	wordhear=pick(runewords)
//	runewords-=wordhear
//	wordfree=pick(runewords)
//	runewords-=wordfree
	wordhide=pick(runewords)
	runewords-=wordhide

/obj/effect/rune
	desc = "A strange collection of symbols drawn in blood."
	anchored = 1
	icon = 'icons/obj/rune.dmi'
	icon_state = "1"
	unacidable = 1
	layer = TURF_LAYER

	var/word1
	var/word2
	var/word3
// Places these combos are mentioned: this file - twice in the rune code, once in imbued tome, once in tome's HTML runes.dm - in the imbue rune code. If you change a combination - dont forget to change it everywhere.

// travel self [word] - Teleport to random [rune with word destination matching]
// travel other [word] - Portal to rune with word destination matching - kinda doesnt work. At least the icon. No idea why.
// see blood Hell - Create a new tome
// join blood self - Incorporate person over the rune into the group
// Hell join self - Summon TERROR
// destroy see technology - EMP rune
// travel blood self - Drain blood
// see Hell join - See invisible
// blood join Hell - Raise dead

// hide see blood - Hide nearby runes
// blood see hide - Reveal nearby runes  - The point of this rune is that its reversed obscure rune. So you always know the words to reveal the rune once oyu have obscured it.

// Hell travel self - Leave your body and ghost around
// blood see travel - Manifest a ghost into a mortal body
// Hell tech join - Imbue a rune into a talisman
// Hell blood join - Sacrifice rune
// destroy travel self - Wall rune
// join other self - Summon cultist rune
// travel technology other - Freeing rune    //    other blood travel was freedom join other

// hide other see - Deafening rune     //     was destroy see hear
// destroy see other - Blinding rune
// destroy see blood - BLOOD BOIL

// self other technology - Communication rune  //was other hear blood
// join hide technology - stun rune. Rune color: bright pink.
/obj/effect/rune/New()
	..()
	var/image/blood = image(loc = src)
	blood.override = 1
	for(var/mob/living/silicon/ai/AI in player_list)
		AI.client.images += blood

/obj/effect/rune/examine(mob/user)
	..()
	if(iscultist(user))
		user << "This spell circle reads: [word1] [word2] [word3]."

/obj/effect/rune/attackby(I as obj, user as mob, params)
	if(istype(I, /obj/item/weapon/tome) && iscultist(user))
		user << "You retrace your steps, carefully undoing the lines of the rune."
		qdel(src)
		return
	else if(istype(I, /obj/item/weapon/nullrod))
		user << "You disrupt the vile magic with the deadening field of the null rod!"
		qdel(src)
		return
	return

/obj/effect/rune/attack_hand(mob/living/user as mob)		// OH GOD this is horrible
	if(!iscultist(user))
		user << "You can't mouth the arcane scratchings without fumbling over them."
		return
	var/message = "You are unable to speak the words of the rune."
	if(!user.can_speak(message) && (user.mind && !user.mind.miming))
		user << message
		return
	if(!word1 || !word2 || !word3 || prob(user.getBrainLoss()))
		return fizzle(user)
	if(word1 == wordtravel && word2 == wordself)
		return teleport(src.word3)
	if(word1 == wordsee && word2 == wordblood && word3 == wordhell)
		return tomesummon()
	if(word1 == wordhell && word2 == worddestr && word3 == wordother)
		return armor()
	if(word1 == wordjoin && word2 == wordblood && word3 == wordself)
		return convert()
	if(word1 == wordhell && word2 == wordjoin && word3 == wordself)
		return tearreality()
	if(word1 == worddestr && word2 == wordsee && word3 == wordtech)
		return emp(src.loc,3)
	if(word1 == wordtravel && word2 == wordblood && word3 == wordself)
		return drain()
	if(word1 == wordsee && word2 == wordhell && word3 == wordjoin)
		return seer()
	if(word1 == wordblood && word2 == wordjoin && word3 == wordhell)
		return raise()
	if(word1 == wordhide && word2 == wordsee && word3 == wordblood)
		return obscure(4)
	if(word1 == wordhell && word2 == wordtravel && word3 == wordself)
		return ajourney()
	if(word1 == wordblood && word2 == wordsee && word3 == wordtravel)
		return manifest()
	if(word1 == wordhell && word2 == wordtech && word3 == wordjoin)
		return talisman()
	if(word1 == wordhell && word2 == wordblood && word3 == wordjoin)
		return sacrifice()
	if(word1 == wordblood && word2 == wordsee && word3 == wordhide)
		return revealrunes(src)
	if(word1 == worddestr && word2 == wordtravel && word3 == wordself)
		return wall()
	if(word1 == wordtravel && word2 == wordtech && word3 == wordother)
		return freedom()
	if(word1 == wordjoin && word2 == wordother && word3 == wordself)
		return cultsummon()
	if(word1 == wordhide && word2 == wordother && word3 == wordsee)
		return deafen()
	if(word1 == worddestr && word2 == wordsee && word3 == wordother)
		return blind()
	if(word1 == worddestr && word2 == wordsee && word3 == wordblood)
		return bloodboil()
	if(word1 == wordself && word2 == wordother && word3 == wordtech)
		return communicate()
	if(word1 == wordtravel && word2 == wordother)
		return itemport(src.word3)
	if(word1 == wordjoin && word2 == wordhide && word3 == wordtech)
		return runestun()
	if(word1 == wordtravel && word2 == wordhell && word3 == wordtech)
		return summon_shell()
	else
		user.take_overall_damage(30, 0)
		user << "You feel the life draining from you, as if Lord Nar-Sie is displeased with you."
		return fizzle(user)

/obj/effect/rune/proc/fizzle(var/mob/living/cultist = null)
	var/gibberish = pick("B'ADMINES SP'WNIN SH'T","IC'IN O'OC","RO'SHA'M I'SA GRI'FF'N ME'AI","TOX'IN'S O'NM FI'RAH","IA BL'AME TOX'IN'S","FIR'A NON'AN RE'SONA","A'OI I'RS ROUA'GE","LE'OAN JU'STA SP'A'C Z'EE SH'EF","IA PT'WOBEA'RD, IA A'DMI'NEH'LP")

	if(cultist)
		if(istype(src,/obj/effect/rune))
			cultist.say(gibberish)
		else
			cultist.whisper(gibberish)
	if(!src) //HOW COULD THIS HAPPEN
		return
	visible_message("The markings pulse with a small burst of light, then fall dark.", 3, "You hear a faint fizzle.", 2)
	return

/obj/effect/rune/proc/check_icon()
	src.color = rgb(255, 0, 0)
	if(word1 == wordtravel && word2 == wordself)
		icon_state = "2"
		src.color = rgb(0, 0, 255)
		return
	if(word1 == wordjoin && word2 == wordblood && word3 == wordself)
		icon_state = "3"
		return
	if(word1 == wordhell && word2 == wordjoin && word3 == wordself)
		icon_state = "4"
		return
	if(word1 == wordsee && word2 == wordblood && word3 == wordhell)
		icon_state = "5"
		src.color = rgb(0, 0 , 255)
		return
	if(word1 == worddestr && word2 == wordsee && word3 == wordtech)
		icon_state = "5"
		return
	if(word1 == wordtravel && word2 == wordblood && word3 == wordself)
		icon_state = "2"
		return
	if(word1 == wordsee && word2 == wordhell && word3 == wordjoin)
		icon_state = "4"
		src.color = rgb(0, 0 , 255)
		return
	if(word1 == wordblood && word2 == wordjoin && word3 == wordhell)
		icon_state = "1"
		return
	if(word1 == wordhide && word2 == wordsee && word3 == wordblood)
		icon_state = "1"
		src.color = rgb(0, 0 , 255)
		return
	if(word1 == wordhell && word2 == wordtravel && word3 == wordself)
		icon_state = "6"
		src.color = rgb(0, 0 , 255)
		return
	if(word1 == wordblood && word2 == wordsee && word3 == wordtravel)
		icon_state = "6"
		return
	if(word1 == wordhell && word2 == wordtech && word3 == wordjoin)
		icon_state = "3"
		src.color = rgb(0, 0 , 255)
		return
	if(word1 == wordhell && word2 == wordblood && word3 == wordjoin)
		icon_state = "[rand(1,6)]"
		src.color = rgb(255, 255, 255)
		return
	if(word1 == wordblood && word2 == wordsee && word3 == wordhide)
		icon_state = "4"
		src.color = rgb(255, 255, 255)
		return
	if(word1 == worddestr && word2 == wordtravel && word3 == wordself)
		icon_state = "1"
		src.color = rgb(255, 0, 0)
		return
	if(word1 == wordtravel && word2 == wordtech && word3 == wordother)
		icon_state = "4"
		src.color = rgb(255, 0, 255)
		return
	if(word1 == wordjoin && word2 == wordother && word3 == wordself)
		icon_state = "2"
		src.color = rgb(0, 255, 0)
		return
	if(word1 == wordhide && word2 == wordother && word3 == wordsee)
		icon_state = "4"
		src.color = rgb(0, 255, 0)
		return
	if(word1 == worddestr && word2 == wordsee && word3 == wordother)
		icon_state = "4"
		src.color = rgb(0, 0, 255)
		return
	if(word1 == worddestr && word2 == wordsee && word3 == wordblood)
		icon_state = "4"
		src.color = rgb(255, 0, 0)
		return
	if(word1 == wordself && word2 == wordother && word3 == wordtech)
		icon_state = "3"
		src.color = rgb(200, 0, 0)
		return
	if(word1 == wordtravel && word2 == wordother)
		icon_state = "1"
		src.color = rgb(200, 0, 0)
		return
	if(word1 == wordjoin && word2 == wordhide && word3 == wordtech)
		icon_state = "2"
		src.color = rgb(100, 0, 100)
		return
	icon_state="[rand(1,6)]" //random shape and color for dummy runes
	src.color = rgb(rand(1,255),rand(1,255),rand(1,255))

/obj/item/weapon/tome
	name = "arcane tome"
	desc = "An old, dusty tome with frayed edges and a sinister looking cover."
	icon_state ="tome"
	throw_speed = 2
	throw_range = 5
	w_class = 2.0
	var/notedat = ""
	var/list/words = list("ire" = "ire", "ego" = "ego", "nahlizet" = "nahlizet", "certum" = "certum", "veri" = "veri", "jatkaa" = "jatkaa", "balaq" = "balaq", "mgar" = "mgar", "karazet" = "karazet", "geeri" = "geeri")

var/TOMEDAT = ""

proc/update_tome()
	TOMEDAT = {"

The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood.

			The book is written in an unknown dialect, there are lots of pictures of various complex geometric shapes. You find some notes in english that give you basic understanding of the many runes written in the book. The notes give you an understanding what the words for the runes should be. However, you do not know how to write all these words in this dialect.

			Below is the summary of the runes.

Contents

			Teleport self: Travel Self (word)

			Teleport other ([ITEMPORT_CULTS]): Travel Other (word)

			Summon new tome: See Blood Hell

			Convert a person ([CONVERT_CULTS]): Join Blood Self

			Summon Nar-Sie ([ELDERGOD_CULTS]): Hell Join Self

			Disable technology: Destroy See Technology

			Drain blood: Travel Blood Self

			Raise dead: Blood Join Hell

			Hide runes: Hide See Blood

			Reveal hidden runes: Blood See Hide

			Leave your body: Hell travel self

			Ghost Manifest: Blood See Travel

			Imbue a talisman: Hell Technology Join

			Sacrifice ([SACRIFICE_CULTS]): Hell Blood Join

			Create a wall: Destroy Travel Self

			Summon cultist ([CULTSUMMON_CULTS]): Join Other Self

			Free a cultist ([FREEDOM_CULTS]): Travel technology other

			Deafen: Hide Other See

			Blind: Destroy See Other

			Blood Boil ([BLOODBOIL_CULTS]): Destroy See Blood

			Communicate: Self Other Technology

			Stun: Join Hide Technology

			Summon Cultist Armor: Hell Destroy Other

			See Invisible: See Hell Join

Rune Descriptions

Teleport self

			Teleport rune is a special rune, as it only needs two words, with the third word being destination. Basically, when you have two runes with the same destination, invoking one will teleport you to the other one. If there are more than 2 runes, you will be teleported to a random one. Runes with different third words will create separate networks. You can imbue this rune into a talisman, giving you a great escape mechanism.

Teleport other

			Teleport other allows for teleportation for any movable object to another rune with the same third word. Requires [ITEMPORT_CULTS] cultists.

Summon new tome

			Invoking this rune summons a new arcane tome.

Convert a person

			This rune opens target's mind to the realm of Nar-Sie, which usually results in this person joining the cult. However, some people (mostly the ones who posess high authority) have strong enough will to stay true to their old ideals. Requires [CONVERT_CULTS] cultists.

Summon Nar-Sie

			The ultimate rune. It summons the Avatar of Nar-Sie himself, tearing a huge hole in reality and consuming everything around it. Summoning it is the final goal of any cult. Requires [ELDERGOD_CULTS].

Disable Technology

			Invoking this rune creates a strong electromagnetic pulse in a small radius, making it basically analogic to an EMP grenade. You can imbue this rune into a talisman, making it a decent defensive item.

Drain Blood

			This rune instantly heals you of some brute damage at the expense of a person placed on top of the rune. Whenever you invoke a drain rune, ALL drain runes on the station are activated, draining blood from anyone located on top of those runes. This includes yourself, though the blood you drain from yourself just comes back to you. This might help you identify this rune when studying words. One drain gives up to 25HP per each victim, but you can repeat it if you need more. Draining only works on living people, so you might need to recharge your "Battery" once its empty. Drinking too much blood at once might cause blood hunger.

Raise Dead

			This rune allows for the resurrection of any dead person. You will need a dead human body and a living human sacrifice. Make 2 raise dead runes. Put a living non-braindead human on top of one, and a dead body on the other one. When you invoke the rune, the life force of the living human will be transferred into the dead body, allowing a ghost standing on top of the dead body to enter it, instantly and fully healing it. Use other runes to ensure there is a ghost ready to be resurrected.

Hide runes

			This rune makes all nearby runes completely invisible. They are still there and will work if activated somehow, but you cannot invoke them directly if you do not see them.

Reveal runes

			This rune is made to reverse the process of hiding a rune. It reveals all hidden runes in a rather large area around it.

Leave your body

			This rune gently rips your soul out of your body, leaving it intact. You can observe the surroundings as a ghost as well as communicate with other ghosts. Your body takes damage while you are there, so ensure your journey is not too long, or you might never come back.

Manifest a ghost

			Unlike the Raise Dead rune, this rune does not require any special preparations or vessels. Instead of using full lifeforce of a sacrifice, it will drain YOUR lifeforce. Stand on the rune and invoke it. If theres a ghost standing over the rune, it will materialise, and will live as long as you dont move off the rune or die. You can put a paper with a name on the rune to make the new body look like that person.

Imbue a talisman

			This rune allows you to imbue the magic of some runes into paper talismans. Create an imbue rune, then an appropriate rune beside it. Put an empty piece of paper on the imbue rune and invoke it. You will now have a one-use talisman with the power of the target rune. Using a talisman drains some health, so be careful with it. You can imbue a talisman with power of the following runes: summon tome, reveal, conceal, teleport, tisable technology, communicate, deafen, blind and stun.

Sacrifice

			Sacrifice rune allows you to sacrifice a living thing or a body to the Geometer of Blood. Monkeys and dead humans are the most basic sacrifices, they might or might not be enough to gain His favor. A living human is what a real sacrifice should be, however, you will need 3 people chanting the invocation to sacrifice a living person. Requires [SACRIFICE_CULTS] cultists.

Create a wall

			Invoking this rune solidifies the air above it, creating an an invisible wall. To remove the wall, simply invoke the rune again.

Summon cultist

			This rune allows you to summon a fellow cultist to your location. The target cultist must be unhandcuffed ant not buckled to anything. You also need to have 3 people chanting at the rune to successfully invoke it. Invoking it takes heavy strain on the bodies of all chanting cultists. Requires [CULTSUMMON_CULTS] cultists.

Free a cultist

			This rune unhandcuffs and unbuckles any cultist of your choice, no matter where he is. Invoking it takes heavy strain on the bodies of all chanting cultists. Requires [FREEDOM_CULTS] cultists.

Deafen

			This rune temporarily deafens all non-cultists around you.

Blind

			This rune temporarily blinds all non-cultists around you. Very robust. Use together with the deafen rune to leave your enemies completely helpless.

Blood boil

			This rune boils the blood all non-cultists in visible range. The damage is enough to instantly critically hurt any person. You need 3 cultists invoking the rune for it to work. This rune is unreliable and may cause unpredicted effect when invoked. It also drains significant amount of your health when successfully invoked. Requires [BLOODBOIL_CULTS] cultists to work.

Communicate

			Invoking this rune allows you to relay a message to all cultists on the station and nearby space objects.

Stun

			Unlike other runes, this ons is supposed to be used in talisman form. When invoked directly, it simply releases some dark energy, briefly stunning everyone around. When imbued into a talisman, you can force all of its energy into one person, stunning him so hard he cant even speak. However, effect wears off rather fast.

Equip Armor

			When this rune is invoked, either from a rune or a talisman, it will equip the user with the armor of the followers of Nar-Sie. To use this rune to its fullest extent, make sure you are not wearing any form of headgear, armor, gloves or shoes, and make sure you are not holding anything in your hands.

See Invisible

			When invoked when standing on it, this rune allows the user to see the the world beyond as long as he does not move.

			"}
update_tome()

/obj/item/weapon/tome/Topic(href,href_list[])
	if (src.loc == usr)
		var/number = text2num(href_list["number"])
		if (usr.stat|| usr.restrained())
			return
		switch(href_list["action"])
			if("clear")
				words[words[number]] = words[number]
			if("read")
				if(usr.get_active_hand() != src)
					return
				usr << browse("[TOMEDAT]", "window=Arcane Tome")
				return
			if("change")
				words[words[number]] = input("Enter the translation for [words[number]]", "Word notes") in engwords
				for (var/entry in words)
					if ((words[entry] == words[words[number]]) && (entry != words[number]))
						words[entry] = entry
		notedat = {"

Word translation notes

					[words[1]] is [words[words[1]]] Clear

					[words[2]] is [words[words[2]]] Clear

					[words[3]] is [words[words[3]]] Clear

					[words[4]] is [words[words[4]]] Clear

					[words[5]] is [words[words[5]]] Clear

					[words[6]] is [words[words[6]]] Clear

					[words[7]] is [words[words[7]]] Clear

					[words[8]] is [words[words[8]]] Clear

					[words[9]] is [words[words[9]]] Clear

					[words[10]] is [words[words[10]]] Clear

					"}
		usr << browse("[notedat]", "window=notes")
//	call(/obj/item/weapon/tome/proc/edit_notes)()
	else
		usr << browse(null, "window=notes")
		return

//	proc/edit_notes()     FUCK IT. Cant get it to work properly. - K0000
//		world << "its been called! [usr]"
//		notedat = {"
//
Word translation notes

//			[words[1]] is [words[words[1]]] Clear

//			[words[2]] is [words[words[2]]] Clear

//			[words[3]] is [words[words[3]]] Clear

//			[words[4]] is [words[words[4]]] Clear

//			[words[5]] is [words[words[5]]] Clear

//			[words[6]] is [words[words[6]]] Clear

//			[words[7]] is [words[words[7]]] Clear

//			[words[8]] is [words[words[8]]] Clear

//			[words[9]] is [words[words[9]]] Clear

//			[words[10]] is [words[words[10]]] Clear

//					"}
//		usr << "whatev"
//		usr << browse(null, "window=tank")

/obj/item/weapon/tome/attack(mob/living/M as mob, mob/living/user as mob)
	add_logs(user, M, "smacked", object=src)
	if(istype(M,/mob/dead))
		M.invisibility = 0
		user.visible_message( \
			"[user] drags the ghost to our plane of reality!", \
			"You drag the ghost to our plane of reality!" \
		)
		return
	if(!istype(M))
		return
	if(!iscultist(user))
		return ..()
	if(iscultist(M))
		if(M.reagents && M.reagents.has_reagent("holywater")) //allows cultists to be rescued from the clutches of ordained religion
			user << "You remove the taint from [M]."
			var/holy2unholy = M.reagents.get_reagent_amount("holywater")
			M.reagents.del_reagent("holywater")
			M.reagents.add_reagent("unholywater",holy2unholy)
		return
	M.take_organ_damage(0,rand(5,20)) //really lucky - 5 hits for a crit
	for(var/mob/O in viewers(M, null))
		O.show_message(text("[] beats [] with the arcane tome!", user, M), 1)
	M << "You feel searing heat inside!"

/obj/item/weapon/tome/attack_self(mob/living/user as mob)
	usr = user
	if(!usr.canmove || usr.stat || usr.restrained())
		return

	if(!wordtravel)
		runerandom()
	if(iscultist(user))
		var/C = 0
		for(var/obj/effect/rune/N in world)
			C++
		if (!istype(user.loc,/turf))
			user << "You do not have enough space to write a proper rune."
			return
		switch(alert("You open the tome",,"Commune","Scribe a rune", "Notes")) //Fuck the "Cancel" option. Rewrite the whole tome interface yourself if you want it to work better. And input() is just ugly. - K0000
			if("Cancel")
				return
			if("Commune")
				if(usr.get_active_hand() != src)
					return
				var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
				if(!input)
					return
				usr.whisper("O bidai nabora se[pick("'","`")]sma!")
				usr.whisper("[input]")
				for(var/datum/mind/H in ticker.mode.cult)
					if (H.current)
						H.current << "[input]"
				return
			if("Notes")
				if(usr.get_active_hand() != src)
					return
				notedat = {"
					Read the Arcane Tome.

Word translation notes

					[words[1]] is [words[words[1]]] Clear

					[words[2]] is [words[words[2]]] Clear

					[words[3]] is [words[words[3]]] Clear

					[words[4]] is [words[words[4]]] Clear

					[words[5]] is [words[words[5]]] Clear

					[words[6]] is [words[words[6]]] Clear

					[words[7]] is [words[words[7]]] Clear

					[words[8]] is [words[words[8]]] Clear

					[words[9]] is [words[words[9]]] Clear

					[words[10]] is [words[words[10]]] Clear

					"}	// whoever screwed the tabbing on this originally is an asshole.
//					call(/obj/item/weapon/tome/proc/edit_notes)()
				user << browse("[notedat]", "window=notes")
				return
			if("Scribe a rune")		//fixed more assbackward tabbing
				if(usr.get_active_hand() != src)
					return
				if (C>=26+runedec+ticker.mode.cult.len) //including the useless rune at the secret room, shouldn't count against the limit of 25 runes - Urist
					alert("The cloth of reality can't take that much of a strain. Remove some runes first!")
					return
				var/list/dictionary = list(
					"convert" = list("join","blood","self"),
					"wall" = list("destroy","travel","self"),
					"blood boil" = list("destroy","see","blood"),
					"blood drain" = list("travel","blood","self"),
					"raise dead" = list("blood","join","hell"),
					"summon narsie" = list("hell","join","self"),
					"communicate" = list("self","other","technology"),
					"emp" = list("destroy","see","technology"),
					"manifest" = list("blood","see","travel"),
					"summon tome" = list("see","blood","hell"),
					"see invisible" = list("see","hell","join"),
					"hide" = list("hide","see","blood"),
					"reveal" = list("blood","see","hide"),
					"astral journey" = list("hell","travel","self"),
					"imbue" = list("hell","technology","join"),
					"sacrifice" = list("hell","blood","join"),
					"summon cultist" = list("join","other","self"),
					"free cultist" = list("travel","technology","other"),
					"deafen" = list("hide","other","see"),
					"blind" = list("destroy","see","other"),
					"stun" = list("join","hide","technology"),
					"armor" = list("hell","destroy","other"),
					"teleport" = list("travel","self"),
					"teleport other" = list("travel","other"),
					"summon shell" = list("travel","hell","technology")
					)

				var/list/scribewords = list("none")

				var/list/english = list()

				for (var/entry in words)
					if (words[entry] != entry)
						english+=list(words[entry] = entry)

				for (var/entry in dictionary)
					var/list/required = dictionary[entry]
					if (length(english&required) == required.len)
						scribewords += entry

				var/chosen_rune = null

				if(usr)
					chosen_rune = input ("Choose a rune to scribe.") in scribewords
					if (!chosen_rune)
						return
					if (chosen_rune == "none")
						user << "You decide against scribing a rune, perhaps you should take this time to study your notes."
						return
					if (chosen_rune == "teleport")
						dictionary[chosen_rune] += input ("Choose a destination word") in english
					if (chosen_rune == "teleport other")
						dictionary[chosen_rune] += input ("Choose a destination word") in english

				if(user.get_active_hand() != src)
					return

				for (var/mob/V in viewers(src))
					V.show_message("[user] slices open a finger and begins to chant and paint symbols on the floor.", 3, "You hear chanting.", 2)
				user << "You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world."
				user.take_overall_damage((rand(9)+1)/10) // 0.1 to 1.0 damage
				if(do_after(user, 50))
					if(usr.get_active_hand() != src)
						return
					var/mob/living/carbon/human/H = user
					var/obj/effect/rune/R = new /obj/effect/rune(user.loc)
					user << "You finish drawing the arcane markings of the Geometer."
					var/list/required = dictionary[chosen_rune]
					R.word1 = english[required[1]]
					R.word2 = english[required[2]]
					R.word3 = english[required[3]]
					R.check_icon()
					R.blood_DNA = list()
					R.blood_DNA[H.dna.unique_enzymes] = H.dna.blood_type
				return
	else
		user << "The book seems full of illegible scribbles. Is this a joke?"
		return

/obj/item/weapon/tome/attackby(obj/item/weapon/tome/T as obj, mob/living/user as mob, params)
	if(istype(T, /obj/item/weapon/tome)) // sanity check to prevent a runtime error
		switch(alert("Copy the runes from your tome?",,"Copy", "Cancel"))
			if("cancel")
				return
	//	var/list/nearby = viewers(1,src) //- Fuck this as well. No clue why this doesnt work. -K0000
	//		if (T.loc != user)
	//			return
	//	for(var/mob/M in nearby)
	//		if(M == user)
		for(var/entry in words)
			words[entry] = T.words[entry]
		user << "You copy the translation notes from your tome."

/obj/item/weapon/tome/examine(mob/user)
	..()
	if(iscultist(user))
		user << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of."

/obj/item/weapon/tome/imbued //admin tome, spawns working runes without waiting
	w_class = 2.0
	var/cultistsonly = 1
	attack_self(mob/user as mob)
		if(src.cultistsonly && !iscultist(usr))
			return
		if(!wordtravel)
			runerandom()
		if(user)
			var/r
			if (!istype(user.loc,/turf))
				user << "You do not have enough space to write a proper rune."
			var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun", "summon shell")
			r = input("Choose a rune to scribe", "Rune Scribing") in runes //not cancellable.
			var/obj/effect/rune/R = new /obj/effect/rune
			if(istype(user, /mob/living/carbon/human))
				var/mob/living/carbon/human/H = user
				R.blood_DNA = list()
				R.blood_DNA[H.dna.unique_enzymes] = H.dna.blood_type
			switch(r)
				if("teleport")
					var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
					var/beacon
					if(usr)
						beacon = input("Select the last rune", "Rune Scribing") in words
					R.word1=wordtravel
					R.word2=wordself
					R.word3=beacon
					R.loc = user.loc
					R.check_icon()
				if("itemport")
					var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
					var/beacon
					if(usr)
						beacon = input("Select the last rune", "Rune Scribing") in words
					R.word1=wordtravel
					R.word2=wordother
					R.word3=beacon
					R.loc = user.loc
					R.check_icon()
				if("tome")
					R.word1=wordsee
					R.word2=wordblood
					R.word3=wordhell
					R.loc = user.loc
					R.check_icon()
				if("armor")
					R.word1=wordhell
					R.word2=worddestr
					R.word3=wordother
					R.loc = user.loc
					R.check_icon()
				if("convert")
					R.word1=wordjoin
					R.word2=wordblood
					R.word3=wordself
					R.loc = user.loc
					R.check_icon()
				if("tear in reality")
					R.word1=wordhell
					R.word2=wordjoin
					R.word3=wordself
					R.loc = user.loc
					R.check_icon()
				if("emp")
					R.word1=worddestr
					R.word2=wordsee
					R.word3=wordtech
					R.loc = user.loc
					R.check_icon()
				if("drain")
					R.word1=wordtravel
					R.word2=wordblood
					R.word3=wordself
					R.loc = user.loc
					R.check_icon()
				if("seer")
					R.word1=wordsee
					R.word2=wordhell
					R.word3=wordjoin
					R.loc = user.loc
					R.check_icon()
				if("raise")
					R.word1=wordblood
					R.word2=wordjoin
					R.word3=wordhell
					R.loc = user.loc
					R.check_icon()
				if("obscure")
					R.word1=wordhide
					R.word2=wordsee
					R.word3=wordblood
					R.loc = user.loc
					R.check_icon()
				if("astral journey")
					R.word1=wordhell
					R.word2=wordtravel
					R.word3=wordself
					R.loc = user.loc
					R.check_icon()
				if("manifest")
					R.word1=wordblood
					R.word2=wordsee
					R.word3=wordtravel
					R.loc = user.loc
					R.check_icon()
				if("imbue talisman")
					R.word1=wordhell
					R.word2=wordtech
					R.word3=wordjoin
					R.loc = user.loc
					R.check_icon()
				if("sacrifice")
					R.word1=wordhell
					R.word2=wordblood
					R.word3=wordjoin
					R.loc = user.loc
					R.check_icon()
				if("reveal")
					R.word1=wordblood
					R.word2=wordsee
					R.word3=wordhide
					R.loc = user.loc
					R.check_icon()
				if("wall")
					R.word1=worddestr
					R.word2=wordtravel
					R.word3=wordself
					R.loc = user.loc
					R.check_icon()
				if("freedom")
					R.word1=wordtravel
					R.word2=wordtech
					R.word3=wordother
					R.loc = user.loc
					R.check_icon()
				if("cultsummon")
					R.word1=wordjoin
					R.word2=wordother
					R.word3=wordself
					R.loc = user.loc
					R.check_icon()
				if("deafen")
					R.word1=wordhide
					R.word2=wordother
					R.word3=wordsee
					R.loc = user.loc
					R.check_icon()
				if("blind")
					R.word1=worddestr
					R.word2=wordsee
					R.word3=wordother
					R.loc = user.loc
					R.check_icon()
				if("bloodboil")
					R.word1=worddestr
					R.word2=wordsee
					R.word3=wordblood
					R.loc = user.loc
					R.check_icon()
				if("communicate")
					R.word1=wordself
					R.word2=wordother
					R.word3=wordtech
					R.loc = user.loc
					R.check_icon()
				if("stun")
					R.word1=wordjoin
					R.word2=wordhide
					R.word3=wordtech
					R.loc = user.loc
					R.check_icon()
				if("summon shell")
					R.word1=wordtravel
					R.word2=wordhell
					R.word3=wordtech
					R.loc = user.loc
					R.check_icon()