mod
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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, "<span class='notice'>You plant [O].</span>")
|
||||
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
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user