diff --git a/code/datums/components/swabbing.dm b/code/datums/components/swabbing.dm index 51d6a72c5df..ad75444ec17 100644 --- a/code/datums/components/swabbing.dm +++ b/code/datums/components/swabbing.dm @@ -96,6 +96,8 @@ This component is used in vat growing to swab for microbiological samples which if(!do_after(user, 30, TRUE, target)) // Start swabbing boi return + LAZYINITLIST(swabbed_items) //If it isn't initialized, initialize it. As we need to pass it by reference + if(!SEND_SIGNAL(target, COMSIG_SWAB_FOR_SAMPLES, swabbed_items)) //If we found something to swab now we let the swabbed thing handle what it would do, we just sit back and relax now. to_chat(user, "You do not manage to find a anything on [target]!") return diff --git a/code/datums/elements/swabbable.dm b/code/datums/elements/swabbable.dm index 8a6f4225ccc..dffc1d9a890 100644 --- a/code/datums/elements/swabbable.dm +++ b/code/datums/elements/swabbable.dm @@ -16,7 +16,7 @@ This element is used in vat growing to allow for the object to be var/virus_chance ///Listens for the swab signal and then generate a sample based on pre-determined lists that are saved as GLOBs. this allows us to have very few swabbable element instances. -/datum/element/swabable/Attach(datum/target, cell_line_define, virus_define, cell_line_amount = 3, virus_chance = 10) +/datum/element/swabable/Attach(datum/target, cell_line_define, virus_define, cell_line_amount = 1, virus_chance = 10) . = ..() if(!isatom(target) || isarea(target)) return ELEMENT_INCOMPATIBLE diff --git a/code/modules/research/xenobiology/vatgrowing/microscope.dm b/code/modules/research/xenobiology/vatgrowing/microscope.dm index d9f8b9b65f4..0950ae8b5b1 100644 --- a/code/modules/research/xenobiology/vatgrowing/microscope.dm +++ b/code/modules/research/xenobiology/vatgrowing/microscope.dm @@ -15,11 +15,10 @@ current_dish = I current_dish.forceMove(src) -/obj/structure/microscope/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ - datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) +/obj/structure/microscope/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) if(!ui) - ui = new(user, src, ui_key, "Microscope", name, 525, 594, master_ui, state) + ui = new(user, src, "Microscope") ui.open() /obj/structure/microscope/ui_data(mob/user) diff --git a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm index 8a97da670b5..ee053ee350a 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm @@ -30,10 +30,11 @@ ///Handles growth of the micro_organism. This only runs if the micro organism is in the growing vat. Reagents is the growing vats reagents /datum/micro_organism/cell_line/proc/HandleGrowth(var/obj/machinery/plumbing/growing_vat/vat) if(!try_eat(vat.reagents)) - return + return FALSE growth = max(growth, growth + calculate_growth(vat.reagents, vat.biological_sample)) //Prevent you from having minus growth. if(growth >= 100) finish_growing(vat) + return TRUE ///Tries to consume the required reagents. Can only do this if all of them are available. Reagents is the growing vats reagents /datum/micro_organism/cell_line/proc/try_eat(var/datum/reagents/reagents) diff --git a/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm b/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm index 2b1fc9a4ced..6de81c9898c 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm @@ -41,4 +41,4 @@ ///Call HandleGrowth on all our microorganisms. /datum/biological_sample/proc/HandleGrowth(var/obj/machinery/plumbing/growing_vat/vat) for(var/datum/micro_organism/cell_line/organism in micro_organisms) //Types because we don't grow viruses. - organism.HandleGrowth(vat) + return organism.HandleGrowth(vat) diff --git a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm index 88a211c51d1..e98e76cebcf 100644 --- a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm +++ b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm @@ -17,10 +17,10 @@ if(!is_operational() && !biological_sample) return if(biological_sample) - biological_sample.HandleGrowth(src) - if(prob(10)) - playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE) - audible_message(pick(list("[src] grumbles!", "[src] makes a splashing noise!", "[src] sloshes!"))) + if(biological_sample.HandleGrowth(src)) + if(prob(10)) + playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE) + audible_message(pick(list("[src] grumbles!", "[src] makes a splashing noise!", "[src] sloshes!"))) ///Handles the petri dish depositing into the vat. /obj/machinery/plumbing/growing_vat/attacked_by(obj/item/I, mob/living/user)