anchor.diff:  	name = "Holoparasite Guide"
   	icon_state = "alienpaper_words"
   	info = {"<b>A list of Holoparasite Types</b><br>
  -
    <br>
    <b>Chaos</b>: Ignites mobs on touch. teleports them at random on attack. Automatically extinguishes the user if they catch fire.<br>
    <br>
  
positive.code: /mob/living/simple_animal/hostile/guardian
  	name = "Guardian Spirit"
  	real_name = "Guardian Spirit"
  	desc = "A mysterious being that stands by it's charge, ever vigilant."
  	speak_emote = list("intones")
  	response_help  = "passes through"
  	response_disarm = "flails at"
  	response_harm   = "punches"
  	icon = 'icons/mob/mob.dmi'
  	icon_state = "stand"
  	icon_living = "stand"
  	speed = 0
  	a_intent = "harm"
  	stop_automated_movement = 1
  	floating = 1
  	attack_sound = 'sound/weapons/punch1.ogg'
  	atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
  	minbodytemp = 0
  	maxbodytemp = INFINITY
  	attacktext = "punches"
  	maxHealth = INFINITY //The spirit itself is invincible
  	health = INFINITY
  	environment_smash = 0
  	melee_damage_lower = 15
  	melee_damage_upper = 15
  	butcher_results = list(/obj/item/weapon/ectoplasm = 1)
  	AIStatus = AI_OFF
  	var/animated_manifest = FALSE
  	var/cooldown = 0
  	var/damage_transfer = 1 //how much damage from each attack we transfer to the owner
  	var/mob/living/summoner
  	var/range = 10 //how far from the user the spirit can be
  	var/playstyle_string = "You are a standard Guardian. You shouldn't exist!"
  	var/magic_fluff_string = " You draw the Coder, symbolizing bugs and errors. This shouldn't happen! Submit a bug report!"
  	var/tech_fluff_string = "BOOT SEQUENCE COMPLETE. ERROR MODULE LOADED. THIS SHOULDN'T HAPPEN. Submit a bug report!"
  	var/bio_fluff_string = "Your scarabs fail to mutate. This shouldn't happen! Submit a bug report!"
  
  /mob/living/simple_animal/hostile/guardian/Life() //Dies if the summoner dies
  	..()
  	if(summoner)
  		if(summoner.stat == DEAD)
  			src << "<span class='danger'>Your summoner has died!</span>"
  			visible_message("<span class='danger'><B>The [src] dies along with its user!</B></span>")
  			summoner.visible_message("<span class='danger'><B>[summoner]'s body is completely consumed by the strain of sustaining [src]!</B></span>")
  			for(var/obj/item/W in summoner)
  				if(!summoner.unEquip(W))
  					qdel(W)
  			summoner.dust()
  			ghostize()
  			qdel(src)
  	else
  		src << "<span class='danger'>Your summoner has died!</span>"
  		visible_message("<span class='danger'><B>The [src] dies along with its user!</B></span>")
  		ghostize()
  		qdel(src)
  	if(summoner)
  		if (get_dist(get_turf(summoner),get_turf(src)) <= range)
  			return
  		else
  			src << "You moved out of range, and were pulled back! You can only move [range] meters from [summoner.real_name]"
  			visible_message("<span class='danger'>The [src] jumps back to its user.</span>")
  			loc = get_turf(summoner)
  
  /mob/living/simple_animal/hostile/guardian/Move() //Returns to summoner if they move out of range
  	..()
  	if(summoner)
  		if (get_dist(get_turf(summoner),get_turf(src)) <= range)
  			return
  		else
  			src << "You moved out of range, and were pulled back! You can only move [range] meters from [summoner.real_name]"
  			visible_message("<span class='danger'>The [src] jumps back to its user.</span>")
  			loc = get_turf(summoner)
  
  
  /mob/living/simple_animal/hostile/guardian/adjustCloneLoss(amount) //The spirit is invincible, but passes on damage to the summoner
  	var/damage = amount * damage_transfer
  	if (summoner)
  		if(loc == summoner)
  			return
  		summoner.adjustCloneLoss(damage)
  		if(damage)
  			summoner << "<span class='danger'><B>Your [name] is under attack! You feel weaker!</span></B>"
  			summoner.visible_message("<span class='danger'><B>[summoner] weakens as [src] takes damage!</B></span>")
  		if(summoner.stat == UNCONSCIOUS)
  			summoner << "<span class='danger'><B>Your body can't take the strain of sustaining [src] in this condition, it begins to fall apart!</span></B>"
  			summoner.adjustCloneLoss(damage/2) //50% extra damage while in crit
  
  /mob/living/simple_animal/hostile/guardian/ex_act(severity, target)
  	switch (severity)
  		if (1)
  			gib()
  			return
  		if (2)
  			adjustCloneLoss(60)
  
  		if(3)
  			adjustCloneLoss(30)
  
  /mob/living/simple_animal/hostile/guardian/gib()
  	if(summoner)
  		summoner << "<span class='danger'><B>Your [src] was blown up!</span></B>"
  		summoner.gib()
  	ghostize()
  	qdel(src)
  
  //Manifest, Recall, Communicate
  
  /mob/living/simple_animal/hostile/guardian/proc/Manifest()
  	if(cooldown > world.time)
  		return
  	if(loc == summoner)
  		loc = get_turf(summoner)
  		cooldown = world.time + 30
  		if(animated_manifest)
  			var/end_icon = icon_state
  			icon_state = "parasite_forming"
  			spawn(6)
  			icon_state = end_icon
  
  /mob/living/simple_animal/hostile/guardian/proc/Recall()
  	if(cooldown > world.time)
  		return
  	loc = summoner
  	buckled = null
  	cooldown = world.time + 30
  
  /mob/living/simple_animal/hostile/guardian/proc/Communicate()
  	var/input = stripped_input(src, "Please enter a message to tell your summoner.", "Guardian", "")
  	if(!input) return
  
  	for(var/mob/M in mob_list)
  		if(M == summoner || (M in dead_mob_list))
  			M << "<span class='boldannounce'><i>[src]:</i> [input]</span>"
  	src << "<span class='boldannounce'><i>[src]:</i> [input]</span>"
  	log_say("[src.real_name]/[src.key] : [input]")
  
  /mob/living/simple_animal/hostile/guardian/proc/ToggleMode()
  	src << "<span class='danger'><B>You dont have another mode!</span></B>"
  
  
  /mob/living/proc/guardian_comm()
  	set name = "Communicate"
  	set category = "Guardian"
  	set desc = "Communicate telepathically with your guardian."
  	var/input = stripped_input(src, "Please enter a message to tell your guardian.", "Message", "")
  	if(!input) return
  
  	for(var/mob/M in mob_list)
  		if(istype (M, /mob/living/simple_animal/hostile/guardian))
  			var/mob/living/simple_animal/hostile/guardian/G = M
  			if(G.summoner == src)
  				G << "<span class='boldannounce'><i>[src]:</i> [input]</span>"
  		else if (M in dead_mob_list)
  			M << "<span class='boldannounce'><i>[src]:</i> [input]</span>"
  	src << "<span class='boldannounce'><i>[src]:</i> [input]</span>"
  	log_say("[src.real_name]/[src.key] : [text]")
  
  
  /mob/living/proc/guardian_recall()
  	set name = "Recall Guardian"
  	set category = "Guardian"
  	set desc = "Forcibly recall your guardian."
  	for(var/mob/living/simple_animal/hostile/guardian/G in mob_list)
  		if(G.summoner == src)
  			G.Recall()
  
  /mob/living/proc/guardian_reset()
  	set name = "Reset Guardian Player (One Use)"
  	set category = "Guardian"
  	set desc = "Re-rolls which ghost will control your Guardian. One use."
  	for(var/mob/living/simple_animal/hostile/guardian/G in mob_list)
  		if(G.summoner == src)
  			var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as [G.real_name]?", "pAI", null, FALSE, 100)
  			var/mob/dead/observer/new_stand = null
  			if(candidates.len)
  				new_stand = pick(candidates)
  				G << "Your user reset you, and your body was taken over by a ghost. Looks like they weren't happy with your performance."
  				src << "Your guardian has been successfully reset."
  				message_admins("[key_name_admin(new_stand)] has taken control of ([key_name_admin(G)])")
  				G.ghostize()
  				G.key = new_stand.key
  				src.verbs -= /mob/living/proc/guardian_reset
  			else
  				src << "There were no ghosts willing to take control. Looks like you're stuck with your Guardian for now."
  
  /mob/living/simple_animal/hostile/guardian/proc/ToggleLight()
  	if(!luminosity)
  		SetLuminosity(3)
  	else
  		SetLuminosity(0)
  
  
  //////////////////////////TYPES OF GUARDIANS
  
  
  //Fire. Low damage, low resistance, sets mobs on fire when bumping
  
  /mob/living/simple_animal/hostile/guardian/fire
  	a_intent = "help"
  	melee_damage_lower = 10
  	melee_damage_upper = 10
  	attack_sound = 'sound/items/Welder.ogg'
  	attacktext = "sears"
  	damage_transfer = 0.8
  	range = 10
  	playstyle_string = "As a Chaos type, you have only light damage resistance, but will ignite any enemy you bump into. In addition, your melee attacks will randomly teleport enemies."
  	environment_smash = 1
  	magic_fluff_string = "..And draw the Wizard, bringer of endless chaos!"
  	tech_fluff_string = "Boot sequence complete. Crowd control modules activated. Holoparasite swarm online."
  	bio_fluff_string = "Your scarab swarm finishes mutating and stirs to life, ready to sow havoc at random."
  
  /mob/living/simple_animal/hostile/guardian/fire/Life() //Dies if the summoner dies
  	..()
  	if(summoner)
  		summoner.ExtinguishMob()
  		summoner.adjust_fire_stacks(-20)
  
  /mob/living/simple_animal/hostile/guardian/fire/AttackingTarget()
  	..()
  	if(prob(45))
  		if(istype(target, /atom/movable))
  			var/atom/movable/M = target
  			if(!M.anchored && M != summoner)
  				do_teleport(M, M, 10)
  
  /mob/living/simple_animal/hostile/guardian/fire/Crossed(AM as mob|obj)
  	..()
  	collision_ignite(AM)
  
  /mob/living/simple_animal/hostile/guardian/fire/Bumped(AM as mob|obj)
  	..()
  	collision_ignite(AM)
  
  /mob/living/simple_animal/hostile/guardian/fire/Bump(AM as mob|obj)
  	..()
  	collision_ignite(AM)
  
  /mob/living/simple_animal/hostile/guardian/fire/proc/collision_ignite(AM as mob|obj)
  	if(istype(AM, /mob/living/))
  		var/mob/living/M = AM
  		if(AM != summoner && M.fire_stacks < 7)
  			M.fire_stacks = 7
  			M.IgniteMob()
  
  /mob/living/simple_animal/hostile/guardian/fire/Bump(AM as mob|obj)
  	..()
  	collision_ignite(AM)
  //Standard
  
  /mob/living/simple_animal/hostile/guardian/punch
  	melee_damage_lower = 20
  	melee_damage_upper = 20
  	damage_transfer = 0.5
  	playstyle_string = "As a standard type you have no special abilities, but have a high damage resistance and a powerful attack capable of smashing through walls."
  	environment_smash = 2
  	magic_fluff_string = "..And draw the Assistant, faceless and generic, but never to be underestimated."
  	tech_fluff_string = "Boot sequence complete. Standard combat modules loaded. Holoparasite swarm online."
  	bio_fluff_string = "Your scarab swarm stirs to life, ready to tear apart your enemies."
  	var/battlecry = "AT"
  
  /mob/living/simple_animal/hostile/guardian/punch/verb/Battlecry()
  	set name = "Set Battlecry"
  	set category = "Guardian"
  	set desc = "Choose what you shout as you punch"
  	var/input = stripped_input(src,"What do you want your battlecry to be? Max length of 5 characters.", ,"", 6)
  	if(input)
  		battlecry = input
  
  
  
  /mob/living/simple_animal/hostile/guardian/punch/AttackingTarget()
  	..()
  	if(istype(target, /mob/living))
  		src.say("[src.battlecry][src.battlecry][src.battlecry][src.battlecry][src.battlecry][src.battlecry][src.battlecry][src.battlecry][src.battlecry][src.battlecry]\
  		[src.battlecry][src.battlecry][src.battlecry][src.battlecry][src.battlecry]")
  		playsound(loc, src.attack_sound, 50, 1, 1)
  		playsound(loc, src.attack_sound, 50, 1, 1)
  		playsound(loc, src.attack_sound, 50, 1, 1)
  		playsound(loc, src.attack_sound, 50, 1, 1)
  
  //Healer
  
  /mob/living/simple_animal/hostile/guardian/healer
  	a_intent = "harm"
  	friendly = "heals"
  	speed = 0
  	melee_damage_lower = 15
  	melee_damage_upper = 15
  	playstyle_string = "As a Support type, you may toggle your basic attacks to a healing mode. In addition, Alt-Clicking on an adjacent mob will warp them to your bluespace beacon after a short delay."
  	magic_fluff_string = "..And draw the CMO, a potent force of life...and death."
  	tech_fluff_string = "Boot sequence complete. Medical modules active. Bluespace modules activated. Holoparasite swarm online."
  	bio_fluff_string = "Your scarab swarm finishes mutating and stirs to life, capable of mending wounds and travelling via bluespace."
  	var/turf/simulated/floor/beacon
  	var/beacon_cooldown = 0
  	var/toggle = FALSE
  
  /mob/living/simple_animal/hostile/guardian/healer/New()
  	..()
  	var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED]
  	medsensor.add_hud_to(src)
  
  /mob/living/simple_animal/hostile/guardian/healer/AttackingTarget()
  	..()
  	if(toggle == TRUE)
  		if(src.loc == summoner)
  			src << "<span class='danger'><B>You must be manifested to heal!</span></B>"
  			return
  		if(iscarbon(target))
  			var/mob/living/carbon/C = target
  			C.adjustBruteLoss(-5)
  			C.adjustFireLoss(-5)
  			C.adjustOxyLoss(-5)
  			C.adjustToxLoss(-5)
  			C.adjustCloneLoss(-5)
  
  /mob/living/simple_animal/hostile/guardian/healer/ToggleMode()
  	if(src.loc == summoner)
  		if(toggle)
  			a_intent = "harm"
  			speed = 0
  			damage_transfer = 0.7
  			melee_damage_lower = 15
  			melee_damage_upper = 15
  			src << "<span class='danger'><B>You switch to combat mode.</span></B>"
  			toggle = FALSE
  		else
  			a_intent = "help"
  			speed = 1
  			damage_transfer = 1
  			melee_damage_lower = 0
  			melee_damage_upper = 0
  			src << "<span class='danger'><B>You switch to healing mode.</span></B>"
  			toggle = TRUE
  	else
  		src << "<span class='danger'><B>You have to be recalled to toggle modes!</span></B>"
  
  
  /mob/living/simple_animal/hostile/guardian/healer/verb/Beacon()
  	set name = "Place Bluespsace Beacon"
  	set category = "Guardian"
  	set desc = "Mark a floor as your beacon point, allowing you to warp targets to it. Your beacon will not work in unfavorable atmospheric conditions."
  	if(beacon_cooldown<world.time)
  		var/turf/beacon_loc = get_turf(src.loc)
  		if(istype(beacon_loc, /turf/simulated/floor))
  			var/turf/simulated/floor/F = beacon_loc
  			F.icon = 'icons/turf/floors.dmi'
  			F.name = "bluespace recieving pad"
  			F.desc = "A recieving zone for bluespace teleportations. Building a wall over it should disable it."
  			F.icon_state = "light_on-w"
  			src << "<span class='danger'><B>Beacon placed! You may now warp targets to it, including your user, via Alt+Click. </span></B>"
  			if(beacon)
  				beacon.ChangeTurf(/turf/simulated/floor/plating)
  			beacon = F
  			beacon_cooldown = world.time+3000
  
  	else
  		src << "<span class='danger'><B>Your power is on cooldown. You must wait five minutes between placing beacons.</span></B>"
  
  /mob/living/simple_animal/hostile/guardian/healer/AltClickOn(atom/movable/A)
  	if(!istype(A))
  		return
  	if(src.loc == summoner)
  		src << "<span class='danger'><B>You must be manifested to warp a target!</span></B>"
  		return
  	if(!beacon)
  		src << "<span class='danger'><B>You need a beacon placed to warp things!</span></B>"
  		return
  	if(!Adjacent(A))
  		src << "<span class='danger'><B>You must be adjacent to your target!</span></B>"
  		return
  	if((A.anchored))
  		src << "<span class='danger'><B>Your target can not be anchored!</span></B>"
  		return
  	src << "<span class='danger'><B>You begin to warp [A]</span></B>"
  	if(do_mob(src, A, 50))
  		if(!A.anchored)
  			if(src.beacon) //Check that the beacon still exists and is in a safe place. No instant kills.
  				if(beacon.air)
  					var/datum/gas_mixture/Z = beacon.air
  					if(Z.oxygen >= 16 && !Z.toxins && Z.carbon_dioxide < 10 && !Z.trace_gases.len)
  						if((Z.temperature > 270) && (Z.temperature < 360))
  							var/pressure = Z.return_pressure()
  							if((pressure > 20) && (pressure < 550))
  								do_teleport(A, beacon, 0)
  						else
  							src << "<span class='danger'><B>The beacon isn't in a safe location!</span></B>"
  					else
  						src << "<span class='danger'><B>The beacon isn't in a safe location!</span></B>"
  			else
  				src << "<span class='danger'><B>You need a beacon to warp things!</span></B>"
  	else
  		src << "<span class='danger'><B>You need to hold still!</span></B>"
  
  
  ///////////////////Ranged
  
  /obj/item/projectile/guardian
  	name = "crystal spray"
  	icon_state = "guardian"
  	damage = 5
  	damage_type = BRUTE
  	armour_penetration = 100
  
  /mob/living/simple_animal/hostile/guardian/ranged
  	a_intent = "help"
  	friendly = "quietly assesses"
  	melee_damage_lower = 10
  	melee_damage_upper = 10
  	damage_transfer = 0.9
  	projectiletype = /obj/item/projectile/guardian
  	ranged_cooldown_cap = 0
  	projectilesound = 'sound/effects/hit_on_shattered_glass.ogg'
  
negative.code: 			G.real_name = "[mob_name] [capitalize(colour)]"
  			G.icon_living = "parasite[colour]"
  			G.icon_state = "parasite[colour]"
  			G.icon_dead = "parasite[colour]"
  			G.animated_manifest = TRUE
  			user << "[G.tech_fluff_string]."
  			G.speak_emote = list("states")
  