<commit_before>/obj/machinery/disease2/isolator/
	name = "Pathogenic Isolator"
	density = 1
	anchored = 1
	icon = 'virology.dmi'
	icon_state = "isolator"
	var/datum/disease2/disease/virus2 = null
	var/isolating = 0
	var/beaker = null

/obj/machinery/disease2/isolator/attackby(var/W as obj, var/mob/user)
	if(!istype(W,/obj/item/weapon/reagent_containers/syringe))
		return

	var/obj/item/weapon/reagent_containers/syringe/B = W

	if(src.beaker)
		user << "A syringe is already loaded into the machine."
		return

	src.beaker =  B
	user.drop_item()
	B.loc = src
	if(istype(B,/obj/item/weapon/reagent_containers/syringe))
		user << "You add the syringe to the machine!"
		src.updateUsrDialog()
		icon_state = "isolator_in"

/obj/machinery/disease2/isolator/Topic(href, href_list)
	if(..()) return

	usr.machine = src
	if(!beaker) return
	var/datum/reagents/R = beaker:reagents

	if (href_list["isolate"])
		var/datum/reagent/blood/Blood
		for(var/datum/reagent/blood/B in R.reagent_list)
			if(B)
				Blood = B
				break

		if(Blood.data["virus2"])
			virus2 = Blood.data["virus2"]
			isolating = 40
			icon_state = "isolator_processing"
		src.updateUsrDialog()
		return

	else if (href_list["main"])
		attack_hand(usr)
		return
	else if (href_list["eject"])
		beaker:loc = src.loc
		beaker = null
		icon_state = "isolator"
		src.updateUsrDialog()
		return

/obj/machinery/disease2/isolator/attack_hand(mob/user as mob)
	if(stat & BROKEN)
		return
	user.machine = src
	var/dat = ""
	if(!beaker)
		dat = "Please insert sample into the isolator.<BR>"
		dat += "<A href='?src=\ref[src];close=1'>Close</A>"
	else if(isolating)
		dat = "Isolating"
	else
		var/datum/reagents/R = beaker:reagents
		dat += "<A href='?src=\ref[src];eject=1'>Eject</A><BR><BR>"
		if(!R.total_volume)
			dat += "[beaker] is empty."
		else
			dat += "Contained reagents:<BR>"
			for(var/datum/reagent/blood/G in R.reagent_list)
				if(G.data["virus2"])
					dat += "    [G.name]: <A href='?src=\ref[src];isolate=[G.id]'>Isolate</a>"
				else
					dat += "    <b>No pathogen</b>"
	user << browse("<TITLE>Pathogenic Isolator</TITLE>Isolator menu:<BR><BR>[dat]", "window=isolator;size=575x400")
	onclose(user, "isolator")
	return

/obj/machinery/disease2/isolator/process()
	if(isolating > 0)
		isolating -= 1<commit_msg>Changed isolator to be able to isolate any virus from sample.<commit_after>/obj/machinery/disease2/isolator/
	name = "Pathogenic Isolator"
	density = 1
	anchored = 1
	icon = 'virology.dmi'
	icon_state = "isolator"
	var/datum/disease2/disease/virus2 = null
	var/isolating = 0
	var/beaker = null

/obj/machinery/disease2/isolator/attackby(var/W as obj, var/mob/user)
	if(!istype(W,/obj/item/weapon/reagent_containers/syringe))
		return

	var/obj/item/weapon/reagent_containers/syringe/B = W

	if(src.beaker)
		user << "A syringe is already loaded into the machine."
		return

	src.beaker =  B
	user.drop_item()
	B.loc = src
	if(istype(B,/obj/item/weapon/reagent_containers/syringe))
		user << "You add the syringe to the machine!"
		src.updateUsrDialog()
		icon_state = "isolator_in"

/obj/machinery/disease2/isolator/Topic(href, href_list)
	if(..()) return

	usr.machine = src
	if(!beaker) return
	var/datum/reagents/R = beaker:reagents

	if (href_list["isolate"])
		var/datum/reagent/blood/Blood
		for(var/datum/reagent/blood/B in R.reagent_list)
			if(B)
				Blood = B
				break
		var/list/virus = get_copy_viruses(Blood.data["virus2"])
		var/choice = text2num(href_list["isolate"]);
		for (var/datum/disease2/disease/V in virus)
			if (V.uniqueID == choice)
				virus2 = virus
				isolating = 40
				icon_state = "isolator_processing"
		src.updateUsrDialog()
		return

	else if (href_list["main"])
		attack_hand(usr)
		return
	else if (href_list["eject"])
		beaker:loc = src.loc
		beaker = null
		icon_state = "isolator"
		src.updateUsrDialog()
		return

/obj/machinery/disease2/isolator/attack_hand(mob/user as mob)
	if(stat & BROKEN)
		return
	user.machine = src
	var/dat = ""
	if(!beaker)
		dat = "Please insert sample into the isolator.<BR>"
		dat += "<A href='?src=\ref[src];close=1'>Close</A>"
	else if(isolating)
		dat = "Isolating"
	else
		var/datum/reagents/R = beaker:reagents
		dat += "<A href='?src=\ref[src];eject=1'>Eject</A><BR><BR>"
		if(!R.total_volume)
			dat += "[beaker] is empty."
		else
			dat += "Contained reagents:<BR>"
			for(var/datum/reagent/blood/G in R.reagent_list)
				if(G.data["virus2"])
					var/list/virus = G.data["virus2"]
					for (var/datum/disease2/disease/V in virus)
						dat += " <br>  [G.name]: <A href='?src=\ref[src];isolate=[V.uniqueID]'>Isolate pathogen #[V.uniqueID]</a>"
				else
					dat += "    <b>No pathogen</b>"
	user << browse("<TITLE>Pathogenic Isolator</TITLE>Isolator menu:<BR><BR>[dat]", "window=isolator;size=575x400")
	onclose(user, "isolator")
	return

/obj/machinery/disease2/isolator/process()
	if(isolating > 0)
		isolating -= 1
{'fraction_non_alphanumeric': 0.15858399836300388, 'fraction_numerical': 0.011254348270922856, 'mean_word_length': 3.9775967413441955, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 38, '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': '2952058', 'n_tokens_mistral': 2229, 'n_tokens_neox': 1941, 'n_words': 354}