From f15faefef06963af1634b503141ecb1bef022559 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 10 Jan 2021 23:19:36 +0100 Subject: [PATCH] [MIRROR] Fixes 2 really annoying cytology virus bugs. (#2628) * Fixes 2 really annoying cytology virus bugs. (#56062) This PR fixes the generate_sample proc so it properly uses virus_chance to determine when to generate a virus. Now most samples will be virus free as intended. It also fixes the bug where virus penalty and spaceacillin consumption would be multiplied by the number of cell lines, rather than the number of viruses, as intended. * Fixes 2 really annoying cytology virus bugs. Co-authored-by: Krysonism <49783092+Krysonism@users.noreply.github.com> --- code/datums/elements/swabbable.dm | 2 +- .../research/xenobiology/vatgrowing/samples/_micro_organism.dm | 2 +- code/modules/research/xenobiology/vatgrowing/samples/_sample.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/datums/elements/swabbable.dm b/code/datums/elements/swabbable.dm index 18b88f50324..5059ad7635c 100644 --- a/code/datums/elements/swabbable.dm +++ b/code/datums/elements/swabbable.dm @@ -12,7 +12,7 @@ This element is used in vat growing to allow for the object to be var/virus_define ///Amount of cell lines on a single sample var/cell_line_amount - ///Amount of viruses on a single sample + ///The chance the sample will be infected with a virus. 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. diff --git a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm index 8cd13518a01..d0ad4963046 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/_micro_organism.dm @@ -63,7 +63,7 @@ reagents.remove_reagent(i, REAGENTS_METABOLISM) //Handle debuffing growth based on viruses here. - for(var/datum/micro_organism/cell_line/virus in biological_sample.micro_organisms) + for(var/datum/micro_organism/virus/active_virus in biological_sample.micro_organisms) if(reagents.has_reagent(/datum/reagent/medicine/spaceacillin, REAGENTS_METABOLISM)) reagents.remove_reagent(/datum/reagent/medicine/spaceacillin, REAGENTS_METABOLISM) continue //This virus is stopped, We have antiviral stuff diff --git a/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm b/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm index 65c861a70d9..8047e863fb4 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm @@ -16,7 +16,7 @@ var/datum/micro_organism/chosen_type = pickweight(temp_weight_list) temp_weight_list -= chosen_type micro_organisms += new chosen_type - if(virus_chance) + if(prob(virus_chance)) if(!GLOB.cell_virus_tables[virus_define]) return var/datum/micro_organism/chosen_type = pickweight(GLOB.cell_virus_tables[virus_define])