#define PLANT_TICK_TIME 75 // Number of ticks between the plant processor cycling. SUBSYSTEM_DEF(plants) name = "Plants" dependencies = list( /datum/controller/subsystem/mapping ) priority = FIRE_PRIORITY_PLANTS wait = PLANT_TICK_TIME var/list/product_descs = list() // Stores generated fruit descs. var/list/seeds = list() // All seed data stored here. var/list/gene_tag_masks = list() // Gene obfuscation for delicious trial and error goodness. var/list/plant_icon_cache = list() // Stores images of growth, fruits and seeds. var/list/plant_sprites = list() // List of all growth sprites plus number of growth stages. var/list/accessible_plant_sprites = list() // List of all plant sprites allowed to appear in random generation. var/list/plant_product_sprites = list() // List of all harvested product sprites. var/list/accessible_product_sprites = list() // List of all product sprites allowed to appear in random generation. var/list/gene_masked_list = list() // Stored gene masked list, rather than recreating it when needed. var/list/plant_gene_datums = list() // Stored datum versions of the gene masked list. // To be clear, the only thing this processes are spreading plants // Hydro trays and growing food normally just chill in SSobj var/list/processing = list() var/list/currentrun = list() /datum/controller/subsystem/plants/stat_entry(msg) msg = "P:[processing.len]|S:[seeds.len]" return ..() /datum/controller/subsystem/plants/Initialize() setup() return SS_INIT_SUCCESS // Predefined/roundstart varieties use a string key to make it // easier to grab the new variety when mutating. Post-roundstart // and mutant varieties use their uid converted to a string instead. // Looks like shit but it's sort of necessary. /datum/controller/subsystem/plants/proc/setup() // Build the icon lists. for(var/icostate in cached_icon_states('icons/obj/hydroponics_growing.dmi')) var/split = findtext(icostate,"-") if(!split) // invalid icon_state continue var/ikey = copytext(icostate,(split+1)) if(ikey == "dead") // don't count dead icons continue ikey = text2num(ikey) var/base = copytext(icostate,1,split) if(!(plant_sprites[base]) || (plant_sprites[base]