diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index a59ee9fcb0..f4366d3fd3 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -66,7 +66,7 @@ } while(FALSE) //Returns a list in plain english as a string -/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" ) +/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "") var/total = length(input) switch(total) if (0) @@ -87,6 +87,34 @@ return "[output][and_text][input[index]]" +/** + * English_list but associative supporting. Higher overhead. + */ +/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "") + var/total = length(input) + switch(total) + if (0) + return "[nothing_text]" + if (1) + var/assoc = input[input[1]] == null? "" : " = [input[input[1]]]" + return "[input[1]][assoc]" + if (2) + var/assoc = input[input[1]] == null? "" : " = [input[input[1]]]" + var/assoc2 = input[input[2]] == null? "" : " = [input[input[2]]]" + return "[input[1]][and_text][input[2]]" + else + var/output = "" + var/index = 1 + var/assoc + while (index < total) + if (index == total - 1) + comma_text = final_comma_text + assoc = input[input[index]] == null? "" : " = [input[input[index]]]" + output += "[input[index]][assoc][comma_text]" + ++index + assoc = input[input[index]] == null? "" : " = [input[input[index]]]" + return "[output][and_text][input[index]]" + //Returns list element or null. Should prevent "index out of bounds" error. /proc/listgetindex(list/L, index) if(LAZYLEN(L)) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 24f65756c8..e186364cff 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -527,12 +527,13 @@ else if(istype(O, /obj/item/seeds) && !istype(O, /obj/item/seeds/sample)) if(!myseed) if(istype(O, /obj/item/seeds/kudzu)) - investigate_log("had Kudzu planted in it by [key_name(user)] at [AREACOORD(src)]","kudzu") + investigate_log("had Kudzu planted in it by [key_name(user)] at [AREACOORD(src)]", INVESTIGATE_BOTANY) if(!user.transferItemToLoc(O, src)) return to_chat(user, "You plant [O].") dead = FALSE myseed = O + investigate_log("planting: [user] planted [O] with traits [english_list(myseed)] and reagents [english_list_assoc(myseed.reagents_add)] and potency [myseed.potency]", INVESTIGATE_BOTANY) TRAY_NAME_UPDATE age = 1 plant_health = myseed.endurance diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index d8082e667d..577635cd1c 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -188,6 +188,8 @@ ///The Number of products produced by the plant, typically the yield. var/product_count = getYield() + parent.investigate_log("manual harvest by [key_name(user)] of [getYield()] of [src], with seed traits [english_list(genes)] and reagents_add [english_list_assoc(reagents_add)] and potency [potency].", INVESTIGATE_BOTANY) + while(t_amount < product_count) var/obj/item/reagent_containers/food/snacks/grown/t_prod if(instability >= 30 && (seed_flags & MUTATE_EARLY) && LAZYLEN(mutatelist) && prob(instability/3))