b
This commit is contained in:
@@ -380,7 +380,11 @@
|
||||
pestlevel = 0 // Reset
|
||||
update_icon()
|
||||
visible_message("<span class='warning'>The [oldPlantName] is overtaken by some [myseed.plantname]!</span>")
|
||||
|
||||
name = "hydroponics tray ([myseed.plantname])"
|
||||
if(myseed.product)
|
||||
desc = initial(myseed.product.desc)
|
||||
else
|
||||
desc = initial(desc)
|
||||
|
||||
/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) // Mutates the current seed
|
||||
if(!myseed)
|
||||
@@ -414,7 +418,11 @@
|
||||
sleep(5) // Wait a while
|
||||
update_icon()
|
||||
visible_message("<span class='warning'>[oldPlantName] suddenly mutates into [myseed.plantname]!</span>")
|
||||
|
||||
name = "hydroponics tray ([myseed.plantname])"
|
||||
if(myseed.product)
|
||||
desc = initial(myseed.product.desc)
|
||||
else
|
||||
desc = initial(desc)
|
||||
|
||||
/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant
|
||||
if( weedlevel > 5 )
|
||||
@@ -769,6 +777,15 @@
|
||||
to_chat(user, "<span class='notice'>You plant [O].</span>")
|
||||
dead = 0
|
||||
myseed = O
|
||||
name = "hydroponics tray ([myseed.plantname])"
|
||||
if(!myseed.productdesc) //we haven't changed our produce's description
|
||||
if(myseed.product)
|
||||
myseed.productdesc = initial(myseed.product.desc)
|
||||
else if(myseed.desc)
|
||||
myseed.productdesc = myseed.desc
|
||||
else
|
||||
myseed.productdesc = "A fascinating specimen."
|
||||
desc = myseed.productdesc
|
||||
age = 1
|
||||
plant_health = myseed.endurance
|
||||
lastcycle = world.time
|
||||
@@ -834,6 +851,8 @@
|
||||
harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
weedlevel = 0 //Has a side effect of cleaning up those nasty weeds
|
||||
update_icon()
|
||||
|
||||
@@ -866,6 +885,8 @@
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
update_icon()
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
else
|
||||
if(user)
|
||||
examine(user)
|
||||
@@ -883,6 +904,8 @@
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
dead = 0
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
update_icon()
|
||||
|
||||
/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds.///
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
resistance_flags = FLAMMABLE
|
||||
var/plantname = "Plants" // Name of plant when planted.
|
||||
var/product // A type path. The thing that is created when the plant is harvested.
|
||||
var/obj/item/product // A type path. The thing that is created when the plant is harvested.
|
||||
var/productdesc
|
||||
var/species = "" // Used to update icons. Should match the name in the sprites unless all icon_* are overridden.
|
||||
|
||||
var/growing_icon = 'icons/obj/hydroponics/growing.dmi' //the file that stores the sprites of the growing plant from this seed.
|
||||
@@ -69,6 +70,10 @@
|
||||
genes += new /datum/plant_gene/reagent(reag_id, reagents_add[reag_id])
|
||||
reagents_from_genes() //quality coding
|
||||
|
||||
/obj/item/seeds/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
|
||||
|
||||
/obj/item/seeds/proc/Copy()
|
||||
var/obj/item/seeds/S = new type(null, 1)
|
||||
// Copy all the stats
|
||||
@@ -80,6 +85,10 @@
|
||||
S.potency = potency
|
||||
S.weed_rate = weed_rate
|
||||
S.weed_chance = weed_chance
|
||||
S.name = name
|
||||
S.plantname = plantname
|
||||
S.desc = desc
|
||||
S.productdesc = productdesc
|
||||
S.genes = list()
|
||||
for(var/g in genes)
|
||||
var/datum/plant_gene/G = g
|
||||
@@ -157,11 +166,18 @@
|
||||
var/product_name
|
||||
while(t_amount < getYield())
|
||||
var/obj/item/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src)
|
||||
if(parent.myseed.plantname != initial(parent.myseed.plantname))
|
||||
t_prod.name = lowertext(parent.myseed.plantname)
|
||||
if(productdesc)
|
||||
t_prod.desc = productdesc
|
||||
t_prod.seed.name = parent.myseed.name
|
||||
t_prod.seed.desc = parent.myseed.desc
|
||||
t_prod.seed.plantname = parent.myseed.plantname
|
||||
result.Add(t_prod) // User gets a consumable
|
||||
if(!t_prod)
|
||||
return
|
||||
t_amount++
|
||||
product_name = t_prod.name
|
||||
product_name = parent.myseed.plantname
|
||||
if(getYield() >= 1)
|
||||
SSblackbox.record_feedback("tally", "food_harvested", getYield(), product_name)
|
||||
parent.update_tray(user)
|
||||
@@ -331,14 +347,56 @@
|
||||
to_chat(user, "<span class='notice'>[text]</span>")
|
||||
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/pen))
|
||||
var/choice = input("What would you like to change?") in list("Plant Name", "Seed Description", "Product Description", "Cancel")
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
switch(choice)
|
||||
if("Plant Name")
|
||||
var/newplantname = reject_bad_text(stripped_input(user, "Write a new plant name:", name, plantname))
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if (length(newplantname) > 20)
|
||||
to_chat(user, "That name is too long!")
|
||||
return
|
||||
if(!newplantname)
|
||||
to_chat(user, "That name is invalid.")
|
||||
return
|
||||
else
|
||||
name = "[lowertext(newplantname)]"
|
||||
plantname = newplantname
|
||||
if("Seed Description")
|
||||
var/newdesc = stripped_input(user, "Write a new description:", name, desc)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if (length(newdesc) > 180)
|
||||
to_chat(user, "That description is too long!")
|
||||
return
|
||||
if(!newdesc)
|
||||
to_chat(user, "That description is invalid.")
|
||||
return
|
||||
else
|
||||
desc = newdesc
|
||||
if("Product Description")
|
||||
if(product && !productdesc)
|
||||
productdesc = initial(product.desc)
|
||||
var/newproductdesc = stripped_input(user, "Write a new description:", name, productdesc)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if (length(newproductdesc) > 180)
|
||||
to_chat(user, "That description is too long!")
|
||||
return
|
||||
if(!newproductdesc)
|
||||
to_chat(user, "That description is invalid.")
|
||||
return
|
||||
else
|
||||
productdesc = newproductdesc
|
||||
else
|
||||
return
|
||||
|
||||
..() // Fallthrough to item/attackby() so that bags can pick seeds up
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Checks plants for broken tray icons. Use Advanced Proc Call to activate.
|
||||
// Maybe some day it would be used as unit test.
|
||||
/proc/check_plants_growth_stages_icons()
|
||||
|
||||
Reference in New Issue
Block a user