<commit_before>/obj/machinery/computer/HolodeckControl
	name = "Holodeck Control Computer"
	desc = "A computer used to control a nearby holodeck."
	icon_state = "holocontrol"
	var/area/linkedholodeck = null
	var/area/target = null
	var/active = 0
	var/list/holographic_items = list()
	var/damaged = 0
	var/last_change = 0

	l_color = "#7BF9FF"


	attack_ai(var/mob/user as mob)
		return src.attack_hand(user)

	attack_paw(var/mob/user as mob)
		return

	attack_hand(var/mob/user as mob)

		if(..())
			return
		user.set_machine(src)
		var/dat


		dat += "<B>Holodeck Control System</B><BR>"
		dat += "<HR>Current Loaded Programs:<BR>"

		dat += "<A href='?src=\ref[src];emptycourt=1'>((Empty Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];boxingcourt=1'>((Boxing Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];basketball=1'>((Basketball Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];thunderdomecourt=1'>((Thunderdome Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];beach=1'>((Beach)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];desert=1'>((Desert)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];space=1'>((Space)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];picnicarea=1'>((Picnic Area)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];snowfield=1'>((Snow Field)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];theatre=1'>((Theatre)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];meetinghall=1'>((Meeting Hall)</font>)</A><BR>"
//		dat += "<A href='?src=\ref[src];turnoff=1'>((Shutdown System)</font>)</A><BR>"

		dat += "Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.<BR>"

		if(emagged)
/*			dat += "<A href='?src=\ref[src];burntest=1'>(<font color=red>Begin Atmospheric Burn Simulation</font>)</A><BR>"
			dat += "Ensure the holodeck is empty before testing.<BR>"
			dat += "<BR>"*/
			dat += "<A href='?src=\ref[src];wildlifecarp=1'>(<font color=red>Begin Wildlife Simulation</font>)</A><BR>"
			dat += "Ensure the holodeck is empty before testing.<BR>"
			dat += "<BR>"
			if(issilicon(user))
				dat += "<A href='?src=\ref[src];AIoverride=1'>(<font color=green>Re-Enable Safety Protocols?</font>)</A><BR>"
			dat += "Safety Protocols are <font color=red> DISABLED </font><BR>"
		else
			if(issilicon(user))
				dat += "<A href='?src=\ref[src];AIoverride=1'>(<font color=red>Override Safety Protocols?</font>)</A><BR>"
			dat += "<BR>"
			dat += "Safety Protocols are <font color=green> ENABLED </font><BR>"

		user << browse(dat, "window=computer;size=400x500")
		onclose(user, "computer")


		return


	Topic(href, href_list)
		if(..())
			return
		if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
			usr.set_machine(src)

			if(href_list["emptycourt"])
				target = locate(/area/holodeck/source_emptycourt)
				if(target)
					loadProgram(target)

			else if(href_list["boxingcourt"])
				target = locate(/area/holodeck/source_boxingcourt)
				if(target)
					loadProgram(target)

			else if(href_list["basketball"])
				target = locate(/area/holodeck/source_basketball)
				if(target)
					loadProgram(target)

			else if(href_list["thunderdomecourt"])
				target = locate(/area/holodeck/source_thunderdomecourt)
				if(target)
					loadProgram(target)

			else if(href_list["beach"])
				target = locate(/area/holodeck/source_beach)
				if(target)
					loadProgram(target)

			else if(href_list["desert"])
				target = locate(/area/holodeck/source_desert)
				if(target)
					loadProgram(target)

			else if(href_list["space"])
				target = locate(/area/holodeck/source_space)
				if(target)
					loadProgram(target)

			else if(href_list["picnicarea"])
				target = locate(/area/holodeck/source_picnicarea)
				if(target)
					loadProgram(target)

			else if(href_list["snowfield"])
				target = locate(/area/holodeck/source_snowfield)
				if(target)
					loadProgram(target)

			else if(href_list["theatre"])
				target = locate(/area/holodeck/source_theatre)
				if(target)
					loadProgram(target)

			else if(href_list["meetinghall"])
				target = locate(/area/holodeck/source_meetinghall)
				if(target)
					loadProgram(target)

			else if(href_list["turnoff"])
				target = locate(/area/holodeck/source_plating)
				if(target)
					loadProgram(target)
