anchor.diff:  	popup.open()
   	return
   
  -/obj/machinery/computer/telescience/proc/telefail()
  -	if(prob(55))
  -		for(var/mob/O in hearers(src, null))
  -			O.show_message("\red The telepad weakly fizzles.", 2)
  -		for(var/obj/machinery/telepad/E in world)
  -			var/L = get_turf(E)
  +/obj/machinery/computer/telescience/proc/telefail(var/level)
  +	var/teleturf = get_turf(telepad)
  +	switch(level)
  +		if(1)
  +			for(var/mob/O in hearers(telepad, null))
  +				O.show_message("\red The telepad weakly fizzles.", 2)
   			var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
  -			s.set_up(5, 1, L)
  +			s.set_up(5, 1, teleturf)
   			s.start()
  -		return
  -	if(prob(20))
  -		// Irradiate everyone in telescience!
  -		for(var/obj/machinery/telepad/E in world)
  -			var/L = get_turf(E)
  -			for(var/mob/living/carbon/human/M in viewers(L, null))
  +		if(2)
  +			for(var/mob/living/carbon/human/M in viewers(telepad, null))
   				M.apply_effect((rand(50, 100)), IRRADIATE, 0)
   				M << "\red You feel irradiated."
  -		return
  -	if(prob(20))
  -		// So let's set the world on fire...
  -		for(var/obj/machinery/telepad/E in world)
  -			var/L = get_turf(E)
  -			for(var/turf/simulated/floor/target_tile in range(0,L))
  +		if(3)
  +			for(var/turf/simulated/floor/target_tile in range(0,telepad))
   				var/datum/gas_mixture/napalm = new
   				napalm.toxins = 25
   				napalm.temperature = 2000
   				target_tile.assume_air(napalm)
   				spawn (0) target_tile.hotspot_expose(700, 400)
  -		for(var/mob/O in hearers(src, null))
  -			O.show_message("\red The telepad sets on fire!", 2)
  -		return
  -	if(prob(5))
  -		// They did the mash! (They did the monster mash!) The monster mash! (It was a graveyard smash!)
  -		// copied from gold slime code because it's efficient
  -		for(var/obj/machinery/telepad/E in world)
  -			var/L = get_turf(E)
  +			for(var/mob/O in hearers(telepad, null))
  +				O.show_message("\red The telepad sets on fire!", 2)
  +		if(4)
   			var/blocked = list(/mob/living/simple_animal/hostile,
   				/mob/living/simple_animal/hostile/alien/queen/large,
   				/mob/living/simple_animal/hostile/pirate,
  
positive.code: 				/mob/living/simple_animal/hostile/retaliate,
  				/mob/living/simple_animal/hostile/giant_spider/nurse)
  			var/list/hostiles = typesof(/mob/living/simple_animal/hostile) - blocked
  			playsound(L, 'sound/effects/phasein.ogg', 100, 1)
  			for(var/mob/living/carbon/human/M in viewers(L, null))
  				flick("e_flash", M.flash)
  			var/chosen = pick(hostiles)
  			var/mob/living/simple_animal/hostile/H = new chosen
  			H.loc = L
  			return
  		return
  	return
  
  /obj/machinery/computer/telescience/proc/dosend()
  	var/trueX = (x_co + x_off)
  	var/trueY = (y_co + y_off)
  	for(var/obj/machinery/telepad/E in world)
  		var/L = get_turf(E)
  		var/target = locate(trueX, trueY, z_co)
  		var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
  		s.set_up(5, 1, L)
  		s.start()
  		flick("pad-beam", E)
  		usr << "\blue Teleport successful."
  		for(var/obj/item/OI in L)
  			do_teleport(OI, target, 0)
  		for(var/obj/structure/closet/OC in L)
  			do_teleport(OC, target, 0)
  		for(var/mob/living/carbon/MO in L)
  			do_teleport(MO, target, 0)
  		for(var/mob/living/simple_animal/SA in L)
  			do_teleport(SA, target, 0)
  		return
  	return
  
  /obj/machinery/computer/telescience/proc/doreceive()
  	var/trueX = (x_co + x_off)
  	var/trueY = (y_co + y_off)
  	for(var/obj/machinery/telepad/E in world)
  		var/L = get_turf(E)
  		var/T = locate(trueX, trueY, z_co)
  		var/G = get_turf(T)
  		var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
  		s.set_up(5, 1, L)
  		s.start()
  		flick("pad-beam", E)
  		usr << "\blue Teleport successful."
  		for(var/obj/item/ROI in G)
  			do_teleport(ROI, E, 0)
  		for(var/obj/structure/closet/ROC in G)
  			do_teleport(ROC, E, 0)
  		for(var/mob/living/carbon/RMO in G)
  			do_teleport(RMO, E, 0)
  		for(var/mob/living/simple_animal/RSA in G)
  			do_teleport(RSA, E, 0)
  		return
  	return
  
  /obj/machinery/computer/telescience/proc/telesend()
  	if(x_co == "")
  		usr << "\red Error: set coordinates."
  		return
  	if(y_co == "")
  		usr << "\red Error: set coordinates."
  		return
  	if(z_co == "")
  		usr << "\red Error: set coordinates."
  		return
  	if(x_co < 11 || x_co > 245)
  		telefail()
  		usr << "\red Error: X is less than 11 or greater than 245."
  		return
  	if(y_co < 11 || y_co > 245)
  		telefail()
  		usr << "\red Error: Y is less than 11 or greater than 245."
  		return
  	if(z_co == 2 || z_co < 1 || z_co > 6)
  		telefail()
  		usr << "\red Error: Z is less than 1, greater than 6, or equal to 2."
  		return
  	if(teles_left > 0)
  		if(prob(75))
  			teles_left -= 1
  			dosend()
  			if(teles_left == 0)
  				for(var/mob/O in hearers(src, null))
  					O.show_message("\red The telepad has become uncalibrated.", 2)
  		else
  			telefail()
  		return
  	else	// oh no, the telepad is uncalibrated!
  		if(prob(35))
  			// 35% chance it will work
  			dosend()
  		else
  			// OH NO YOU IDIOT
  			telefail()
  		return
  	return
  
  /obj/machinery/computer/telescience/proc/telereceive()
  	// basically the same thing
  	if(x_co == "")
  		usr << "\red Error: set coordinates."
  		return
  	if(y_co == "")
  		usr << "\red Error: set coordinates."
  		return
  	if(z_co == "")
  		usr << "\red Error: set coordinates."
  		return
  	if(x_co < 11 || x_co > 245)
  		telefail()
  		usr << "\red Error: X is less than 11 or greater than 245."
  		return
  	if(y_co < 11 || y_co > 245)
  		telefail()
  		usr << "\red Error: Y is less than 11 or greater than 245."
  		return
  	if(z_co == 2 || z_co < 1 || z_co > 6)
  		telefail()
  		usr << "\red Error: Z is less than 1, greater than 6, or equal to 2."
  		return
  	if(teles_left > 0)
  		if(prob(85))
  			teles_left -= 1
  			doreceive()
  			if(teles_left == 0)
  				for(var/mob/O in hearers(src, null))
  					O.show_message("\red The telepad has become uncalibrated.", 2)
  		else
  			telefail()
  		return
  	else
  		if(prob(55))
  			doreceive()
  		else
  			telefail()
  		return
  	return
  
  /obj/machinery/computer/telescience/Topic(href, href_list)
  	if(..())
  
negative.code: 		z_co = text2num(z_co)
  		return
  	if(href_list["send"])
  		teleprep(0)
  		return
  	if(href_list["receive"])
  		teleprep(1)
  		return
  	if(href_list["recal"])
  		if(telepad == null)
  			for(var/obj/machinery/telepad/T in range(src,10))
  				if(T.tele_id == tele_id)
  					telepad = T
  		if(!telepad)	return
  		var/teleturf = get_turf(telepad)
  		teles_left = rand(8,12)
  		x_off = rand(-10,10)
  		y_off = rand(-10,10)
  		var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
  		s.set_up(5, 1, teleturf)
  		s.start()
  		usr << "\blue Calibration successful."
  		return
  