diff --git a/code/__defines/hydroponics.dm b/code/__defines/hydroponics.dm index 6aa4a63f761..e40a83850d8 100644 --- a/code/__defines/hydroponics.dm +++ b/code/__defines/hydroponics.dm @@ -4,6 +4,7 @@ // Defining these to point to the relevant decl types just to avoid a massive changeset. // TODO: rename to PLANT_TRAIT or bare decls to avoid mixing up with GetTrait etc. #define TRAIT_CHEMS /decl/plant_trait/chems +#define TRAIT_POLLEN /decl/plant_trait/pollen #define TRAIT_EXUDE_GASSES /decl/plant_trait/exude_gasses #define TRAIT_ALTER_TEMP /decl/plant_trait/alter_temp #define TRAIT_POTENCY /decl/plant_trait/potency diff --git a/code/modules/genetics/plants/gene_biochemistry.dm b/code/modules/genetics/plants/gene_biochemistry.dm index 9239b95f292..296eebe4fbf 100644 --- a/code/modules/genetics/plants/gene_biochemistry.dm +++ b/code/modules/genetics/plants/gene_biochemistry.dm @@ -17,6 +17,8 @@ if(seed.get_trait(trait) > 0) seed.set_trait(trait, seed.get_trait(trait), null, 1, 0.85) + seed.produces_pollen = LAZYACCESS(gene.values, TRAIT_POLLEN) + LAZYINITLIST(seed.chems) var/list/gene_value = LAZYACCESS(gene.values, TRAIT_CHEMS) for(var/rid in gene_value) @@ -42,10 +44,12 @@ LAZYREMOVE(gene.values, TRAIT_EXUDE_GASSES) LAZYREMOVE(gene.values, TRAIT_CHEMS) + LAZYREMOVE(gene.values, TRAIT_POLLEN) return ..() /decl/plant_gene/biochemistry/copy_initial_seed_values(datum/plantgene/gene, datum/seed/seed) LAZYSET(gene.values, TRAIT_CHEMS, seed.chems?.Copy()) LAZYSET(gene.values, TRAIT_EXUDE_GASSES, seed.exude_gasses?.Copy()) + LAZYSET(gene.values, TRAIT_POLLEN, seed.produces_pollen) return ..() diff --git a/code/modules/genetics/plants/trait_pollen.dm b/code/modules/genetics/plants/trait_pollen.dm new file mode 100644 index 00000000000..7dbbcbbd0df --- /dev/null +++ b/code/modules/genetics/plants/trait_pollen.dm @@ -0,0 +1,3 @@ +/decl/plant_trait/pollen + name = "pollen" + requires_master_gene = FALSE diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index 8b2219be907..e6622494592 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -162,7 +162,9 @@ for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src)) if(H.seed && !H.dead) H.plant_health += 0.05 * coef - ++trays + if(H.pollen >= 1) + H.pollen-- + trays++ honeycombs = min(honeycombs + 0.1 * coef * min(trays, 5), frames * 100) /obj/machinery/honey_extractor diff --git a/code/modules/hydroponics/plant_types/seeds_herbs.dm b/code/modules/hydroponics/plant_types/seeds_herbs.dm index f03eede190a..ec4273ebc4f 100644 --- a/code/modules/hydroponics/plant_types/seeds_herbs.dm +++ b/code/modules/hydroponics/plant_types/seeds_herbs.dm @@ -1,6 +1,7 @@ /datum/seed/herb abstract_type = /datum/seed/herb allergen_flags = ALLERGEN_NONE // Do not make people allergic to the only medicine available on Shadyhills + produces_pollen = 0.5 /datum/seed/herb/New() ..() diff --git a/code/modules/hydroponics/plant_types/seeds_misc.dm b/code/modules/hydroponics/plant_types/seeds_misc.dm index e98328e4b39..8ee10be8c9d 100644 --- a/code/modules/hydroponics/plant_types/seeds_misc.dm +++ b/code/modules/hydroponics/plant_types/seeds_misc.dm @@ -685,6 +685,7 @@ chems = list(/decl/material/liquid/nutriment = list(1,20)) slice_product = /obj/item/food/processed_grown/crushed slice_amount = 3 + produces_pollen = 1 /datum/seed/flower/New() ..() diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 1065eb1d8a2..d61f42d51ba 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -32,6 +32,7 @@ var/scannable_result var/grown_is_seed = FALSE var/product_w_class = ITEM_SIZE_SMALL + var/produces_pollen = 0 // Dissection values. var/min_seed_extracted = 1 diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index bc714325733..6745fdaf11c 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -40,6 +40,9 @@ var/force_update // Set this to bypass the cycle time check. var/obj/temp_chem_holder // Something to hold reagents during process_reagents() + // Counter used by bees. + var/pollen = 0 + // Seed details/line data. var/datum/seed/seed = null // The currently planted seed diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm index dbcf6f19447..a62c81a8d1e 100644 --- a/code/modules/hydroponics/trays/tray_process.dm +++ b/code/modules/hydroponics/trays/tray_process.dm @@ -65,6 +65,9 @@ mutate((rand(100) < 15) ? 2 : 1) mutation_level = 0 + if(pollen < 10) + pollen += seed?.produces_pollen + // Maintain tray nutrient and water levels. if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS) && seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25)) nutrilevel -= max(0,seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) * growth_rate) diff --git a/nebula.dme b/nebula.dme index 9c2daf6c635..480b5fa8efb 100644 --- a/nebula.dme +++ b/nebula.dme @@ -2523,6 +2523,7 @@ #include "code\modules\genetics\plants\trait_photosynthesis.dm" #include "code\modules\genetics\plants\trait_plant_colour.dm" #include "code\modules\genetics\plants\trait_plant_icon.dm" +#include "code\modules\genetics\plants\trait_pollen.dm" #include "code\modules\genetics\plants\trait_potency.dm" #include "code\modules\genetics\plants\trait_produces_power.dm" #include "code\modules\genetics\plants\trait_product_colour.dm"