diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 36c5537342..f01aae7f42 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -2,49 +2,8 @@ var/global/list/seed_types = list() // A list of all seed data. var/global/list/gene_tag_masks = list() // Gene obfuscation for delicious trial and error goodness. // Index is the root icon_state, value is the number of states. -var/global/list/plant_sprites = list( - "bush" = 6, "bush2" = 6, "bush3" = 6, "bush4" = 6, "bush5" = 5, "bush6" = 4, "bush7" = 4, - "mushroom" = 3, "mushroom2" = 3, "mushroom3" = 3, "mushroom4" = 3, "mushroom5" = 3, - "mushroom6" = 4, "mushroom7" = 4, "mushroom8" = 3, "mushroom9" = 3, "mushroom10" = 3, - "tree" = 6, "tree2" = 5, "tree3" = 5, "tree4" = 6, "tree5" = 6, - "alien" = 4, "alien2" = 4, "alien3" = 3, "alien4" = 6, - "flower" = 4, "flower2" = 3, "flower3" = 3, - "grass" = 2, "grass2" = 4, - "stalk" = 4, "stalk2" = 6, - "vine" = 2, "vine2" = 4, - "carrot" = 4, "carrot2" = 6, - "ambrosia" = 6, - "corn" = 4 - ) - -var/global/list/plant_product_sprites = list( - "berry", - "chili", - "eggplant", - "bean", - "tomato", - "wheat", - "nuts", - "nettles", - "bananas", - "treefruit", - "cash", - "rice", - "potato", - "corn", - "cabbage", - "vine", - "diona", - "stalk", - "ambrosia", - "unknown", - "carrot", "carrot2", - "grass", "grass2", - "flowers", "flower2", "flower3", "flower4", "flower5", - "alien", "alien2", "alien3", "alien4", "alien5", - "mushroom", "mushroom2", "mushroom3", "mushroom4", "mushroom5", - "mushroom6", "mushroom7", "mushroom8", "mushroom9", "mushroom10", "mushroom11" - ) +var/global/list/plant_sprites = list() +var/global/list/plant_product_sprites = list() // Debug for testing seed genes. /client/proc/show_plant_genes() @@ -68,6 +27,26 @@ var/global/list/plant_product_sprites = list( proc/populate_seed_list() + // Build the icon lists. + for(var/icostate in 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][user] nibbles away at the [src].","You nibble away at the [src].") + user.visible_message("[user] nibbles away at \the [src].","You nibble away at \the [src].") bitecount++ if(reagents && user.reagents) reagents.trans_to_ingest(user, bitesize)