Soil is no longer called hydroponics tray when something is planted (#49304)

* Soil is no longer called hydroponics tray when something is planted

- Simplifies tray renaming and reduces the copypasted code by making it a proc
- Removes description changes, couldn't make them work grammatically with the plant name and they don't make sense on their own
- Makes soil PLURAL gender so it's referred to as some soil instead of a soil
- Removes unnecessary setting of a seed's productdesc when planting, it already gets that when customising it with a pen and that's the only time it's relevant
- Updates the tray name when weeds are mutated, which didn't used to happen

* uses a define instead of a proc
This commit is contained in:
cacogen
2020-02-13 10:39:52 +01:00
committed by GitHub
parent 19e781db18
commit 07eea73ae0
+9 -26
View File
@@ -1,3 +1,5 @@
#define TRAY_NAME_UPDATE name = myseed ? "[initial(name)] ([myseed.plantname])" : initial(name)
/obj/machinery/hydroponics
name = "hydroponics tray"
icon = 'icons/obj/hydroponics/equipment.dmi'
@@ -90,7 +92,6 @@
return connected
/obj/machinery/hydroponics/bullet_act(obj/projectile/Proj) //Works with the Somatoray to modify plant variables.
if(!myseed)
return ..()
@@ -388,12 +389,7 @@
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)
TRAY_NAME_UPDATE
/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)
@@ -427,12 +423,7 @@
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)
TRAY_NAME_UPDATE
/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant
if( weedlevel > 5 )
@@ -452,6 +443,7 @@
sleep(5) // Wait a while
update_icon()
visible_message("<span class='warning'>The mutated weeds in [src] spawn some [myseed.plantname]!</span>")
TRAY_NAME_UPDATE
else
to_chat(usr, "<span class='warning'>The few weeds in [src] seem to react, but only for a moment...</span>")
@@ -797,15 +789,7 @@
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
TRAY_NAME_UPDATE
age = 1
plant_health = myseed.endurance
lastcycle = world.time
@@ -907,8 +891,7 @@
qdel(myseed)
myseed = null
update_icon()
name = initial(name)
desc = initial(desc)
TRAY_NAME_UPDATE
else
if(user)
examine(user)
@@ -926,8 +909,7 @@
qdel(myseed)
myseed = null
dead = 0
name = initial(name)
desc = initial(desc)
TRAY_NAME_UPDATE
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.///
@@ -970,6 +952,7 @@
desc = "A patch of dirt."
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "soil"
gender = PLURAL
circuit = null
density = FALSE
use_power = NO_POWER_USE