anchor.diff:  	..()
   
   /obj/machinery/porta_turret/ex_act(severity)
  -	if(severity >= 3) // turret dies if an explosion touches it!
  +	if(severity >= 3)	//turret dies if an explosion touches it!
   		del(src)
   	else
  -		src.die()
  -
  -/obj/machinery/porta_turret/proc/die() // called when the turret dies, ie, health <= 0
  -	src.health = 0
  -	src.density = 0
  -	src.stat |= BROKEN // enables the BROKEN bit
  -	src.icon_state = "[lasercolor]destroyed_target_prism"
  -	invisibility=0
  -	src.spark_system.start() // creates some sparks because they look cool
  -	src.density=1
  -	del(cover) // deletes the cover - no need on keeping it there!
  +		die()
  +
  +/obj/machinery/porta_turret/proc/die()	//called when the turret dies, ie, health <= 0
  +	health = 0
  +	density = 0
  +	stat |= BROKEN	//enables the BROKEN bit
  +	icon_state = "[lasercolor]destroyed_target_prism"
  +	invisibility = 0
  +	spark_system.start()	//creates some sparks because they look cool
  +	density = 1
  +	del(cover)	//deletes the cover - no need on keeping it there!
   
   
   
   /obj/machinery/porta_turret/process()
  -	// the main machinery process
  +	//the main machinery process
   
   	set background = 1
   
  -	if(src.cover==null && anchored) // if it has no cover and is anchored
  -		if (stat & BROKEN) // if the turret is borked
  -			del(cover) // delete its cover, assuming it has one. Workaround for a pesky little bug
  +	if(cover == null && anchored)	//if it has no cover and is anchored
  +		if(stat & BROKEN)	//if the turret is borked
  +			del(cover)	//delete its cover, assuming it has one. Workaround for a pesky little bug
   		else
   
  -			src.cover = new /obj/machinery/porta_turret_cover(src.loc) // if the turret has no cover and is anchored, give it a cover
  -			src.cover.Parent_Turret = src // assign the cover its Parent_Turret, which would be this (src)
  +			cover = new /obj/machinery/porta_turret_cover(loc)	//if the turret has no cover and is anchored, give it a cover
  +			cover.Parent_Turret = src	//assign the cover its Parent_Turret, which would be this (src)
   
   	if(stat & (NOPOWER|BROKEN))
  -		// if the turret has no power or is broken, make the turret pop down if it hasn't already
  +		//if the turret has no power or is broken, make the turret pop down if it hasn't already
   		popDown()
   		return
   
   	if(!on)
  -		// if the turret is off, make it pop down
  +		//if the turret is off, make it pop down
   		popDown()
   		return
   
  -	var/list/targets = list()		   // list of primary targets
  -	var/list/secondarytargets = list() // targets that are least important
  -
  -	if(src.check_anomalies) // if its set to check for xenos/carps, check for non-mob "crittersssss"(And simple_animals)
  -		for(var/mob/living/simple_animal/C in view(7,src))
  +	var/list/targets = list()			//list of primary targets
  +	var/list/secondarytargets = list()	//targets that are least important
  +
  +	if(check_anomalies)	//if its set to check for xenos/carps, check for non-mob "crittersssss"(And simple_animals)
  +		for(var/mob/living/simple_animal/C in view(7, src))
   			if(!C.stat)
   				targets += C
   
  -	for (var/mob/living/carbon/C in view(7,src)) // loops through all living carbon-based lifeforms in view(12)
  -		if(istype(C, /mob/living/carbon/alien) && src.check_anomalies) // git those fukken xenos
  -			if(!C.stat) // if it's dead/dying, there's no need to keep shooting at it.
  +	for(var/mob/living/carbon/C in view(7,src))	//loops through all living carbon-based lifeforms in view(12)
  +		if(istype(C, /mob/living/carbon/alien) && check_anomalies) //git those fukken xenos
  +			if(!C.stat)	//if it's dead/dying, there's no need to keep shooting at it.
   				targets += C
   
   		else
  -			if(emagged) // if emagged, HOLY SHIT EVERYONE IS DANGEROUS beep boop beep
  +			if(emagged)	//if emagged, HOLY SHIT EVERYONE IS DANGEROUS beep boop beep
   				targets += C
   			else
  -				if (C.stat || C.handcuffed) // if the perp is handcuffed or dead/dying, no need to bother really
  -					continue // move onto next potential victim!
  -
  -				var/dst = get_dist(src, C) // if it's too far away, why bother?
  -				if (dst > 7)
  +				if(C.stat || C.handcuffed)	//if the perp is handcuffed or dead/dying, no need to bother really
  +					continue				//move onto next potential victim!
  +
  +				var/dst = get_dist(src, C)	//if it's too far away, why bother?
  +				if(dst > 7)
   					continue
   
  -				if(ai) // If it's set to attack all nonsilicons, target them!
  +				if(ai)	//If it's set to attack all nonsilicons, target them!
   					if(C.lying)
   						if(lasercolor)
   							continue
  