/*
			else if(href_list["burntest"])
				if(!emagged)	return
				target = locate(/area/holodeck/source_burntest)
				if(target)
					loadProgram(target)
*/
			else if(href_list["wildlifecarp"])
				if(!emagged)	return
				target = locate(/area/holodeck/source_wildlife)
				if(target)
					loadProgram(target)

			else if(href_list["AIoverride"])
				if(!issilicon(usr))	return
				emagged = !emagged
				if(emagged)
					message_admins("[key_name_admin(usr)] overrode the holodeck's safeties")
					log_game("[key_name(usr)] overrided the holodeck's safeties")
				else
					message_admins("[key_name_admin(usr)] restored the holodeck's safeties")
					log_game("[key_name(usr)] restored the holodeck's safeties")

			src.add_fingerprint(usr)
		src.updateUsrDialog()
		return



/obj/machinery/computer/HolodeckControl/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
	return
	
/obj/machinery/computer/HolodeckControl/emag_act(user as mob)
	if(!emagged)
		playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
		emagged = 1
		user << "\blue You vastly increase projector power and override the safety and security protocols."
		user << "Warning.  Automatic shutoff and derezing protocols have been corrupted.  Please call Nanotrasen maintenance and do not use the simulator."
		log_game("[key_name(usr)] emagged the Holodeck Control Computer")

/obj/machinery/computer/HolodeckControl/New()
	..()
	linkedholodeck = locate(/area/holodeck/alphadeck)
	//if(linkedholodeck)
	//	target = locate(/area/holodeck/source_emptycourt)
	//	if(target)
	//		loadProgram(target)<commit_msg>Ensure interface updates on emag<commit_after>/obj/machinery/computer/HolodeckControl
	name = "Holodeck Control Computer"
	desc = "A computer used to control a nearby holodeck."
	icon_state = "holocontrol"
	var/area/linkedholodeck = null
	var/area/target = null
	var/active = 0
	var/list/holographic_items = list()
	var/damaged = 0
	var/last_change = 0

	l_color = "#7BF9FF"


	attack_ai(var/mob/user as mob)
		return src.attack_hand(user)

	attack_paw(var/mob/user as mob)
		return

	attack_hand(var/mob/user as mob)

		if(..())
			return
		user.set_machine(src)
		var/dat


		dat += "<B>Holodeck Control System</B><BR>"
		dat += "<HR>Current Loaded Programs:<BR>"

		dat += "<A href='?src=\ref[src];emptycourt=1'>((Empty Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];boxingcourt=1'>((Boxing Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];basketball=1'>((Basketball Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];thunderdomecourt=1'>((Thunderdome Court)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];beach=1'>((Beach)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];desert=1'>((Desert)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];space=1'>((Space)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];picnicarea=1'>((Picnic Area)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];snowfield=1'>((Snow Field)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];theatre=1'>((Theatre)</font>)</A><BR>"
		dat += "<A href='?src=\ref[src];meetinghall=1'>((Meeting Hall)</font>)</A><BR>"
//		dat += "<A href='?src=\ref[src];turnoff=1'>((Shutdown System)</font>)</A><BR>"

		dat += "Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.<BR>"

		if(emagged)
