This commit is contained in:
floyd
2020-08-18 03:03:02 +02:00
committed by Aleksej Komarov
parent e3d1ee6651
commit c9238dfdce
6 changed files with 13 additions and 11 deletions
+2
View File
@@ -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, "<span class='warning'>You do not manage to find a anything on [target]!</span>")
return
+1 -1
View File
@@ -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
@@ -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)
@@ -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)
@@ -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)
@@ -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("<span class='notice'>[src] grumbles!</span>", "<span class='notice'>[src] makes a splashing noise!</span>", "<span class='notice'>[src] sloshes!</span>")))
if(biological_sample.HandleGrowth(src))
if(prob(10))
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
audible_message(pick(list("<span class='notice'>[src] grumbles!</span>", "<span class='notice'>[src] makes a splashing noise!</span>", "<span class='notice'>[src] sloshes!</span>")))
///Handles the petri dish depositing into the vat.
/obj/machinery/plumbing/growing_vat/attacked_by(obj/item/I, mob/living/user)