positive.code: 
  
  		if(3)
  			if(istype(W, /obj/item/weapon/gun/energy)) // the gun installation part
  
  				if(isrobot(user))	return
  				var/obj/item/weapon/gun/energy/E = W // typecasts the item to an energy gun
  				installation = W.type // installation becomes W.type
  				gun_charge = E.power_supply.charge // the gun's charge is stored in src.gun_charge
  				user << "\blue You add \the [W] to the turret."
  				build_step = 4
  				del(W) // delete the gun :(
  				return
  
  			else if(istype(W, /obj/item/weapon/wrench))
  				playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
  				user << "You remove the turret's metal armor bolts."
  				build_step = 2
  				return
  
  		if(4)
  			if(isprox(W))
  				build_step = 5
  				user << "\blue You add the prox sensor to the turret."
  				del(W)
  				return
  
  			// attack_hand() removes the gun
  
  		if(5)
  			if(istype(W, /obj/item/weapon/screwdriver))
  				playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
  				build_step = 6
  				user << "\blue You close the internal access hatch."
  				return
  
  			// attack_hand() removes the prox sensor
  
  		if(6)
  			if(istype(W, /obj/item/stack/sheet/metal))
  				if(W:amount>=2)
  					user << "\blue You add some metal armor to the exterior frame."
  					build_step = 7
  					W:amount -= 2
  					if(W:amount <= 0)
  						del(W)
  					return
  
  			else if(istype(W, /obj/item/weapon/screwdriver))
  				playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
  				build_step = 5
  				user << "You open the internal access hatch."
  				return
  
  		if(7)
  			if(istype(W, /obj/item/weapon/weldingtool))
  				var/obj/item/weapon/weldingtool/WT = W
  				if(!WT.isOn()) return
  				if (WT.get_fuel() < 5)
  					user << "\red You need more fuel to complete this task."
  
  				playsound(src.loc, pick('sound/items/Welder.ogg', 'sound/items/Welder2.ogg'), 50, 1)
  				if(do_after(user, 30))
  					if(!src || !WT.remove_fuel(5, user)) return
  					build_step = 8
  					user << "\blue You weld the turret's armor down."
  
  					// The final step: create a full turret
  					var/obj/machinery/porta_turret/Turret = new/obj/machinery/porta_turret(locate(x,y,z))
  					Turret.name = finish_name
  					Turret.installation = src.installation
  					Turret.gun_charge = src.gun_charge
  
  //					Turret.cover=new/obj/machinery/porta_turret_cover(src.loc)
  //					Turret.cover.Parent_Turret=Turret
  //					Turret.cover.name = finish_name
  					Turret.New()
  					del(src)
  
  			else if(istype(W, /obj/item/weapon/crowbar))
  				playsound(src.loc, 'sound/items/Crowbar.ogg', 75, 1)
  				user << "You pry off the turret's exterior armor."
  				new /obj/item/stack/sheet/metal( loc, 2)
  				build_step = 6
  				return
  
  	if (istype(W, /obj/item/weapon/pen)) // you can rename turrets like bots!
  		var/t = input(user, "Enter new turret name", src.name, src.finish_name) as text
  		t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
  		if (!t)
  			return
  		if (!in_range(src, usr) && src.loc != usr)
  			return
  
  		src.finish_name = t
  		return
  	..()
  
  
  
  /obj/machinery/porta_turret_construct/attack_hand(mob/user as mob)
  	switch(build_step)
  		if(4)
  			if(!installation) return
  			build_step = 3
  
  			var/obj/item/weapon/gun/energy/Gun = new installation(src.loc)
  			Gun.power_supply.charge=gun_charge
  			Gun.update_icon()
  			installation = null
  			gun_charge = 0
  			user << "You remove \the [Gun] from the turret frame."
  
  		if(5)
  			user << "You remove the prox sensor from the turret frame."
  			new/obj/item/device/assembly/prox_sensor(locate(x,y,z))
  			build_step = 4
  
  
  
  
  
  
  
  
  
  
  
  
  /obj/machinery/porta_turret_cover
  	name = "turret"
  
negative.code: 		..()
  
  
  /obj/machinery/porta_turret/bullet_act(obj/item/projectile/Proj)
  	if(on)
  		if(!attacked && !emagged)
  			attacked = 1
  