/*			dat += "<A href='?src=\ref[src];burntest=1'>(<font color=red>Begin Atmospheric Burn Simulation</font>)</A><BR>"
			dat += "Ensure the holodeck is empty before testing.<BR>"
			dat += "<BR>"*/
			dat += "<A href='?src=\ref[src];wildlifecarp=1'>(<font color=red>Begin Wildlife Simulation</font>)</A><BR>"
			dat += "Ensure the holodeck is empty before testing.<BR>"
			dat += "<BR>"
			if(issilicon(user))
				dat += "<A href='?src=\ref[src];AIoverride=1'>(<font color=green>Re-Enable Safety Protocols?</font>)</A><BR>"
			dat += "Safety Protocols are <font color=red> DISABLED </font><BR>"
		else
			if(issilicon(user))
				dat += "<A href='?src=\ref[src];AIoverride=1'>(<font color=red>Override Safety Protocols?</font>)</A><BR>"
			dat += "<BR>"
			dat += "Safety Protocols are <font color=green> ENABLED </font><BR>"

		user << browse(dat, "window=computer;size=400x500")
		onclose(user, "computer")


		return


	Topic(href, href_list)
		if(..())
			return
		if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
			usr.set_machine(src)

			if(href_list["emptycourt"])
				target = locate(/area/holodeck/source_emptycourt)
				if(target)
					loadProgram(target)

			else if(href_list["boxingcourt"])
				target = locate(/area/holodeck/source_boxingcourt)
				if(target)
					loadProgram(target)

			else if(href_list["basketball"])
				target = locate(/area/holodeck/source_basketball)
				if(target)
					loadProgram(target)

			else if(href_list["thunderdomecourt"])
				target = locate(/area/holodeck/source_thunderdomecourt)
				if(target)
					loadProgram(target)

			else if(href_list["beach"])
				target = locate(/area/holodeck/source_beach)
				if(target)
					loadProgram(target)

			else if(href_list["desert"])
				target = locate(/area/holodeck/source_desert)
				if(target)
					loadProgram(target)

			else if(href_list["space"])
				target = locate(/area/holodeck/source_space)
				if(target)
					loadProgram(target)

			else if(href_list["picnicarea"])
				target = locate(/area/holodeck/source_picnicarea)
				if(target)
					loadProgram(target)

			else if(href_list["snowfield"])
				target = locate(/area/holodeck/source_snowfield)
				if(target)
					loadProgram(target)

			else if(href_list["theatre"])
				target = locate(/area/holodeck/source_theatre)
				if(target)
					loadProgram(target)

			else if(href_list["meetinghall"])
				target = locate(/area/holodeck/source_meetinghall)
				if(target)
					loadProgram(target)

			else if(href_list["turnoff"])
				target = locate(/area/holodeck/source_plating)
				if(target)
					loadProgram(target)
/*
			else if(href_list["burntest"])
				if(!emagged)	return
				target = locate(/area/holodeck/source_burntest)
				if(target)
					loadProgram(target)
*/
			else if(href_list["wildlifecarp"])
				if(!emagged)	return
				target = locate(/area/holodeck/source_wildlife)
				if(target)
					loadProgram(target)

			else if(href_list["AIoverride"])
				if(!issilicon(usr))	return
				emagged = !emagged
				if(emagged)
					message_admins("[key_name_admin(usr)] overrode the holodeck's safeties")
					log_game("[key_name(usr)] overrided the holodeck's safeties")
				else
					message_admins("[key_name_admin(usr)] restored the holodeck's safeties")
					log_game("[key_name(usr)] restored the holodeck's safeties")

			src.add_fingerprint(usr)
		src.updateUsrDialog()
		return



/obj/machinery/computer/HolodeckControl/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
	return
	
/obj/machinery/computer/HolodeckControl/emag_act(user as mob)
	if(!emagged)
		playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
		emagged = 1
		user << "\blue You vastly increase projector power and override the safety and security protocols."
		user << "Warning.  Automatic shutoff and derezing protocols have been corrupted.  Please call Nanotrasen maintenance and do not use the simulator."
		log_game("[key_name(usr)] emagged the Holodeck Control Computer")
		src.updateUsrDialog()

/obj/machinery/computer/HolodeckControl/New()
	..()
	linkedholodeck = locate(/area/holodeck/alphadeck)
	//if(linkedholodeck)
	//	target = locate(/area/holodeck/source_emptycourt)
	//	if(target)
	//		loadProgram(target)
{'fraction_non_alphanumeric': 0.1777201639207159, 'fraction_numerical': 0.005352513172200385, 'mean_word_length': 4.467764060356653, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 173, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1452587', 'n_tokens_mistral': 5021, 'n_tokens_neox': 4275, 'n_words': 774}