anchor.diff:  
   	user << browse("<HEAD><TITLE>Automatic Portable Turret Installation</TITLE></HEAD>[dat]", "window=autosec")
   	onclose(user, "autosec")
  -	return
  -
  -/obj/machinery/porta_turret_cover/attack_hand(mob/user as mob)
  +
  +
  +/obj/machinery/porta_turret_cover/attack_hand(mob/user)
   	. = ..()
  -	if (.)
  +	if(.)
   		return
   	var/dat
  -	if(!(Parent_Turret.lasercolor))
  +	if(!Parent_Turret.lasercolor)
   		dat += text({"
  -<TT><B>Automatic Portable Turret Installation</B></TT><BR><BR>
  -Status: []<BR>
  -Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"},
  -
  -"<A href='?src=\ref[src];power=1'>[Parent_Turret.on ? "On" : "Off"]</A>" )
  +					<TT><B>Automatic Portable Turret Installation</B></TT><BR><BR>
  +					Status: []<BR>
  +					Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"},
  +
  +					"<A href='?src=\ref[src];power=1'>[Parent_Turret.on ? "On" : "Off"]</A>" )
   
   		if(!Parent_Turret.locked)
   			dat += text({"<BR>
  -Check for Weapon Authorization: []<BR>
  -Check Security Records: []<BR>
  -Neutralize Identified Criminals: []<BR>
  -Neutralize All Non-Security and Non-Command Personnel: []<BR>
  -Neutralize All Unidentified Life Signs: []<BR>"},
  -
  -"<A href='?src=\ref[src];operation=authweapon'>[Parent_Turret.auth_weapons ? "Yes" : "No"]</A>",
  -"<A href='?src=\ref[src];operation=checkrecords'>[Parent_Turret.check_records ? "Yes" : "No"]</A>",
  -"<A href='?src=\ref[src];operation=shootcrooks'>[Parent_Turret.criminals ? "Yes" : "No"]</A>",
  -"<A href='?src=\ref[src];operation=shootall'>[Parent_Turret.stun_all ? "Yes" : "No"]</A>" ,
  -"<A href='?src=\ref[src];operation=checkxenos'>[Parent_Turret.check_anomalies ? "Yes" : "No"]</A>" )
  +						Check for Weapon Authorization: []<BR>
  +						Check Security Records: []<BR>
  +						Neutralize Identified Criminals: []<BR>
  +						Neutralize All Non-Security and Non-Command Personnel: []<BR>
  +						Neutralize All Unidentified Life Signs: []<BR>"},
  +
  +						"<A href='?src=\ref[src];operation=authweapon'>[Parent_Turret.auth_weapons ? "Yes" : "No"]</A>",
  +						"<A href='?src=\ref[src];operation=checkrecords'>[Parent_Turret.check_records ? "Yes" : "No"]</A>",
  +						"<A href='?src=\ref[src];operation=shootcrooks'>[Parent_Turret.criminals ? "Yes" : "No"]</A>",
  +						"<A href='?src=\ref[src];operation=shootall'>[Parent_Turret.stun_all ? "Yes" : "No"]</A>" ,
  +						"<A href='?src=\ref[src];operation=checkxenos'>[Parent_Turret.check_anomalies ? "Yes" : "No"]</A>" )
   	else
   		if(istype(user,/mob/living/carbon/human))
   			var/mob/living/carbon/human/H = user
  -			if(((Parent_Turret.lasercolor) == "b") && (istype(H.wear_suit, /obj/item/clothing/suit/redtag)))
  -				return
  -			if(((Parent_Turret.lasercolor) == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag)))
  +			if(Parent_Turret.lasercolor == "b" && istype(H.wear_suit, /obj/item/clothing/suit/redtag))
  +				return
  +			if(Parent_Turret.lasercolor == "r" && istype(H.wear_suit, /obj/item/clothing/suit/bluetag))
   				return
   		dat += text({"
  -<TT><B>Automatic Portable Turret Installation</B></TT><BR><BR>
  -Status: []<BR>"},
  -
  -"<A href='?src=\ref[src];power=1'>[Parent_Turret.on ? "On" : "Off"]</A>" )
  -
  -
  +					<TT><B>Automatic Portable Turret Installation</B></TT><BR><BR>
  +					Status: []<BR>"},
  +
  +					"<A href='?src=\ref[src];power=1'>[Parent_Turret.on ? "On" : "Off"]</A>" )
   
   	user << browse("<HEAD><TITLE>Automatic Portable Turret Installation</TITLE></HEAD>[dat]", "window=autosec")
   	onclose(user, "autosec")
  -	return
  +
   
   /obj/machinery/porta_turret_cover/Topic(href, href_list)
  -	if (..())
  +	if(..())
   		return
   	usr.set_machine(src)
   	Parent_Turret.add_fingerprint(usr)
  -	src.add_fingerprint(usr)
  -	if ((href_list["power"]) && (Parent_Turret.allowed(usr)))
  +	add_fingerprint(usr)
  +	if(href_list["power"] && !Parent_Turret.locked)
   		if(Parent_Turret.anchored)
  -			if (Parent_Turret.on)
  -				Parent_Turret.on=0
  +			if(Parent_Turret.on)
  +				Parent_Turret.on = 0
   			else
  -				Parent_Turret.on=1
  +				Parent_Turret.on = 1
   		else
  -			usr << "\red It has to be secured first!"
  +			usr << "<span class='notice'>It has to be secured first!</span>"
   
   		updateUsrDialog()
   		return
   
   	switch(href_list["operation"])
  -		if ("authweapon")
  +		if("authweapon")
   			Parent_Turret.auth_weapons = !Parent_Turret.auth_weapons
  -		if ("checkrecords")
  +		if("checkrecords")
   			Parent_Turret.check_records = !Parent_Turret.check_records
  -		if ("shootcrooks")
  +		if("shootcrooks")
   			Parent_Turret.criminals = !Parent_Turret.criminals
   		if("shootall")
   			Parent_Turret.stun_all = !Parent_Turret.stun_all
  
positive.code: 		..()
  
  
  
  
  /obj/machinery/porta_turret/stationary
  	emagged = 1
  
  	New()
  		installation = new/obj/item/weapon/gun/energy/laser(src.loc)
  		..()
  
negative.code: 				sleep(60)
  				attacked = 0
  
  	health -= Proj.damage
  
  	..()
  
  	if(prob(45) && Proj.damage > 0)
  		spark_system.start()
  	if(health <= 0)
  		die()	//the death process :(
  
  	if(lasercolor == "b" && disabled == 0)
  		if(istype(Proj, /obj/item/projectile/redtag))
  			disabled = 1
  			del (Proj)
  			sleep(100)
  			disabled = 0
  	if(lasercolor == "r" && disabled == 0)
  		if(istype(Proj, /obj/item/projectile/bluetag))
  			disabled = 1
  			del (Proj)
  			sleep(100)
  			disabled = 0
  
  
  /obj/machinery/porta_turret/emp_act(severity)
  	if(on)
  		//if the turret is on, the EMP no matter how severe disables the turret for a while
  		//and scrambles its settings, with a slight chance of having an emag effect
  		check_records = pick(0, 1)
  		criminals = pick(0, 1)
  		auth_weapons = pick(0, 1)
  		stun_all = pick(0, 0, 0, 0, 1)	//stun_all is a pretty big deal, so it's least likely to get turned on
  		if(prob(5))
  			emagged = 1
  
  		on=0
  		sleep(rand(60,600))
  		if(!on)
  