diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index 7ffcfa0e7ce..ba7a1576828 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -365,4 +365,10 @@ var/list/bloody_footprints_cache = list()
//Gun trigger guards
#define TRIGGER_GUARD_ALLOW_ALL -1
#define TRIGGER_GUARD_NONE 0
-#define TRIGGER_GUARD_NORMAL 1
\ No newline at end of file
+#define TRIGGER_GUARD_NORMAL 1
+
+// Plant types
+#define PLANT_NORMAL 0
+#define PLANT_WEED 1
+#define PLANT_MUSHROOM 2
+#define PLANT_ALIEN 3
\ No newline at end of file
diff --git a/code/modules/awaymissions/mission_code/Cabin.dm b/code/modules/awaymissions/mission_code/Cabin.dm
index 2912a33f15e..e8c77ceb317 100644
--- a/code/modules/awaymissions/mission_code/Cabin.dm
+++ b/code/modules/awaymissions/mission_code/Cabin.dm
@@ -81,7 +81,7 @@
return
if(sound)
playsound(src.loc, 'sound/weapons/chainsawhit.ogg', 100, 1)
- new L.plank_type(src.loc, 1 + round(L.potency / 25))
+ new L.plank_type(src.loc, 1 + round(L.seed.potency / 25))
qdel(L)
/mob/living/simple_animal/chicken/rabbit/normal
diff --git a/code/modules/food&drinks/food/snacks.dm b/code/modules/food&drinks/food/snacks.dm
index cac9c7a6c51..5a90cc0d225 100644
--- a/code/modules/food&drinks/food/snacks.dm
+++ b/code/modules/food&drinks/food/snacks.dm
@@ -11,7 +11,6 @@
var/eatverb
var/wrapped = 0
var/dried_type = null
- var/potency = null
var/dry = 0
var/cooked_type = null //for microwave cooking. path of the resulting item after microwaving
var/filling_color = "#FFFFFF" //color to use when added to custom food.
@@ -28,8 +27,9 @@
usr.unEquip(src) //so icons update :[
if(trash)
- if(ispath(trash,/obj/item/weapon/grown))
- var/obj/item/TrashItem = new trash(usr,src.potency)
+ if(ispath(trash, /obj/item/weapon/grown) && istype(src, /obj/item/weapon/reagent_containers/food/snacks/grown))
+ var/obj/item/weapon/reagent_containers/food/snacks/grown/G = src
+ var/obj/item/TrashItem = new trash(usr, G.seed)
usr.put_in_hands(TrashItem)
else if(ispath(trash,/obj/item))
var/obj/item/TrashItem = new trash(usr)
diff --git a/code/modules/food&drinks/kitchen machinery/juicer.dm b/code/modules/food&drinks/kitchen machinery/juicer.dm
index 62349b8f825..492486a504e 100644
--- a/code/modules/food&drinks/kitchen machinery/juicer.dm
+++ b/code/modules/food&drinks/kitchen machinery/juicer.dm
@@ -148,10 +148,10 @@
/obj/machinery/juicer/proc/get_juice_amount(obj/item/weapon/reagent_containers/food/snacks/grown/O)
if (!istype(O))
return 5
- else if (O.potency == -1)
+ else if (O.seed.potency == -1)
return 5
else
- return round(5*sqrt(O.potency))
+ return round(5*sqrt(O.seed.potency))
/obj/machinery/juicer/proc/juice()
power_change() //it is a portable machine
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index a55a1ef0116..20957c309bc 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -3,62 +3,44 @@
// Data from the seeds carry over to these grown foods
// ***********************************************************
-// Base type. Subtypes are found in /grown.
+// Base type. Subtypes are found in /grown dir.
/obj/item/weapon/reagent_containers/food/snacks/grown
icon = 'icons/obj/hydroponics/harvest.dmi'
- var/seed = null
+ var/obj/item/seeds/seed = null // type path, gets converted to item on New(). It's safe to assume it's always a seed item.
var/plantname = ""
- var/product //a type path
- var/lifespan = 0
- var/endurance = 0
- var/maturation = 0
- var/production = 0
- var/yield = 0
- var/plant_type = 0
var/bitesize_mod = 0
// If set, bitesize = 1 + round(reagents.total_volume / bitesize_mod)
- var/list/reagents_add = list()
- // A list of reagents to add.
- // Format: "reagent_id" = potency multiplier
- // Stronger reagents must always come first to avoid being displaced by weaker ones.
- // Total amount of any reagent in plant is calculated by formula: 1 + round(potency * multiplier)
- potency = -1
dried_type = -1
// Saves us from having to define each stupid grown's dried_type as itself.
// If you don't want a plant to be driable (watermelons) set this to null in the time definition.
burn_state = FLAMMABLE
-/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc, new_potency = 50)
+/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc, var/obj/item/seeds/new_seed = null)
..()
- potency = new_potency
+ if(new_seed)
+ seed = new_seed.Copy()
+ else if(ispath(seed))
+ // This is for adminspawn or map-placed growns. They get the default stats of their seed type.
+ seed = new seed()
+ seed.potency = 50
+ seed.prepare_result(src)
+ else // Something is terribly wrong
+ qdel(src)
+ return
+
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
if(dried_type == -1)
dried_type = src.type
- if(seed && lifespan == 0)
- // This is for adminspawn or map-placed growns. They get the default stats of their seed type. This feels like a hack but people insist on putting these things on the map...
- var/obj/item/seeds/S = new seed(src)
- lifespan = S.lifespan
- endurance = S.endurance
- maturation = S.maturation
- production = S.production
- yield = S.yield
- qdel(S) //Foods drop their contents when eaten, so delete the default seed.
-
add_juice()
- transform *= TransformUsingVariable(potency, 100, 0.5) //Makes the resulting produce's sprite larger or smaller based on potency!
+ transform *= TransformUsingVariable(seed.potency, 100, 0.5) //Makes the resulting produce's sprite larger or smaller based on potency!
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/add_juice()
if(reagents)
- for(var/reagent_id in reagents_add)
- if(reagent_id == "blood") // Hack to make blood in plants always O-
- reagents.add_reagent(reagent_id, 1 + round(potency * reagents_add[reagent_id]), list("blood_type"="O-"))
- continue
- reagents.add_reagent(reagent_id, 1 + round(potency * reagents_add[reagent_id]))
if(bitesize_mod)
bitesize = 1 + round(reagents.total_volume / bitesize_mod)
return 1
@@ -67,46 +49,38 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(obj/item/O, mob/user, params)
..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
- var/msg
- msg = "*---------*\n This is \a [src]\n"
- switch(plant_type)
- if(0)
- msg += "- Plant type: Normal plant\n"
- if(1)
- msg += "- Plant type: Weed. Can grow in nutrient-poor soil.\n"
- if(2)
- msg += "- Plant type: Mushroom. Can grow in dry soil.\n"
- else
- msg += "- Plant type: UNKNOWN. \n"
- msg += "- Potency: [potency]\n"
- msg += "- Yield: [yield]\n"
- msg += "- Maturation speed: [maturation]\n"
- msg += "- Production speed: [production]\n"
- msg += "- Endurance: [endurance]\n"
- msg += "- Nutritional value: [reagents.get_reagent_amount("nutriment")]\n"
- msg += "- Other substances: [reagents.total_volume-reagents.get_reagent_amount("nutriment")]\n"
+ var/msg = "*---------*\n This is \a [src].\n"
+ msg += seed.get_analyzer_text()
+ msg += "\n- Nutritional value: [reagents.get_reagent_amount("nutriment")]\n"
+ msg += "- Other substances: [reagents.total_volume-reagents.get_reagent_amount("nutriment")]\n"
msg += "*---------*"
var/list/scannable_reagents = list("charcoal" = "Anti-Toxin", "morphine" = "Morphine", "amatoxin" = "Amatoxins",
"toxin" = "Toxins", "mushroomhallucinogen" = "Mushroom Hallucinogen", "condensedcapsaicin" = "Condensed Capsaicin",
- "capsaicin" = "Capsaicin", "frostoil" = "Frost Oil", "gold" = "Mineral Content",
+ "capsaicin" = "Capsaicin", "frostoil" = "Frost Oil", "gold" = "Mineral Content", "glycerol" = "Glycerol",
"radium" = "Highly Radioactive Material", "uranium" = "Radioactive Material")
var/reag_txt = ""
for(var/reagent_id in scannable_reagents)
- if(reagent_id in reagents_add)
+ if(reagent_id in seed.reagents_add)
var/amt = reagents.get_reagent_amount(reagent_id)
- reag_txt += "- [scannable_reagents[reagent_id]]: [amt*100/reagents.maximum_volume]%\n"
+ reag_txt += "\n- [scannable_reagents[reagent_id]]: [amt*100/reagents.maximum_volume]%"
- user << msg
if(reag_txt)
- user << reag_txt
- user << "*---------*"
+ msg += reag_txt
+ msg += "*---------*"
+ user << msg
return
return
-
+// For item-containing growns such as eggy or gatfruit
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/attack_self(mob/user as mob)
- if(trash)
- new trash(user.loc)
user.unEquip(src)
+ if(trash)
+ var/obj/item/weapon/T
+ if(ispath(trash, /obj/item/weapon/grown))
+ T = new trash(user.loc, seed)
+ else
+ T = new trash(user.loc)
+ user.put_in_hands(T)
+ user << "You open [src]\'s shell, revealing [T]."
qdel(src)
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/ambrosia.dm b/code/modules/hydroponics/grown/ambrosia.dm
index 7d94f6cf3cc..65a6a33772d 100644
--- a/code/modules/hydroponics/grown/ambrosia.dm
+++ b/code/modules/hydroponics/grown/ambrosia.dm
@@ -1,12 +1,11 @@
// Ambrosia - base type
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia
+ seed = /obj/item/seeds/ambrosia
name = "ambrosia branch"
desc = "This is a plant."
icon_state = "ambrosiavulgaris"
slot_flags = SLOT_HEAD
filling_color = "#008000"
- reagents_add = list("nutriment" = 0)
- // It means 1 nutriment no matter how low or high potency is
bitesize_mod = 2
// Ambrosia Vulgaris
@@ -21,13 +20,14 @@
endurance = 25
yield = 6
potency = 5
+ icon_dead = "ambrosia-dead"
mutatelist = list(/obj/item/seeds/ambrosia/deus)
+ reagents_add = list("space_drugs" = 0.15, "salglu_solution" = 0.25, "vitamin" = 0.04, "nutriment" = 0, "toxin" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/vulgaris
seed = /obj/item/seeds/ambrosia
name = "ambrosia vulgaris branch"
desc = "This is a plant containing various healing chemicals."
- reagents_add = list("space_drugs" = 0.15, "salglu_solution" = 0.25, "vitamin" = 0.04, "nutriment" = 0, "toxin" = 0.1)
// Ambrosia Deus
/obj/item/seeds/ambrosia/deus
@@ -38,6 +38,7 @@
plantname = "Ambrosia Deus"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus
mutatelist = list()
+ reagents_add = list("omnizine" = 0.15, "synaptizine" = 0.15, "space_drugs" = 0.1, "vitamin" = 0.04, "nutriment" = 0)
rarity = 40
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus
@@ -45,5 +46,4 @@
name = "ambrosia deus branch"
desc = "Eating this makes you feel immortal!"
icon_state = "ambrosiadeus"
- filling_color = "#008B8B"
- reagents_add = list("omnizine" = 0.15, "synaptizine" = 0.15, "space_drugs" = 0.1, "vitamin" = 0.04, "nutriment" = 0)
\ No newline at end of file
+ filling_color = "#008B8B"
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/apple.dm b/code/modules/hydroponics/grown/apple.dm
index 27386796006..5deafac82fb 100644
--- a/code/modules/hydroponics/grown/apple.dm
+++ b/code/modules/hydroponics/grown/apple.dm
@@ -9,7 +9,10 @@
lifespan = 55
endurance = 35
yield = 5
+ icon_grow = "apple-grow"
+ icon_dead = "apple-dead"
mutatelist = list(/obj/item/seeds/apple/gold)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/apple
seed = /obj/item/seeds/apple
@@ -17,18 +20,17 @@
desc = "It's a little piece of Eden."
icon_state = "apple"
filling_color = "#FF4500"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
bitesize = 100 // Always eat the apple in one bite
// Posioned Apple
/obj/item/seeds/apple/poisoned
product = /obj/item/weapon/reagent_containers/food/snacks/grown/apple/poisoned
mutatelist = list()
+ reagents_add = list("cyanide" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
rarity = 50 // Source of cyanide, and hard (almost impossible) to obtain normally.
/obj/item/weapon/reagent_containers/food/snacks/grown/apple/poisoned
seed = /obj/item/seeds/apple/poisoned
- reagents_add = list("cyanide" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
// Gold Apple
/obj/item/seeds/apple/gold
@@ -41,6 +43,7 @@
maturation = 10
production = 10
mutatelist = list()
+ reagents_add = list("gold" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
rarity = 40 // Alchemy!
/obj/item/weapon/reagent_containers/food/snacks/grown/apple/gold
@@ -48,5 +51,4 @@
name = "golden apple"
desc = "Emblazoned upon the apple is the word 'Kallisti'."
icon_state = "goldapple"
- filling_color = "#FFD700"
- reagents_add = list("gold" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
\ No newline at end of file
+ filling_color = "#FFD700"
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/banana.dm b/code/modules/hydroponics/grown/banana.dm
index dca7b0f5de9..0af64abeb50 100644
--- a/code/modules/hydroponics/grown/banana.dm
+++ b/code/modules/hydroponics/grown/banana.dm
@@ -8,18 +8,18 @@
product = /obj/item/weapon/reagent_containers/food/snacks/grown/banana
lifespan = 50
endurance = 30
+ icon_dead = "banana-dead"
mutatelist = list(/obj/item/seeds/banana/mime, /obj/item/seeds/banana/bluespace)
+ reagents_add = list("banana" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
/obj/item/weapon/reagent_containers/food/snacks/grown/banana
seed = /obj/item/seeds/banana
name = "banana"
desc = "It's an excellent prop for a clown."
- icon = 'icons/obj/items.dmi'
icon_state = "banana"
item_state = "banana"
trash = /obj/item/weapon/grown/bananapeel
filling_color = "#FFFF00"
- reagents_add = list("banana" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
bitesize = 5
/obj/item/weapon/reagent_containers/food/snacks/grown/banana/suicide_act(mob/user)
@@ -36,7 +36,7 @@
return (OXYLOSS)
-// Mimana
+// Mimana - invisible sprites are totally a feature!
/obj/item/seeds/banana/mime
name = "pack of mimana seeds"
desc = "They're seeds that grow into mimana trees. When grown, keep away from mime."
@@ -44,7 +44,9 @@
species = "mimana"
plantname = "Mimana Tree"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/banana/mime
+ growthstages = 4
mutatelist = list()
+ reagents_add = list("nothing" = 0.1, "mutetoxin" = 0.1, "nutriment" = 0.02)
rarity = 15
/obj/item/weapon/reagent_containers/food/snacks/grown/banana/mime
@@ -54,7 +56,6 @@
icon_state = "mimana"
trash = /obj/item/weapon/grown/bananapeel/mimanapeel
filling_color = "#FFFFEE"
- reagents_add = list("nothing" = 0.1, "mutetoxin" = 0.1, "nutriment" = 0.02)
// Bluespace Banana
@@ -63,9 +64,11 @@
desc = "They're seeds that grow into bluespace banana trees. When grown, keep away from bluespace clown."
icon_state = "seed-banana-blue"
species = "bluespacebanana"
+ icon_grow = "banana-grow"
plantname = "Bluespace Banana Tree"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/banana/bluespace
mutatelist = list()
+ reagents_add = list("singulo" = 0.2, "banana" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
rarity = 30
/obj/item/weapon/reagent_containers/food/snacks/grown/banana/bluespace
@@ -75,7 +78,6 @@
trash = /obj/item/weapon/grown/bananapeel/bluespace
filling_color = "#0000FF"
origin_tech = "bluespace=3"
- reagents_add = list("singulo" = 0.2, "banana" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02)
@@ -84,7 +86,6 @@
/obj/item/weapon/grown/bananapeel
name = "banana peel"
desc = "A peel from a banana."
- icon = 'icons/obj/items.dmi'
icon_state = "banana_peel"
item_state = "banana_peel"
w_class = 1
@@ -100,23 +101,24 @@
/obj/item/weapon/grown/bananapeel/Crossed(AM as mob|obj)
if (istype(AM, /mob/living/carbon))
var/mob/living/carbon/M = AM
- var/stun = Clamp(potency / 10, 1, 10)
- var/weaken = Clamp(potency / 20, 0.5, 5)
+ var/stun = Clamp(seed.potency / 10, 1, 10)
+ var/weaken = Clamp(seed.potency / 20, 0.5, 5)
M.slip(stun, weaken, src)
return 1
/obj/item/weapon/grown/bananapeel/bluespace
name = "bluespace banana peel"
desc = "A peel from a bluespace banana."
- icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "banana_peel_blue"
origin_tech = "bluespace=3"
/obj/item/weapon/grown/bananapeel/bluespace/Crossed(AM)
if(..())
- var/teleport_radius = potency / 10
+ var/teleport_radius = max(round(seed.potency / 10), 1)
+
do_teleport(AM, get_turf(AM), teleport_radius)
AM << "You slip through spacetime!"
+
if(prob(50))
do_teleport(src, get_turf(src), teleport_radius)
else
@@ -133,5 +135,4 @@
/obj/item/weapon/grown/bananapeel/mimanapeel
name = "mimana peel"
desc = "A mimana peel."
- icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "mimana_peel"
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/beans.dm b/code/modules/hydroponics/grown/beans.dm
index 298f5ac86cf..ac7def35c74 100644
--- a/code/modules/hydroponics/grown/beans.dm
+++ b/code/modules/hydroponics/grown/beans.dm
@@ -10,7 +10,10 @@
production = 4
potency = 15
growthstages = 4
+ icon_grow = "soybean-grow"
+ icon_dead = "soybean-dead"
mutatelist = list(/obj/item/seeds/soya/koi)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans
seed = /obj/item/seeds/soya
@@ -19,7 +22,6 @@
gender = PLURAL
icon_state = "soybeans"
filling_color = "#F0E68C"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
bitesize_mod = 2
// Koibean
@@ -27,11 +29,12 @@
name = "pack of koibean seeds"
desc = "These seeds grow into koibean plants."
icon_state = "seed-koibean"
- species = "soybean"
+ species = "koibean"
plantname = "Koibean Plants"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/koibeans
- mutatelist = list()
potency = 10
+ mutatelist = list()
+ reagents_add = list("carpotoxin" = 0.05, "vitamin" = 0.04, "nutriment" = 0.05)
rarity = 20
/obj/item/weapon/reagent_containers/food/snacks/grown/koibeans
@@ -40,5 +43,4 @@
desc = "Something about these seems fishy."
icon_state = "koibeans"
filling_color = "#F0E68C"
- reagents_add = list("carpotoxin" = 0.05, "vitamin" = 0.04, "nutriment" = 0.05)
bitesize_mod = 2
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/berries.dm b/code/modules/hydroponics/grown/berries.dm
index 4628e52e3e6..35c143d8fe5 100644
--- a/code/modules/hydroponics/grown/berries.dm
+++ b/code/modules/hydroponics/grown/berries.dm
@@ -10,7 +10,10 @@
maturation = 5
production = 5
yield = 2
+ icon_grow = "berry-grow" // Uses one growth icons set for all the subtypes
+ icon_dead = "berry-dead" // Same for the dead icon
mutatelist = list(/obj/item/seeds/berry/glow, /obj/item/seeds/berry/poison)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/berries
seed = /obj/item/seeds/berry
@@ -19,7 +22,6 @@
icon_state = "berrypile"
gender = PLURAL
filling_color = "#FF00FF"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
bitesize_mod = 2
// Poison Berries
@@ -31,6 +33,7 @@
plantname = "Poison-Berry Bush"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/berries/poison
mutatelist = list(/obj/item/seeds/berry/death)
+ reagents_add = list("toxin" = 0.25, "vitamin" = 0.04, "nutriment" = 0.1)
rarity = 10 // Mildly poisonous berries are common in reality
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/poison
@@ -39,7 +42,6 @@
desc = "Taste so good, you could die!"
icon_state = "poisonberrypile"
filling_color = "#C71585"
- reagents_add = list("toxin" = 0.25, "vitamin" = 0.04, "nutriment" = 0.1)
// Death Berries
/obj/item/seeds/berry/death
@@ -52,6 +54,7 @@
lifespan = 30
potency = 50
mutatelist = list()
+ reagents_add = list("lexorin" = 0.25, "toxin" = 0.35, "vitamin" = 0.04, "nutriment" = 0.1)
rarity = 30
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/death
@@ -60,7 +63,6 @@
desc = "Taste so good, you could die!"
icon_state = "deathberrypile"
filling_color = "#708090"
- reagents_add = list("lexorin" = 0.25, "toxin" = 0.35, "vitamin" = 0.04, "nutriment" = 0.1)
// Glow Berries
/obj/item/seeds/berry/glow
@@ -73,6 +75,7 @@
lifespan = 30
endurance = 25
mutatelist = list()
+ reagents_add = list("uranium" = 0.25, "vitamin" = 0.04, "nutriment" = 0.1)
rarity = 20
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow
@@ -83,22 +86,21 @@
var/brightness_on = 2 //luminosity when on
icon_state = "glowberrypile"
filling_color = "#7CFC00"
- reagents_add = list("uranium" = 0.25, "vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow/Destroy()
if(istype(loc,/mob))
- loc.AddLuminosity(round(-potency / 5))
+ loc.AddLuminosity(round(-seed.potency / 5))
return ..()
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow/pickup(mob/user)
..()
src.SetLuminosity(0)
- user.AddLuminosity(round(potency / 5))
+ user.AddLuminosity(round(seed.potency / 5))
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow/dropped(mob/user)
..()
- user.AddLuminosity(round(-potency / 5))
- src.SetLuminosity(round(potency / 5))
+ user.AddLuminosity(round(-seed.potency / 5))
+ src.SetLuminosity(round(seed.potency / 5))
// Cherries
@@ -114,7 +116,10 @@
maturation = 5
production = 5
growthstages = 5
+ icon_grow = "cherry-grow"
+ icon_dead = "cherry-dead"
mutatelist = list(/obj/item/seeds/cherry/blue)
+ reagents_add = list("nutriment" = 0.07, "sugar" = 0.07)
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries
seed = /obj/item/seeds/cherry
@@ -123,7 +128,6 @@
icon_state = "cherry"
gender = PLURAL
filling_color = "#FF0000"
- reagents_add = list("nutriment" = 0.07, "sugar" = 0.07)
bitesize_mod = 2
// Blue Cherries
@@ -143,7 +147,6 @@
desc = "They're cherries that are blue."
icon_state = "bluecherry"
filling_color = "#6495ED"
- reagents_add = list("nutriment" = 0.07, "sugar" = 0.07)
bitesize_mod = 2
@@ -161,7 +164,10 @@
production = 5
yield = 4
growthstages = 2
+ icon_grow = "grape-grow"
+ icon_dead = "grape-dead"
mutatelist = list(/obj/item/seeds/grape/green)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes
seed = /obj/item/seeds/grape
@@ -170,7 +176,6 @@
icon_state = "grapes"
dried_type = /obj/item/weapon/reagent_containers/food/snacks/no_raisin
filling_color = "#FF1493"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1)
bitesize_mod = 2
// Green Grapes
@@ -181,6 +186,7 @@
species = "greengrape"
plantname = "Green-Grape Vine"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/grapes/green
+ reagents_add = list("salglu_solution" = 0.25, "vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1)
// No rarity: technically it's a beneficial mutant, but it's not exactly "new"...
mutatelist = list()
@@ -188,5 +194,4 @@
seed = /obj/item/seeds/grape/green
name = "bunch of green grapes"
icon_state = "greengrapes"
- filling_color = "#7FFF00"
- reagents_add = list("salglu_solution" = 0.25, "vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1)
\ No newline at end of file
+ filling_color = "#7FFF00"
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/cereals.dm b/code/modules/hydroponics/grown/cereals.dm
index 8835d45d1ac..8b6274c4e09 100644
--- a/code/modules/hydroponics/grown/cereals.dm
+++ b/code/modules/hydroponics/grown/cereals.dm
@@ -10,7 +10,9 @@
yield = 4
potency = 15
oneharvest = 1
+ icon_dead = "wheat-dead"
mutatelist = list(/obj/item/seeds/wheat/oat)
+ reagents_add = list("nutriment" = 0.04)
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat
seed = /obj/item/seeds/wheat
@@ -20,7 +22,6 @@
icon_state = "wheat"
filling_color = "#F0E68C"
bitesize_mod = 2
- reagents_add = list("nutriment" = 0.04)
// Oat
/obj/item/seeds/wheat/oat
@@ -40,7 +41,6 @@
icon_state = "oat"
filling_color = "#556B2F"
bitesize_mod = 2
- reagents_add = list("nutriment" = 0.04)
// Rice
/obj/item/seeds/wheat/rice
@@ -60,5 +60,4 @@
gender = PLURAL
icon_state = "rice"
filling_color = "#FAFAD2"
- bitesize_mod = 2
- reagents_add = list("nutriment" = 0.04)
\ No newline at end of file
+ bitesize_mod = 2
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/chili.dm b/code/modules/hydroponics/grown/chili.dm
index 6bd2ecc76f6..707b92e4ee8 100644
--- a/code/modules/hydroponics/grown/chili.dm
+++ b/code/modules/hydroponics/grown/chili.dm
@@ -11,7 +11,10 @@
production = 5
yield = 4
potency = 20
+ icon_grow = "chili-grow" // Uses one growth icons set for all the subtypes
+ icon_dead = "chili-dead" // Same for the dead icon
mutatelist = list(/obj/item/seeds/chili/ice, /obj/item/seeds/chili/ghost)
+ reagents_add = list("capsaicin" = 0.25, "vitamin" = 0.04, "nutriment" = 0.04)
/obj/item/weapon/reagent_containers/food/snacks/grown/chili
seed = /obj/item/seeds/chili
@@ -19,7 +22,6 @@
desc = "It's spicy! Wait... IT'S BURNING ME!!"
icon_state = "chilipepper"
filling_color = "#FF0000"
- reagents_add = list("capsaicin" = 0.25, "vitamin" = 0.04, "nutriment" = 0.04)
bitesize_mod = 2
// Ice Chili
@@ -35,6 +37,7 @@
production = 4
rarity = 20
mutatelist = list()
+ reagents_add = list("frostoil" = 0.25, "vitamin" = 0.02, "nutriment" = 0.02)
/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper
seed = /obj/item/seeds/chili/ice
@@ -42,7 +45,6 @@
desc = "It's a mutant strain of chili"
icon_state = "icepepper"
filling_color = "#0000CD"
- reagents_add = list("frostoil" = 0.25, "vitamin" = 0.02, "nutriment" = 0.02)
bitesize_mod = 2
// Ghost Chili
@@ -59,6 +61,7 @@
yield = 3
rarity = 20
mutatelist = list()
+ reagents_add = list("condensedcapsaicin" = 0.3, "capsaicin" = 0.55, "nutriment" = 0.04)
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili
seed = /obj/item/seeds/chili/ghost
@@ -67,7 +70,6 @@
icon_state = "ghostchilipepper"
var/mob/held_mob
filling_color = "#F8F8FF"
- reagents_add = list("condensedcapsaicin" = 0.3, "capsaicin" = 0.55, "nutriment" = 0.04)
bitesize_mod = 4
/obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili/attack_hand(mob/user)
diff --git a/code/modules/hydroponics/grown/citrus.dm b/code/modules/hydroponics/grown/citrus.dm
index 188bcbc9bb0..7f5bc5e7f27 100644
--- a/code/modules/hydroponics/grown/citrus.dm
+++ b/code/modules/hydroponics/grown/citrus.dm
@@ -4,7 +4,6 @@
name = "citrus"
desc = "It's so sour, your face will twist."
icon_state = "lime"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
bitesize_mod = 2
// Lime
@@ -20,6 +19,7 @@
yield = 4
potency = 15
mutatelist = list(/obj/item/seeds/orange)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lime
seed = /obj/item/seeds/lime
@@ -40,7 +40,10 @@
endurance = 50
yield = 5
potency = 20
+ icon_grow = "lime-grow"
+ icon_dead = "lime-dead"
mutatelist = list(/obj/item/seeds/lime)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/orange
seed = /obj/item/seeds/orange
@@ -60,7 +63,10 @@
lifespan = 55
endurance = 45
yield = 4
+ icon_grow = "lime-grow"
+ icon_dead = "lime-dead"
mutatelist = list(/obj/item/seeds/cash)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lemon
seed = /obj/item/seeds/lemon
@@ -77,9 +83,12 @@
species = "cashtree"
plantname = "Money Tree"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/shell/moneyfruit
+ icon_grow = "lime-grow"
+ icon_dead = "lime-dead"
lifespan = 55
endurance = 45
yield = 4
+ reagents_add = list("nutriment" = 0.05)
rarity = 50 // Nanotrasen approves...
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/moneyfruit
@@ -87,12 +96,11 @@
name = "Money Fruit"
desc = "Looks like a lemon with someone buldging from the inside."
icon_state = "moneyfruit"
- reagents_add = list("nutriment" = 0.05)
bitesize_mod = 2
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/moneyfruit/add_juice()
..()
- switch(potency)
+ switch(seed.potency)
if(0 to 10)
trash = /obj/item/stack/spacecash
if(11 to 20)
diff --git a/code/modules/hydroponics/grown/cocoa_vanilla.dm b/code/modules/hydroponics/grown/cocoa_vanilla.dm
index b414540d35c..54ee9db28bc 100644
--- a/code/modules/hydroponics/grown/cocoa_vanilla.dm
+++ b/code/modules/hydroponics/grown/cocoa_vanilla.dm
@@ -11,7 +11,10 @@
production = 5
yield = 2
growthstages = 5
+ icon_grow = "cocoapod-grow"
+ icon_dead = "cocoapod-dead"
mutatelist = list(/obj/item/seeds/cocoapod/vanillapod)
+ reagents_add = list("cocoa" = 0.25, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod
seed = /obj/item/seeds/cocoapod
@@ -19,7 +22,6 @@
desc = "Fattening... Mmmmm... chucklate."
icon_state = "cocoapod"
filling_color = "#FFD700"
- reagents_add = list("cocoa" = 0.25, "nutriment" = 0.1)
bitesize_mod = 2
// Vanilla Pod
@@ -31,11 +33,11 @@
plantname = "Vanilla Tree"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/vanillapod
mutatelist = list()
+ reagents_add = list("vanilla" = 0.25, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/vanillapod
seed = /obj/item/seeds/cocoapod/vanillapod
name = "vanilla pod"
desc = "Fattening... Mmmmm... vanilla."
icon_state = "vanillapod"
- filling_color = "#FFD700"
- reagents_add = list("vanilla" = 0.25, "nutriment" = 0.1)
\ No newline at end of file
+ filling_color = "#FFD700"
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/corn.dm b/code/modules/hydroponics/grown/corn.dm
index 69613489e56..a8d4b54a027 100644
--- a/code/modules/hydroponics/grown/corn.dm
+++ b/code/modules/hydroponics/grown/corn.dm
@@ -10,7 +10,10 @@
oneharvest = 1
potency = 20
growthstages = 3
+ icon_grow = "corn-grow" // Uses one growth icons set for all the subtypes
+ icon_dead = "corn-dead" // Same for the dead icon
mutatelist = list(/obj/item/seeds/corn/snapcorn)
+ reagents_add = list("cornoil" = 0.1, "vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/corn
seed = /obj/item/seeds/corn
@@ -20,7 +23,6 @@
cooked_type = /obj/item/weapon/reagent_containers/food/snacks/popcorn
filling_color = "#FFFF00"
trash = /obj/item/weapon/grown/corncob
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
bitesize_mod = 2
/obj/item/weapon/grown/corncob
@@ -67,7 +69,7 @@
/obj/item/weapon/grown/snapcorn/add_juice()
..()
- snap_pops = max(round(potency/8), 1)
+ snap_pops = max(round(seed.potency/8), 1)
/obj/item/weapon/grown/snapcorn/attack_self(mob/user)
..()
diff --git a/code/modules/hydroponics/grown/eggplant.dm b/code/modules/hydroponics/grown/eggplant.dm
index 2fc972992a0..f99d07ff4d7 100644
--- a/code/modules/hydroponics/grown/eggplant.dm
+++ b/code/modules/hydroponics/grown/eggplant.dm
@@ -8,7 +8,10 @@
product = /obj/item/weapon/reagent_containers/food/snacks/grown/eggplant
yield = 2
potency = 20
+ icon_grow = "eggplant-grow"
+ icon_dead = "eggplant-dead"
mutatelist = list(/obj/item/seeds/eggplant/eggy)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant
seed = /obj/item/seeds/eggplant
@@ -16,7 +19,6 @@
desc = "Maybe there's a chicken inside?"
icon_state = "eggplant"
filling_color = "#800080"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
bitesize_mod = 2
// Egg-Plant
@@ -28,7 +30,7 @@
lifespan = 75
production = 12
mutatelist = list()
- // No rarity: Centcom ships these to us in the exotic seeds crate.
+ reagents_add = list("nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/eggy
seed = /obj/item/seeds/eggplant/eggy
@@ -37,5 +39,4 @@
icon_state = "eggyplant"
trash = /obj/item/weapon/reagent_containers/food/snacks/egg
filling_color = "#F8F8FF"
- reagents_add = list("nutriment" = 0.1)
bitesize_mod = 2
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/flowers.dm b/code/modules/hydroponics/grown/flowers.dm
index ec0f0e7a493..46055517c82 100644
--- a/code/modules/hydroponics/grown/flowers.dm
+++ b/code/modules/hydroponics/grown/flowers.dm
@@ -12,7 +12,10 @@
potency = 20
oneharvest = 1
growthstages = 3
+ icon_grow = "poppy-grow"
+ icon_dead = "poppy-dead"
mutatelist = list(/obj/item/seeds/poppy/geranium, /obj/item/seeds/poppy/lily)
+ reagents_add = list("salglu_solution" = 0.05, "nutriment" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/poppy
seed = /obj/item/seeds/poppy
@@ -21,7 +24,6 @@
icon_state = "poppy"
slot_flags = SLOT_HEAD
filling_color = "#FF6347"
- reagents_add = list("salglu_solution" = 0.05, "nutriment" = 0.05)
bitesize_mod = 3
// Lily
@@ -75,7 +77,8 @@
potency = 30
oneharvest = 1
growthstages = 4
- plant_type = 1
+ plant_type = PLANT_WEED
+ reagents_add = list("nutriment" = 0.04)
/obj/item/weapon/reagent_containers/food/snacks/grown/harebell
seed = /obj/item/seeds/harebell
@@ -84,31 +87,9 @@
icon_state = "harebell"
slot_flags = SLOT_HEAD
filling_color = "#E6E6FA"
- reagents_add = list("nutriment" = 0.05)
bitesize_mod = 3
-// Moonflower
-/obj/item/seeds/sunflower/moonflower
- name = "pack of moonflower seeds"
- desc = "These seeds grow into moonflowers."
- icon_state = "seed-moonflower"
- species = "moonflower"
- plantname = "Moonflowers"
- product = /obj/item/weapon/reagent_containers/food/snacks/grown/moonflower
- mutatelist = list()
- rarity = 15
-
-/obj/item/weapon/reagent_containers/food/snacks/grown/moonflower
- seed = /obj/item/seeds/sunflower/moonflower
- name = "moonflower"
- desc = "Store in a location at least 50 yards away from werewolves."
- icon_state = "moonflower"
- slot_flags = SLOT_HEAD
- filling_color = "#E6E6FA"
- reagents_add = list("moonshine" = 0.1, "vitamin" = 0.02, "nutriment" = 0.02)
- bitesize_mod = 2
-
// Sunflower
/obj/item/seeds/sunflower
name = "pack of sunflower seeds"
@@ -122,7 +103,10 @@
yield = 2
oneharvest = 1
growthstages = 3
+ icon_grow = "sunflower-grow"
+ icon_dead = "sunflower-dead"
mutatelist = list(/obj/item/seeds/sunflower/moonflower, /obj/item/seeds/sunflower/novaflower)
+ reagents_add = list("cornoil" = 0.08, "nutriment" = 0.04)
/obj/item/weapon/grown/sunflower // FLOWER POWER!
seed = /obj/item/seeds/sunflower
@@ -141,6 +125,27 @@
M << " [user] smacks you with a sunflower!FLOWER POWER"
user << "Your sunflower's FLOWER POWERstrikes [M]"
+// Moonflower
+/obj/item/seeds/sunflower/moonflower
+ name = "pack of moonflower seeds"
+ desc = "These seeds grow into moonflowers."
+ icon_state = "seed-moonflower"
+ species = "moonflower"
+ plantname = "Moonflowers"
+ product = /obj/item/weapon/reagent_containers/food/snacks/grown/moonflower
+ mutatelist = list()
+ reagents_add = list("moonshine" = 0.1, "vitamin" = 0.02, "nutriment" = 0.02)
+ rarity = 15
+
+/obj/item/weapon/reagent_containers/food/snacks/grown/moonflower
+ seed = /obj/item/seeds/sunflower/moonflower
+ name = "moonflower"
+ desc = "Store in a location at least 50 yards away from werewolves."
+ icon_state = "moonflower"
+ slot_flags = SLOT_HEAD
+ filling_color = "#E6E6FA"
+ bitesize_mod = 2
+
// Novaflower
/obj/item/seeds/sunflower/novaflower
name = "pack of novaflower seeds"
@@ -150,6 +155,7 @@
plantname = "Novaflowers"
product = /obj/item/weapon/grown/novaflower
mutatelist = list()
+ reagents_add = list("condensedcapsaicin" = 0.25, "capsaicin" = 0.3, "nutriment" = 0)
rarity = 20
/obj/item/weapon/grown/novaflower
@@ -164,27 +170,23 @@
w_class = 1
throw_speed = 1
throw_range = 3
- plant_type = 0
attack_verb = list("roasted", "scorched", "burned")
/obj/item/weapon/grown/novaflower/add_juice()
- if(..())
- reagents.add_reagent("nutriment", 1)
- reagents.add_reagent("capsaicin", round((potency / 3.5), 1))
- reagents.add_reagent("condensedcapsaicin", round((potency / 4), 1))
- force = round((5 + potency / 5), 1)
+ ..()
+ force = round((5 + seed.potency / 5), 1)
/obj/item/weapon/grown/novaflower/attack(mob/living/carbon/M, mob/user)
if(!..()) return
if(istype(M, /mob/living))
M << "You are lit on fire from the intense heat of the [name]!"
- M.adjust_fire_stacks(potency / 20)
+ M.adjust_fire_stacks(seed.potency / 20)
M.IgniteMob()
/obj/item/weapon/grown/novaflower/afterattack(atom/A as mob|obj, mob/user,proximity)
if(!proximity) return
- if(endurance > 0)
- endurance -= rand(1, (endurance / 3) + 1)
+ if(force > 0)
+ force -= rand(1, (force / 3) + 1)
else
usr << "All the petals have fallen off the [name] from violent whacking!"
usr.unEquip(src)
diff --git a/code/modules/hydroponics/grown/grass_carpet.dm b/code/modules/hydroponics/grown/grass_carpet.dm
index ac7ba622839..a4f3e55b604 100644
--- a/code/modules/hydroponics/grown/grass_carpet.dm
+++ b/code/modules/hydroponics/grown/grass_carpet.dm
@@ -12,7 +12,10 @@
production = 5
yield = 5
growthstages = 2
+ icon_grow = "grass-grow"
+ icon_dead = "grass-dead"
mutatelist = list(/obj/item/seeds/grass/carpet)
+ reagents_add = list("nutriment" = 0.02)
/obj/item/weapon/reagent_containers/food/snacks/grown/grass
seed = /obj/item/seeds/grass
@@ -21,13 +24,12 @@
icon_state = "grassclump"
filling_color = "#32CD32"
bitesize_mod = 2
- reagents_add = list("nutriment" = 0.02)
/obj/item/weapon/reagent_containers/food/snacks/grown/grass/attack_self(mob/user)
user << "You prepare the astroturf."
- var/grassAmt = 1 + round(potency / 50) // The grass we're holding
+ var/grassAmt = 1 + round(seed.potency / 50) // The grass we're holding
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/grass/G in user.loc) // The grass on the floor
- grassAmt += 1 + round(G.potency / 50)
+ grassAmt += 1 + round(G.seed.potency)
qdel(G)
while(grassAmt > 0)
var/obj/item/stack/tile/GT = new /obj/item/stack/tile/grass(user.loc)
@@ -61,9 +63,9 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/carpet/attack_self(mob/user)
user << "You roll out the red carpet."
- var/carpetAmt = 1 + round(potency / 50) // The carpet we're holding
+ var/carpetAmt = 1 + round(seed.potency / 50) // The carpet we're holding
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/carpet/C in user.loc) // The carpet on the floor
- carpetAmt += 1 + round(C.potency / 50)
+ carpetAmt += 1 + round(C.seed.potency / 50)
qdel(C)
while(carpetAmt > 0)
var/obj/item/stack/tile/CT = new /obj/item/stack/tile/carpet(user.loc)
diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm
index 6cd35cf49a4..013b93c94b5 100644
--- a/code/modules/hydroponics/grown/kudzu.dm
+++ b/code/modules/hydroponics/grown/kudzu.dm
@@ -11,25 +11,21 @@
endurance = 10
yield = 4
growthstages = 4
- plant_type = 1
+ plant_type = PLANT_WEED
rarity = 30
var/list/mutations = list()
+ reagents_add = list("charcoal" = 0.04, "nutriment" = 0.02)
-/obj/item/seeds/kudzu/New(loc, obj/item/weapon/reagent_containers/food/snacks/grown/kudzupod/parent)
- ..()
- if(parent)
- mutations = parent.mutations
+/obj/item/seeds/kudzu/Copy()
+ var/obj/item/seeds/kudzu/S = ..()
+ S.mutations = mutations.Copy()
+ return S
/obj/item/seeds/kudzu/suicide_act(mob/user)
user.visible_message("[user] swallows the pack of kudzu seeds! It looks like \he's trying to commit suicide..")
plant(user)
return (BRUTELOSS)
-/obj/item/seeds/kudzu/harvest()
- var/list/prod = ..()
- for(var/obj/item/weapon/reagent_containers/food/snacks/grown/kudzupod/K in prod)
- K.mutations = mutations
-
/obj/item/seeds/kudzu/proc/plant(mob/user)
if(istype(user.loc,/turf/space))
return
@@ -44,15 +40,14 @@
user << "You plant the kudzu. You monster."
/obj/item/seeds/kudzu/get_analyzer_text()
- var/list/mut_text = list()
+ var/text = ..()
var/text_string = ""
for(var/datum/spacevine_mutation/SM in mutations)
text_string += "[(text_string == "") ? "" : ", "][SM.name]"
- mut_text += "-Plant Mutations: [(text_string == "") ? "None" : text_string]"
- return mut_text
+ text += "\n- Plant Mutations: [(text_string == "") ? "None" : text_string]"
+ return text
/obj/item/seeds/kudzu/on_chem_reaction(datum/reagents/S)
-
var/list/temp_mut_list = list()
if(S.has_reagent("sterilizine", 5))
@@ -90,7 +85,5 @@
name = "kudzu pod"
desc = "Pueraria Virallis: An invasive species with vines that rapidly creep and wrap around whatever they contact."
icon_state = "kudzupod"
- var/list/mutations = list()
filling_color = "#6B8E23"
- bitesize_mod = 2
- reagents_add = list("charcoal" = 0.04, "nutriment" = 0.02)
\ No newline at end of file
+ bitesize_mod = 2
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/melon.dm b/code/modules/hydroponics/grown/melon.dm
index 333c6d8ece4..3460cde8926 100644
--- a/code/modules/hydroponics/grown/melon.dm
+++ b/code/modules/hydroponics/grown/melon.dm
@@ -8,7 +8,9 @@
product = /obj/item/weapon/reagent_containers/food/snacks/grown/watermelon
lifespan = 50
endurance = 40
+ icon_dead = "watermelon-dead"
mutatelist = list(/obj/item/seeds/watermelon/holy)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.2)
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon
seed = /obj/item/seeds/watermelon
@@ -20,7 +22,6 @@
dried_type = null
w_class = 3
filling_color = "#008000"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.2, "water" = 0.1)
bitesize_mod = 3
// Holymelon
@@ -32,6 +33,7 @@
plantname = "Holy Melon Vines"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/holymelon
mutatelist = list()
+ reagents_add = list("holywater" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
rarity = 20
/obj/item/weapon/reagent_containers/food/snacks/grown/holymelon
@@ -40,5 +42,4 @@
desc = "The water within this melon has been blessed by some deity that's particularly fond of watermelon."
icon_state = "holymelon"
filling_color = "#FFD700"
- dried_type = null
- reagents_add = list("holywater" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1)
\ No newline at end of file
+ dried_type = null
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/misc.dm b/code/modules/hydroponics/grown/misc.dm
index e0bcf8ec59a..de334bb6098 100644
--- a/code/modules/hydroponics/grown/misc.dm
+++ b/code/modules/hydroponics/grown/misc.dm
@@ -13,7 +13,7 @@
potency = -1
oneharvest = 1
growthstages = 4
- plant_type = 1
+ plant_type = PLANT_WEED
// Cabbage
@@ -31,6 +31,7 @@
yield = 4
growthstages = 1
mutatelist = list(/obj/item/seeds/replicapod)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage
seed = /obj/item/seeds/cabbage
@@ -38,7 +39,6 @@
desc = "Ewwwwwwwwww. Cabbage."
icon_state = "cabbage"
filling_color = "#90EE90"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
bitesize_mod = 2
@@ -55,6 +55,7 @@
maturation = 3
yield = 4
growthstages = 3
+ reagents_add = list("sugar" = 0.25)
/obj/item/weapon/reagent_containers/food/snacks/grown/sugarcane
seed = /obj/item/seeds/sugarcane
@@ -62,7 +63,6 @@
desc = "Sickly sweet."
icon_state = "sugarcane"
filling_color = "#FFD700"
- reagents_add = list("sugar" = 0.25)
bitesize_mod = 2
@@ -82,6 +82,7 @@
potency = 60
growthstages = 2
rarity = 60 // Obtainable only with xenobio+superluck.
+ reagents_add = list("sulfur" = 0.1, "carbon" = 0.1, "nitrogen" = 0.07, "potassium" = 0.05)
/obj/item/weapon/reagent_containers/food/snacks/grown/shell/gatfruit
seed = /obj/item/seeds/gatfruit
@@ -90,5 +91,4 @@
icon_state = "gatfruit"
origin_tech = "combat=3"
trash = /obj/item/weapon/gun/projectile/revolver
- bitesize_mod = 2
- reagents_add = list("sulfur" = 0.1, "carbon" = 0.1, "nitrogen" = 0.07, "potassium" = 0.05)
\ No newline at end of file
+ bitesize_mod = 2
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/mushrooms.dm b/code/modules/hydroponics/grown/mushrooms.dm
index a105a3aa182..eebfcc4c661 100644
--- a/code/modules/hydroponics/grown/mushrooms.dm
+++ b/code/modules/hydroponics/grown/mushrooms.dm
@@ -19,7 +19,8 @@
potency = 15
oneharvest = 1
growthstages = 4
- plant_type = 2
+ plant_type = PLANT_MUSHROOM
+ reagents_add = list("morphine" = 0.35, "charcoal" = 0.35, "nutriment" = 0)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/reishi
seed = /obj/item/seeds/reishi
@@ -27,7 +28,6 @@
desc = "Ganoderma lucidum: A special fungus known for its medicinal and stress relieving properties."
icon_state = "reishi"
filling_color = "#FF4500"
- reagents_add = list("morphine" = 0.35, "charcoal" = 0.35, "nutriment" = 0)
// Fly Amanita
@@ -45,8 +45,9 @@
yield = 4
oneharvest = 1
growthstages = 3
- plant_type = 2
+ plant_type = PLANT_MUSHROOM
mutatelist = list(/obj/item/seeds/angel)
+ reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.35, "nutriment" = 0)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita
seed = /obj/item/seeds/amanita
@@ -54,7 +55,6 @@
desc = "Amanita Muscaria: Learn poisonous mushrooms by heart. Only pick mushrooms you know."
icon_state = "amanita"
filling_color = "#FF0000"
- reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.35, "nutriment" = 0)
// Destroying Angel
@@ -73,7 +73,8 @@
potency = 35
oneharvest = 1
growthstages = 3
- plant_type = 2
+ plant_type = PLANT_MUSHROOM
+ reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.8, "nutriment" = 0)
rarity = 30
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel
@@ -82,7 +83,6 @@
desc = "Amanita Virosa: Deadly poisonous basidiomycete fungus filled with alpha amatoxins."
icon_state = "angel"
filling_color = "#C0C0C0"
- reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.8, "nutriment" = 0)
// Liberty Cap
@@ -99,7 +99,8 @@
potency = 15
oneharvest = 1
growthstages = 3
- plant_type = 2
+ plant_type = PLANT_MUSHROOM
+ reagents_add = list("mushroomhallucinogen" = 0.25, "nutriment" = 0.02)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap
seed = /obj/item/seeds/liberty
@@ -107,7 +108,6 @@
desc = "Psilocybe Semilanceata: Liberate yourself!"
icon_state = "libertycap"
filling_color = "#DAA520"
- reagents_add = list("mushroomhallucinogen" = 0.25, "nutriment" = 0.02)
// Plump Helmet
@@ -124,8 +124,9 @@
potency = 15
oneharvest = 1
growthstages = 3
- plant_type = 2
+ plant_type = PLANT_MUSHROOM
mutatelist = list(/obj/item/seeds/plump/walkingmushroom)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet
seed = /obj/item/seeds/plump
@@ -133,7 +134,6 @@
desc = "Plumus Hellmus: Plump, soft and s-so inviting~"
icon_state = "plumphelmet"
filling_color = "#9370DB"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
// Walking Mushroom
@@ -149,6 +149,7 @@
maturation = 5
yield = 1
mutatelist = list()
+ reagents_add = list("vitamin" = 0.05, "nutriment" = 0.12)
rarity = 30
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom
@@ -157,16 +158,15 @@
desc = "Plumus Locomotus: The beginning of the great walk."
icon_state = "walkingmushroom"
filling_color = "#9370DB"
- reagents_add = list("vitamin" = 0.05, "nutriment" = 0.12)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom/attack_self(mob/user)
if(istype(user.loc,/turf/space))
return
var/mob/living/simple_animal/hostile/mushroom/M = new /mob/living/simple_animal/hostile/mushroom(user.loc)
- M.maxHealth += round(endurance / 4)
- M.melee_damage_lower += round(potency / 20)
- M.melee_damage_upper += round(potency / 20)
- M.move_to_delay -= round(production / 50)
+ M.maxHealth += round(seed.endurance / 4)
+ M.melee_damage_lower += round(seed.potency / 20)
+ M.melee_damage_upper += round(seed.potency / 20)
+ M.move_to_delay -= round(seed.production / 50)
M.health = M.maxHealth
qdel(src)
user << "You plant the walking mushroom."
@@ -188,7 +188,8 @@
potency = 15
oneharvest = 1
growthstages = 3
- plant_type = 2
+ plant_type = PLANT_MUSHROOM
+ reagents_add = list("nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle
seed = /obj/item/seeds/chanter
@@ -196,7 +197,6 @@
desc = "Cantharellus Cibarius: These jolly yellow little shrooms sure look tasty!"
icon_state = "chanterelle"
filling_color = "#FFA500"
- reagents_add = list("nutriment" = 0.1)
// Glowshroom
@@ -215,9 +215,10 @@
potency = 30 //-> brightness
oneharvest = 1
growthstages = 4
- plant_type = 2
+ plant_type = PLANT_MUSHROOM
rarity = 20
mutatelist = list(/obj/item/seeds/glowshroom/glowcap)
+ reagents_add = list("radium" = 0.05, "nutriment" = 0.04)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom
seed = /obj/item/seeds/glowshroom
@@ -226,48 +227,39 @@
icon_state = "glowshroom"
filling_color = "#00FA9A"
var/effect_path = /obj/effect/glowshroom
- reagents_add = list("radium" = 0.05, "nutriment" = 0.04)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/New(var/loc, var/new_potency = 10)
..()
- if(lifespan == 0) //basically, if you're spawning these via admin or on the map, then set up some default stats.
- lifespan = 120
- endurance = 30
- maturation = 15
- production = 1
- yield = 3
- potency = 30
- plant_type = 2
if(istype(src.loc,/mob))
pickup(src.loc)//adjusts the lighting on the mob
else
- src.SetLuminosity(round(potency / 10,1))
+ src.SetLuminosity(round(seed.potency / 10,1))
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user)
if(istype(user.loc,/turf/space))
return
var/obj/effect/glowshroom/planted = new effect_path(user.loc)
- planted.delay = planted.delay - production * 100 //So the delay goes DOWN with better stats instead of up. :I
- planted.endurance = endurance
- planted.yield = yield
- planted.potency = potency
+ planted.delay = planted.delay - seed.production * 100 //So the delay goes DOWN with better stats instead of up. :I
+ planted.endurance = seed.endurance
+ planted.yield = seed.yield
+ planted.potency = seed.potency
user << "You plant [src]."
qdel(src)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/Destroy()
if(istype(loc,/mob))
- loc.AddLuminosity(round(-potency / 10,1))
+ loc.AddLuminosity(round(-seed.potency / 10,1))
return ..()
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user)
..()
SetLuminosity(0)
- user.AddLuminosity(round(potency / 10,1))
+ user.AddLuminosity(round(seed.potency / 10,1))
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
..()
- user.AddLuminosity(round(-potency / 10,1))
- SetLuminosity(round(potency / 10,1))
+ user.AddLuminosity(round(-seed.potency / 10,1))
+ SetLuminosity(round(seed.potency / 10,1))
// Glowcap
@@ -276,9 +268,13 @@
desc = "This mycelium -powers- into mushrooms!"
icon_state = "mycelium-glowcap"
species = "glowcap"
+ icon_grow = "glowshroom-grow"
+ icon_dead = "glowshroom-dead"
plantname = "Glowcaps"
+ plant_type = PLANT_MUSHROOM
product = /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap
mutatelist = list()
+ reagents_add = list("teslium" = 0.02, "nutriment" = 0.04)
rarity = 30
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap
@@ -288,13 +284,12 @@
icon_state = "glowcap"
filling_color = "#00FA9A"
effect_path = /obj/effect/glowshroom/glowcap
- reagents_add = list("teslium" = 0.02, "nutriment" = 0.04)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap/On_Consume()
if(!reagents.total_volume)
var/batteries_recharged = 0
for(var/obj/item/weapon/stock_parts/cell/C in usr.GetAllContents())
- var/newcharge = (potency*0.01)*C.maxcharge
+ var/newcharge = (seed.potency*0.01)*C.maxcharge
if(C.charge < newcharge)
C.charge = newcharge
if(isobj(C.loc))
diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm
index 881918bcb82..acc3d489f09 100644
--- a/code/modules/hydroponics/grown/nettle.dm
+++ b/code/modules/hydroponics/grown/nettle.dm
@@ -9,8 +9,9 @@
endurance = 40 // tuff like a toiger
yield = 4
growthstages = 5
- plant_type = 1
+ plant_type = PLANT_WEED
mutatelist = list(/obj/item/seeds/nettle/death)
+ reagents_add = list("sacid" = 0.5)
/obj/item/seeds/nettle/death
name = "pack of death-nettle seeds"
@@ -23,7 +24,8 @@
maturation = 8
yield = 2
mutatelist = list()
- rarity = 10
+ reagents_add = list("facid" = 0.5, "sacid" = 0.5)
+ rarity = 20
/obj/item/weapon/grown/nettle //abstract type
@@ -38,7 +40,6 @@
w_class = 1
throw_speed = 1
throw_range = 3
- plant_type = 1
origin_tech = "combat=1"
attack_verb = list("stung")
@@ -79,8 +80,7 @@
/obj/item/weapon/grown/nettle/basic/add_juice()
..()
- reagents.add_reagent("sacid", round((potency / 2), 1))
- force = round((5 + potency / 5), 1)
+ force = round((5 + seed.potency / 5), 1)
/obj/item/weapon/grown/nettle/death
@@ -94,8 +94,7 @@
/obj/item/weapon/grown/nettle/death/add_juice()
..()
- reagents.add_reagent("facid", round((potency / 2), 1))
- force = round((5 + potency / 2.5), 1)
+ force = round((5 + seed.potency / 2.5), 1)
/obj/item/weapon/grown/nettle/death/pickup(mob/living/carbon/user)
..()
diff --git a/code/modules/hydroponics/grown/potato.dm b/code/modules/hydroponics/grown/potato.dm
index 9d76bf0d135..ef6e46c7cf4 100644
--- a/code/modules/hydroponics/grown/potato.dm
+++ b/code/modules/hydroponics/grown/potato.dm
@@ -12,7 +12,10 @@
yield = 4
oneharvest = 1
growthstages = 4
+ icon_grow = "potato-grow"
+ icon_dead = "potato-dead"
mutatelist = list(/obj/item/seeds/potato/sweet)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/potato
seed = /obj/item/seeds/potato
@@ -20,7 +23,6 @@
desc = "Boil 'em! Mash 'em! Stick 'em in a stew!"
icon_state = "potato"
filling_color = "#E9967A"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1)
bitesize = 100
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W, mob/user, params)
@@ -30,7 +32,7 @@
if (C.use(5))
user << "You add some cable to the potato and slide it inside the battery encasing."
var/obj/item/weapon/stock_parts/cell/potato/pocell = new /obj/item/weapon/stock_parts/cell/potato(user.loc)
- pocell.maxcharge = src.potency * 20
+ pocell.maxcharge = seed.potency * 20
pocell.charge = pocell.maxcharge
qdel(src)
return
@@ -47,10 +49,10 @@
plantname = "Sweet Potato Plants"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/potato/sweet
mutatelist = list()
+ reagents_add = list("vitamin" = 0.1, "sugar" = 0.1, "nutriment" = 0.1)
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/sweet
seed = /obj/item/seeds/potato/sweet
name = "sweet potato"
desc = "It's sweet."
- icon_state = "sweetpotato"
- reagents_add = list("vitamin" = 0.1, "sugar" = 0.1, "nutriment" = 0.1)
\ No newline at end of file
+ icon_state = "sweetpotato"
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/pumpkin.dm b/code/modules/hydroponics/grown/pumpkin.dm
index 4e6629633ab..73fac36e961 100644
--- a/code/modules/hydroponics/grown/pumpkin.dm
+++ b/code/modules/hydroponics/grown/pumpkin.dm
@@ -9,7 +9,10 @@
lifespan = 50
endurance = 40
growthstages = 3
+ icon_grow = "pumpkin-grow"
+ icon_dead = "pumpkin-dead"
mutatelist = list(/obj/item/seeds/pumpkin/blumpkin)
+ reagents_add = list("vitamin" = 0.04, "nutriment" = 0.2)
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin
seed = /obj/item/seeds/pumpkin
@@ -17,7 +20,6 @@
desc = "It's large and scary."
icon_state = "pumpkin"
filling_color = "#FFA500"
- reagents_add = list("vitamin" = 0.04, "nutriment" = 0.2)
bitesize_mod = 2
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
@@ -37,6 +39,7 @@
plantname = "Blumpkin Vines"
product = /obj/item/weapon/reagent_containers/food/snacks/grown/blumpkin
mutatelist = list()
+ reagents_add = list("ammonia" = 0.2, "nutriment" = 0.2)
rarity = 20
/obj/item/weapon/reagent_containers/food/snacks/grown/blumpkin
@@ -45,5 +48,4 @@
desc = "The pumpkin's toxic sibling."
icon_state = "blumpkin"
filling_color = "#87CEFA"
- reagents_add = list("ammonia" = 0.2, "nutriment" = 0.2)
bitesize_mod = 2
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm
index 9ac54b1f36d..88f6b0d5af4 100644
--- a/code/modules/hydroponics/grown/replicapod.dm
+++ b/code/modules/hydroponics/grown/replicapod.dm
@@ -42,4 +42,66 @@
user << "The seeds reject the sample!"
else
user << "The seeds already contain a genetic sample!"
- ..()
\ No newline at end of file
+ ..()
+
+/obj/item/seeds/replicapod/get_analyzer_text()
+ var/text = ..()
+ if(contains_sample)
+ text += "\n It contains a blood sample!"
+ return text
+
+
+/obj/item/seeds/replicapod/harvest(mob/user = usr) //now that one is fun -- Urist
+ var/obj/machinery/hydroponics/parent = loc
+ var/make_podman = 0
+ var/ckey_holder = null
+ if(config.revival_pod_plants)
+ if(ckey)
+ for(var/mob/M in player_list)
+ if(istype(M, /mob/dead/observer))
+ var/mob/dead/observer/O = M
+ if(O.ckey == ckey && O.can_reenter_corpse)
+ make_podman = 1
+ break
+ else
+ if(M.ckey == ckey && M.stat == DEAD && !M.suiciding)
+ make_podman = 1
+ break
+ else //If the player has ghosted from his corpse before blood was drawn, his ckey is no longer attached to the mob, so we need to match up the cloned player through the mind key
+ for(var/mob/M in player_list)
+ if(mind && M.mind && ckey(M.mind.key) == ckey(mind.key) && M.ckey && M.client && M.stat == 2 && !M.suiciding)
+ if(istype(M, /mob/dead/observer))
+ var/mob/dead/observer/O = M
+ if(!O.can_reenter_corpse)
+ break
+ make_podman = 1
+ ckey_holder = M.ckey
+ break
+
+ if(make_podman) //all conditions met!
+ var/mob/living/carbon/human/podman = new /mob/living/carbon/human(parent.loc)
+ if(realName)
+ podman.real_name = realName
+ else
+ podman.real_name = "Pod Person [rand(0,999)]"
+ mind.transfer_to(podman)
+ if(ckey)
+ podman.ckey = ckey
+ else
+ podman.ckey = ckey_holder
+ podman.gender = blood_gender
+ podman.faction |= factions
+ if(!features["mcolor"])
+ features["mcolor"] = "#59CE00"
+ podman.hardset_dna(null,null,podman.real_name,blood_type,/datum/species/pod,features)//Discard SE's and UI's, podman cloning is inaccurate, and always make them a podman
+ podman.set_cloned_appearance()
+
+ else //else, one packet of seeds. maybe two
+ var/seed_count = 1
+ if(prob(getYield() * 20))
+ seed_count++
+ for(var/i=0,iThe Killer Tomato growls as it suddenly awakens.")
if(user)
diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm
index 3e2a863b5b7..873dda37163 100644
--- a/code/modules/hydroponics/grown/towercap.dm
+++ b/code/modules/hydroponics/grown/towercap.dm
@@ -13,7 +13,7 @@
potency = 50
oneharvest = 1
growthstages = 3
- plant_type = 2
+ icon_dead = "towercap-dead"
mutatelist = list(/obj/item/seeds/tower/steel)
/obj/item/seeds/tower/steel
@@ -39,7 +39,6 @@
w_class = 3
throw_speed = 2
throw_range = 3
- plant_type = 2
origin_tech = "materials=1"
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
var/plank_type = /obj/item/stack/sheet/mineral/wood
@@ -55,7 +54,7 @@
..()
if(W.sharpness)
user.show_message("You make [plank_name] out of \the [src]!", 1)
- var/obj/item/stack/plank = new plank_type(user.loc, 1 + round(potency / 25))
+ var/obj/item/stack/plank = new plank_type(user.loc, 1 + round(seed.potency / 25))
var/old_plank_amount = plank.amount
for(var/obj/item/stack/ST in user.loc)
if(ST != plank && istype(ST, plank_type) && ST.amount < ST.max_amount)
diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm
index ec21706a6e0..06943a06b7b 100644
--- a/code/modules/hydroponics/growninedible.dm
+++ b/code/modules/hydroponics/growninedible.dm
@@ -6,55 +6,36 @@
name = "grown_weapon"
icon = 'icons/obj/hydroponics/harvest.dmi'
burn_state = FLAMMABLE
- var/seed = null
- var/plantname = ""
- var/product //a type path
- var/lifespan = 0
- var/endurance = 15
- var/maturation = 7
- var/production = 7
- var/yield = 2
- var/potency = 20
- var/plant_type = 0
+ var/obj/item/seeds/seed = null // type path, gets converted to item on New(). It's safe to assume it's always a seed item.
-/obj/item/weapon/grown/New(newloc, new_potency = 50)
+/obj/item/weapon/grown/New(newloc, var/obj/item/seeds/new_seed = null)
..()
- potency = new_potency
+ create_reagents(50)
+
+ if(new_seed)
+ seed = new_seed.Copy()
+ else if(ispath(seed))
+ // This is for adminspawn or map-placed growns. They get the default stats of their seed type.
+ seed = new seed()
+ seed.potency = 50
+ seed.prepare_result(src)
+ else // Something is terribly wrong
+ qdel(src)
+ return
+
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
- transform *= TransformUsingVariable(potency, 100, 0.5)
-
- if(seed && lifespan == 0) //This is for adminspawn or map-placed growns. They get the default stats of their seed type. This feels like a hack but people insist on putting these things on the map...
- var/obj/item/seeds/S = new seed(src)
- lifespan = S.lifespan
- endurance = S.endurance
- maturation = S.maturation
- production = S.production
- yield = S.yield
- qdel(S) //Foods drop their contents when eaten, so delete the default seed.
-
- create_reagents(50)
add_juice()
+ transform *= TransformUsingVariable(seed.potency, 100, 0.5)
+
/obj/item/weapon/grown/attackby(obj/item/O, mob/user, params)
..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
- var/msg
- msg = "*---------*\n This is \a [src]\n"
- switch(plant_type)
- if(0)
- msg += "- Plant type: Normal plant\n"
- if(1)
- msg += "- Plant type: Weed. Can grow in nutrient-poor soil.\n"
- if(2)
- msg += "- Plant type: Mushroom. Can grow in dry soil.\n"
- msg += "- Potency: [potency]\n"
- msg += "- Yield: [yield]\n"
- msg += "- Maturation speed: [maturation]\n"
- msg += "- Production speed: [production]\n"
- msg += "- Endurance: [endurance]\n"
- msg += "*---------*"
+ var/msg = "*---------*\n This is \a [src]\n"
+ msg += seed.get_analyzer_text()
+ msg += ""
usr << msg
return
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index f648d636395..3ea195fb3e8 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -19,7 +19,6 @@
var/lastproduce = 0 //Last time it was harvested
var/lastcycle = 0 //Used for timing of cycles.
var/cycledelay = 200 //About 10 seconds / cycle
- var/planted = 0 //Is it occupied?
var/harvest = 0 //Ready to harvest?
var/obj/item/seeds/myseed = null //The currently planted seed
var/rating = 1
@@ -80,14 +79,11 @@
..()
/obj/machinery/hydroponics/proc/FindConnected()
-
var/list/connected = list()
var/list/processing_atoms = list(src)
while(processing_atoms.len)
-
var/atom/a = processing_atoms[1]
-
for(var/step_dir in cardinal)
var/obj/machinery/hydroponics/h = locate() in get_step(a, step_dir)
// Soil plots aren't dense. anchored == 2 means the hoses are screwed in place
@@ -101,24 +97,16 @@
/obj/machinery/hydroponics/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
- if(!planted)
- ..()
- return
+ if(!myseed)
+ return ..()
if(istype(Proj ,/obj/item/projectile/energy/floramut))
mutate()
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
- if(myseed.yield == 0)//Oh god don't divide by zero you'll doom us all.
- adjustSYield(1 * rating)
- //world << "Yield increased by 1, from 0, to a total of [myseed.yield]"
- else if(prob(1/(myseed.yield * myseed.yield) * 100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
- adjustSYield(1 * rating)
- //world << "Yield increased by 1, to a total of [myseed.yield]"
+ return myseed.bullet_act(Proj)
else
- ..()
- return
+ return ..()
/obj/machinery/hydroponics/process()
-
var/needs_update = 0 // Checks if the icon needs updating so we don't redraw empty trays every time
if(myseed && (myseed.loc != src))
@@ -126,9 +114,12 @@
if(world.time > (lastcycle + cycledelay))
lastcycle = world.time
- if(planted && !dead)
+ if(myseed && !dead)
// Advance age
age++
+ if(age < myseed.maturation)
+ lastproduce = age
+
needs_update = 1
//Nutrients//////////////////////////////////////////////////////////////
@@ -137,7 +128,7 @@
adjustNutri(-1 / rating)
// Lack of nutrients hurts non-weeds
- if(nutrilevel <= 0 && myseed.plant_type != 1)
+ if(nutrilevel <= 0 && myseed.plant_type != PLANT_WEED)
adjustHealth(-rand(1,3))
//Photosynthesis/////////////////////////////////////////////////////////
@@ -145,7 +136,7 @@
if(isturf(loc))
var/turf/currentTurf = loc
var/lightAmt = currentTurf.lighting_lumcount
- if(myseed.plant_type == 2) // Mushroom
+ if(myseed.plant_type == PLANT_MUSHROOM)
if(lightAmt < 2)
adjustHealth(-1 / rating)
else // Non-mushroom
@@ -157,7 +148,7 @@
adjustWater(-rand(1,6) / rating)
// If the plant is dry, it loses health pretty fast, unless mushroom
- if(waterlevel <= 10 && myseed.plant_type != 2)
+ if(waterlevel <= 10 && myseed.plant_type != PLANT_MUSHROOM)
adjustHealth(-rand(0,1) / rating)
if(waterlevel <= 0)
adjustHealth(-rand(0,2) / rating)
@@ -184,7 +175,7 @@
adjustHealth(-1 / rating)
// If it's a weed, it doesn't stunt the growth
- if(weedlevel >= 5 && myseed.plant_type != 1 )
+ if(weedlevel >= 5 && myseed.plant_type != PLANT_WEED)
adjustHealth(-1 / rating)
//Health & Age///////////////////////////////////////////////////////////
@@ -212,10 +203,9 @@
adjustWeeds(1 / rating)
// Weeeeeeeeeeeeeeedddssss
-
if(weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot.
- if(planted)
- if(myseed.plant_type == 0) // If a normal plant
+ if(myseed)
+ if(myseed.plant_type == PLANT_NORMAL) // If a normal plant
weedinvasion()
else
weedinvasion() // Weed invasion into empty tray
@@ -244,66 +234,81 @@
return
/obj/machinery/hydroponics/update_icon()
-
//Refreshes the icon and sets the luminosity
overlays.Cut()
- var/n = 0
+ update_icon_hoses()
- for(var/Dir in cardinal)
+ if(myseed)
+ update_icon_plant()
+ update_icon_lights()
- var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir)
- if(t && t.anchored == 2 && src.anchored == 2)
- n += Dir
-
- icon_state = "hoses-[n]"
-
- UpdateDescription()
-
- if(planted)
- var/image/I
- if(dead)
- I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.species]-dead")
- else if(harvest)
- if(myseed.plant_type == 2) // Shrooms don't have a -harvest graphic
- I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.species]-grow[myseed.growthstages]")
- else
- I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.species]-harvest")
- else if(age < myseed.maturation)
- var/t_growthstate = ((age / myseed.maturation) * myseed.growthstages ) // Make sure it won't crap out due to HERPDERP 6 stages only
- I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.species]-grow[round(t_growthstate)]")
- lastproduce = age //Cheating by putting this here, it means that it isn't instantly ready to harvest
- else
- I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.species]-grow[myseed.growthstages]") // Same
- I.layer = MOB_LAYER + 0.1
- overlays += I
-
- if(waterlevel <= 10)
- overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowwater3")
- if(nutrilevel <= 2)
- overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lownutri3")
- if(health <= (myseed.endurance / 2))
- overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowhealth3")
- if(weedlevel >= 5 || pestlevel >= 5 || toxic >= 40)
- overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_alert3")
- if(harvest)
- overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_harvest3")
-
- if(istype(myseed,/obj/item/seeds/glowshroom))
+ if(istype(myseed, /obj/item/seeds/glowshroom))
SetLuminosity(round(myseed.potency / 10))
else
SetLuminosity(0)
return
-/obj/machinery/hydroponics/proc/UpdateDescription()
- desc = null
- if (planted)
- desc = "[src] has [myseed.plantname] planted."
+/obj/machinery/hydroponics/proc/update_icon_hoses()
+ var/n = 0
+ for(var/Dir in cardinal)
+ var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir)
+ if(t && t.anchored == 2 && src.anchored == 2)
+ n += Dir
+
+ icon_state = "hoses-[n]"
+
+/obj/machinery/hydroponics/proc/update_icon_plant()
+ var/image/I
+ if(dead)
+ I = image('icons/obj/hydroponics/growing.dmi', icon_state = myseed.icon_dead)
+ else if(harvest)
+ if(!myseed.icon_harvest)
+ I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.icon_grow][myseed.growthstages]")
+ else
+ I = image('icons/obj/hydroponics/growing.dmi', icon_state = myseed.icon_harvest)
+ else
+ var/t_growthstate = min(round((age / myseed.maturation) * myseed.growthstages), myseed.growthstages)
+ I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.icon_grow][t_growthstate]")
+ I.layer = MOB_LAYER + 0.1
+ overlays += I
+
+/obj/machinery/hydroponics/proc/update_icon_lights()
+ if(waterlevel <= 10)
+ overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowwater3")
+ if(nutrilevel <= 2)
+ overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lownutri3")
+ if(health <= (myseed.endurance / 2))
+ overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowhealth3")
+ if(weedlevel >= 5 || pestlevel >= 5 || toxic >= 40)
+ overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_alert3")
+ if(harvest)
+ overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_harvest3")
+
+
+/obj/machinery/hydroponics/examine(user)
+ ..()
+ if(myseed)
+ user << "It has [myseed.plantname] planted."
if (dead)
- desc += " It's dead."
+ user << "It's dead."
else if (harvest)
- desc += " It's ready to harvest."
+ user << "It's ready to harvest."
+ else if (health <= (myseed.endurance / 2))
+ user << "It looks unhealthy."
+ else
+ user << "[src] is empty."
+
+ user << "Water: [waterlevel]/[maxwater]"
+ user << "Nutrient: [nutrilevel]/[maxnutri]"
+
+ if(weedlevel >= 5)
+ user << "[src] is filled with weeds!"
+ if(pestlevel >= 5)
+ user << "[src] is filled with tiny worms!"
+ user << "" // Empty line for readability.
+
/obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens.
dead = 0
@@ -311,26 +316,26 @@
if(myseed) // In case there's nothing in the tray beforehand
oldPlantName = myseed.plantname
qdel(myseed)
+ myseed = null
else
oldPlantName = "Empty tray"
switch(rand(1,18)) // randomly pick predominative weed
if(16 to 18)
- myseed = new /obj/item/seeds/reishi
+ myseed = new /obj/item/seeds/reishi(src)
if(14 to 15)
- myseed = new /obj/item/seeds/nettle
+ myseed = new /obj/item/seeds/nettle(src)
if(12 to 13)
- myseed = new /obj/item/seeds/harebell
+ myseed = new /obj/item/seeds/harebell(src)
if(10 to 11)
- myseed = new /obj/item/seeds/amanita
+ myseed = new /obj/item/seeds/amanita(src)
if(8 to 9)
- myseed = new /obj/item/seeds/chanter
+ myseed = new /obj/item/seeds/chanter(src)
if(6 to 7)
- myseed = new /obj/item/seeds/tower
+ myseed = new /obj/item/seeds/tower(src)
if(4 to 5)
- myseed = new /obj/item/seeds/plump
+ myseed = new /obj/item/seeds/plump(src)
else
- myseed = new /obj/item/seeds/weeds
- planted = 1
+ myseed = new /obj/item/seeds/weeds(src)
age = 0
health = myseed.endurance
lastcycle = world.time
@@ -342,13 +347,13 @@
/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25) // Mutates the current seed
- if(!planted)
+ if(!myseed)
return
- adjustSLife(rand(-lifemut,lifemut))
- adjustSEnd(rand(-endmut,endmut))
- adjustSProduct(rand(-productmut,productmut))
- adjustSYield(rand(-yieldmut,yieldmut))
- adjustSPot(rand(-potmut,potmut))
+ myseed.adjust_lifespan(rand(-lifemut,lifemut))
+ myseed.adjust_endurance(rand(-endmut,endmut))
+ myseed.adjust_production(rand(-productmut,productmut))
+ myseed.adjust_yield(rand(-yieldmut,yieldmut))
+ myseed.adjust_potency(rand(-potmut,potmut))
/obj/machinery/hydroponics/proc/hardmutate()
@@ -356,21 +361,19 @@
/obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant!
- if(!planted || dead)
+ if(!myseed || dead)
return
var/oldPlantName = myseed.plantname
if(myseed.mutatelist.len > 0)
var/mutantseed = pick(myseed.mutatelist)
qdel(myseed)
+ myseed = null
myseed = new mutantseed
-
else
return
- dead = 0
hardmutate()
- planted = 1
age = 0
health = myseed.endurance
lastcycle = world.time
@@ -386,11 +389,11 @@
if( weedlevel > 5 )
if(myseed)
qdel(myseed)
+ myseed = null
var/newWeed = pick(/obj/item/seeds/liberty, /obj/item/seeds/angel, /obj/item/seeds/nettle/death, /obj/item/seeds/kudzu)
myseed = new newWeed
dead = 0
hardmutate()
- planted = 1
age = 0
health = myseed.endurance
lastcycle = world.time
@@ -423,7 +426,6 @@
usr << "The pests seem to behave oddly, but quickly settle down..."
/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S)
-
if(myseed)
myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines
@@ -584,13 +586,15 @@
if(S.has_reagent("ammonia", 1))
adjustHealth(round(S.get_reagent_amount("ammonia") * 0.5))
adjustNutri(round(S.get_reagent_amount("ammonia") * 1))
- adjustSYield(round(S.get_reagent_amount("ammonia") * 0.01))
+ if(myseed)
+ myseed.adjust_yield(round(S.get_reagent_amount("ammonia") * 0.01))
// Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants
if(S.has_reagent("saltpetre", 1))
adjustHealth(round(S.get_reagent_amount("saltpetre") * 0.25))
- adjustSProduct(-round(S.get_reagent_amount("saltpetre") * 0.02))
- adjustSPot(round(S.get_reagent_amount("saltpetre") * 0.01))
+ if(myseed)
+ myseed.adjust_production(-round(S.get_reagent_amount("saltpetre") * 0.02))
+ myseed.adjust_potency(round(S.get_reagent_amount("saltpetre") * 0.01))
// Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer
if(S.has_reagent("ash", 1))
@@ -602,7 +606,8 @@
if(S.has_reagent("diethylamine", 1))
adjustHealth(round(S.get_reagent_amount("diethylamine") * 1))
adjustNutri(round(S.get_reagent_amount("diethylamine") * 2))
- adjustSYield(round(S.get_reagent_amount("diethylamine") * 0.02))
+ if(myseed)
+ myseed.adjust_yield(round(S.get_reagent_amount("diethylamine") * 0.02))
adjustPests(-rand(1,2))
// Compost, effectively
@@ -643,7 +648,6 @@
usr << "Nothing happens..."
/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params)
-
//Called when mob user "attacks" it with object O
if(istype(O, /obj/item/weapon/reagent_containers) ) // Syringe stuff (and other reagent containers now too)
var/obj/item/weapon/reagent_containers/reagent_source = O
@@ -712,49 +716,36 @@
reagent_source.update_icon()
return 1
- else if(istype(O, /obj/item/seeds/))
- if(!planted)
- if(/obj/item/seeds/kudzu)
+ else if(istype(O, /obj/item/seeds))
+ if(!myseed)
+ if(istype(O, /obj/item/seeds/kudzu))
investigate_log("had Kudzu planted in it by [user.ckey]([user]) at ([x],[y],[z])","kudzu")
user.unEquip(O)
user << "You plant [O]."
dead = 0
myseed = O
- planted = 1
age = 1
health = myseed.endurance
lastcycle = world.time
O.loc = src
- if((user.client && user.s_active != src))
- user.client.screen -= O
- O.dropped(user)
update_icon()
-
else
user << "[src] already has seeds in it!"
else if(istype(O, /obj/item/device/analyzer/plant_analyzer))
- if(planted && myseed)
+ if(myseed)
user << "*** [myseed.plantname] ***" //Carn: now reports the plants growing, not the seeds.
- user << "-Plant Age: [age]"
- user << "-Plant Endurance: [myseed.endurance]"
- user << "-Plant Lifespan: [myseed.lifespan]"
- if(myseed.yield != -1)
- user << "-Plant Yield: [myseed.yield]"
- user << "-Plant Production: [myseed.production]"
- if(myseed.potency != -1)
- user << "-Plant Potency: [myseed.potency]"
- var/list/text_strings = myseed.get_analyzer_text()
- if(text_strings)
- for(var/string in text_strings)
- user << string
+ user << "- Plant Age: [age]"
+ var/list/text_string = myseed.get_analyzer_text()
+ if(text_string)
+ user << text_string
else
user << "No plant found."
- user << "-Weed level: [weedlevel] / 10"
- user << "-Pest level: [pestlevel] / 10"
- user << "-Toxicity level: [toxic] / 100"
- user << "-Water level: [waterlevel] / [maxwater]"
- user << "-Nutrition level: [nutrilevel] / [maxnutri]"
+ user << "- Weed level: [weedlevel] / 10"
+ user << "- Pest level: [pestlevel] / 10"
+ user << "- Toxicity level: [toxic] / 100"
+ user << "- Water level: [waterlevel] / [maxwater]"
+ user << "- Nutrition level: [nutrilevel] / [maxnutri]"
user << ""
else if(istype(O, /obj/item/weapon/cultivator))
@@ -822,123 +813,18 @@
if(harvest)
myseed.harvest()
else if(dead)
- planted = 0
dead = 0
user << "You remove the dead plant from [src]."
qdel(myseed)
+ myseed = null
update_icon()
else
- if(planted && !dead)
- user << "[src] has [myseed.plantname] planted."
- if(health <= (myseed.endurance / 2))
- user << "The plant looks unhealthy."
- else
- user << "[src] is empty."
- user << "Water: [waterlevel]/[maxwater]"
- user << "Nutrient: [nutrilevel]/[maxnutri]"
- if(weedlevel >= 5) // Visual aid for those blind
- user << "[src] is filled with weeds!"
- if(pestlevel >= 5) // Visual aid for those blind
- user << "[src] is filled with tiny worms!"
- user << "" // Empty line for readability.
-
-/obj/item/seeds/proc/getYield()
- var/obj/machinery/hydroponics/parent = loc
- if (parent.yieldmod == 0)
- return min(yield, 1)//1 if above zero, 0 otherwise
- return (yield * parent.yieldmod)
-
-/obj/item/seeds/proc/harvest(mob/user = usr)
- var/obj/machinery/hydroponics/parent = loc //for ease of access
- var/t_amount = 0
- var/list/result = list()
- var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK
- var/product_name
- while(t_amount < getYield())
- var/obj/item/weapon/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, potency)
- result.Add(t_prod) // User gets a consumable
- if(!t_prod)
- return
- t_prod.lifespan = lifespan
- t_prod.endurance = endurance
- t_prod.maturation = maturation
- t_prod.production = production
- t_prod.yield = yield
- t_prod.potency = potency
- t_prod.plant_type = plant_type
- t_amount++
- product_name = t_prod.name
- if(getYield() >= 1)
- feedback_add_details("food_harvested","[product_name]|[getYield()]")
- parent.update_tray()
-
- return result
-
-
-/obj/item/seeds/replicapod/harvest(mob/user = usr) //now that one is fun -- Urist
- var/obj/machinery/hydroponics/parent = loc
- var/make_podman = 0
- var/ckey_holder = null
- if(config.revival_pod_plants)
- if(ckey)
- for(var/mob/M in player_list)
- if(istype(M, /mob/dead/observer))
- var/mob/dead/observer/O = M
- if(O.ckey == ckey && O.can_reenter_corpse)
- make_podman = 1
- break
- else
- if(M.ckey == ckey && M.stat == 2 && !M.suiciding)
- make_podman = 1
- break
- else //If the player has ghosted from his corpse before blood was drawn, his ckey is no longer attached to the mob, so we need to match up the cloned player through the mind key
- for(var/mob/M in player_list)
- if(mind && M.mind && ckey(M.mind.key) == ckey(mind.key) && M.ckey && M.client && M.stat == 2 && !M.suiciding)
- if(istype(M, /mob/dead/observer))
- var/mob/dead/observer/O = M
- if(!O.can_reenter_corpse)
- break
- make_podman = 1
- ckey_holder = M.ckey
- break
-
- if(make_podman) //all conditions met!
- var/mob/living/carbon/human/podman = new /mob/living/carbon/human(parent.loc)
- if(realName)
- podman.real_name = realName
- else
- podman.real_name = "Pod Person [rand(0,999)]"
- mind.transfer_to(podman)
- if(ckey)
- podman.ckey = ckey
- else
- podman.ckey = ckey_holder
- podman.gender = blood_gender
- podman.faction |= factions
- if(!features["mcolor"])
- features["mcolor"] = "#59CE00"
- podman.hardset_dna(null,null,podman.real_name,blood_type,/datum/species/pod,features)//Discard SE's and UI's, podman cloning is inaccurate, and always make them a podman
- podman.set_cloned_appearance()
-
- else //else, one packet of seeds. maybe two
- var/seed_count = 1
- if(prob(getYield() * 20))
- seed_count++
- for(var/i=0,iYou harvest from the [myseed.plantname]."
else if(myseed.getYield() <= 0)
user << "You fail to harvest anything useful!"
@@ -946,76 +832,32 @@
user << "You harvest [myseed.getYield()] items from the [myseed.plantname]."
if(myseed.oneharvest)
qdel(myseed)
- planted = 0
+ myseed = null
dead = 0
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.///
/obj/machinery/hydroponics/proc/adjustNutri(adjustamt)
- nutrilevel += adjustamt
- nutrilevel = max(nutrilevel, 0)
- nutrilevel = min(nutrilevel, maxnutri)
+ nutrilevel = Clamp(nutrilevel + adjustamt, 0, maxnutri)
/obj/machinery/hydroponics/proc/adjustWater(adjustamt)
- waterlevel += adjustamt
- waterlevel = max(waterlevel, 0)
- waterlevel = min(waterlevel, maxwater)
+ waterlevel = Clamp(waterlevel + adjustamt, 0, maxwater)
+
if(adjustamt>0)
adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration.
/obj/machinery/hydroponics/proc/adjustHealth(adjustamt)
- if(planted && !dead)
- health += adjustamt
- health = max(health, 0)
- health = min(health, myseed.endurance)
+ if(myseed && !dead)
+ health = Clamp(health + adjustamt, 0, myseed.endurance)
/obj/machinery/hydroponics/proc/adjustToxic(adjustamt)
- toxic += adjustamt
- toxic = max(toxic, 0)
- toxic = min(toxic, 100)
+ toxic = Clamp(toxic + adjustamt, 0, 100)
/obj/machinery/hydroponics/proc/adjustPests(adjustamt)
- pestlevel += adjustamt
- pestlevel = max(pestlevel, 0)
- pestlevel = min(pestlevel, 10)
+ pestlevel = Clamp(pestlevel + adjustamt, 0, 10)
/obj/machinery/hydroponics/proc/adjustWeeds(adjustamt)
- weedlevel += adjustamt
- weedlevel = max(weedlevel, 0)
- weedlevel = min(weedlevel, 10)
-
-/// Seed Setters ///
-/obj/machinery/hydroponics/proc/adjustSYield(adjustamt)//0,10
- if(myseed && myseed.yield != -1) // Unharvestable shouldn't suddenly turn harvestable
- myseed.yield += adjustamt
- myseed.yield = max(myseed.yield, 0)
- myseed.yield = min(myseed.yield, 10)
- if(myseed.yield <= 0 && myseed.plant_type == 2)
- myseed.yield = 1 // Mushrooms always have a minimum yield of 1.
-
-/obj/machinery/hydroponics/proc/adjustSLife(adjustamt)//10,100
- if(myseed)
- myseed.lifespan += adjustamt
- myseed.lifespan = max(myseed.lifespan, 10)
- myseed.lifespan = min(myseed.lifespan, 100)
-
-/obj/machinery/hydroponics/proc/adjustSEnd(adjustamt)//10,100
- if(myseed)
- myseed.endurance += adjustamt
- myseed.endurance = max(myseed.endurance, 10)
- myseed.endurance = min(myseed.endurance, 100)
-
-/obj/machinery/hydroponics/proc/adjustSProduct(adjustamt)//2,10
- if(myseed)
- myseed.production += adjustamt
- myseed.production = max(myseed.production, 2)
- myseed.production = min(myseed.production, 10)
-
-/obj/machinery/hydroponics/proc/adjustSPot(adjustamt)//0,100
- if(myseed && myseed.potency != -1) //Not all plants have a potency
- myseed.potency += adjustamt
- myseed.potency = max(myseed.potency, 0)
- myseed.potency = min(myseed.potency, 100)
+ weedlevel = Clamp(weedlevel + adjustamt, 0, 10)
/obj/machinery/hydroponics/proc/spawnplant() // why would you put strange reagent in a hydro tray you monster I bet you also feed them blood
var/list/livingplants = list(/mob/living/simple_animal/hostile/tree, /mob/living/simple_animal/hostile/killertomato)
@@ -1032,31 +874,11 @@
use_power = 0
unwrenchable = 0
-/obj/machinery/hydroponics/soil/update_icon() // Same as normal but with the overlays removed - Cheridan.
- overlays.Cut()
+/obj/machinery/hydroponics/soil/update_icon_hoses()
+ return // Has no hoses
- UpdateDescription()
-
- if(planted)
- if(dead)
- overlays += image('icons/obj/hydroponics/growing.dmi', icon_state= "[myseed.species]-dead")
- else if(harvest)
- if(myseed.plant_type == 2) // Shrooms don't have a -harvest graphic
- overlays += image('icons/obj/hydroponics/growing.dmi', icon_state= "[myseed.species]-grow[myseed.growthstages]")
- else
- overlays += image('icons/obj/hydroponics/growing.dmi', icon_state= "[myseed.species]-harvest")
- else if(age < myseed.maturation)
- var/t_growthstate = ((age / myseed.maturation) * myseed.growthstages )
- overlays += image('icons/obj/hydroponics/growing.dmi', icon_state= "[myseed.species]-grow[round(t_growthstate)]")
- lastproduce = age
- else
- overlays += image('icons/obj/hydroponics/growing.dmi', icon_state= "[myseed.species]-grow[myseed.growthstages]")
-
- if(istype(myseed,/obj/item/seeds/glowshroom))
- SetLuminosity(round(myseed.potency/10))
- else
- SetLuminosity(0)
- return
+/obj/machinery/hydroponics/soil/update_icon_lights()
+ return // Has no lights
/obj/machinery/hydroponics/soil/attackby(obj/item/O, mob/user, params)
..()
diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm
index f3ffdb83c81..5fc4858cab7 100644
--- a/code/modules/hydroponics/seed_extractor.dm
+++ b/code/modules/hydroponics/seed_extractor.dm
@@ -9,32 +9,20 @@
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/))
var/obj/item/weapon/reagent_containers/food/snacks/grown/F = O
while(t_amount < t_max)
- var/obj/item/seeds/t_prod = new F.seed(O.loc, O)
- t_prod.lifespan = F.lifespan
- t_prod.endurance = F.endurance
- t_prod.maturation = F.maturation
- t_prod.production = F.production
- t_prod.yield = F.yield
- t_prod.potency = F.potency
+ var/obj/item/seeds/t_prod = F.seed.Copy()
+ t_prod.loc = O.loc
t_amount++
qdel(O)
return 1
- else if(istype(O, /obj/item/weapon/grown/))
+ else if(istype(O, /obj/item/weapon/grown))
var/obj/item/weapon/grown/F = O
- if(F.seed)
- while(t_amount < t_max)
- var/obj/item/seeds/t_prod = new F.seed(O.loc, O)
- t_prod.lifespan = F.lifespan
- t_prod.endurance = F.endurance
- t_prod.maturation = F.maturation
- t_prod.production = F.production
- t_prod.yield = F.yield
- t_prod.potency = F.potency
- t_amount++
- qdel(O)
- return 1
- else return 0
+ while(t_amount < t_max)
+ var/obj/item/seeds/t_prod = F.seed.Copy()
+ t_prod.loc = O.loc
+ t_amount++
+ qdel(O)
+ return 1
/*else if(istype(O, /obj/item/stack/tile/grass))
var/obj/item/stack/tile/grass/S = O
diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm
index 380744e34c4..e71bc66aaaa 100644
--- a/code/modules/hydroponics/seeds.dm
+++ b/code/modules/hydroponics/seeds.dm
@@ -9,7 +9,12 @@
burn_state = 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/species = "" // Used to update icons. Should match the name in the sprites.
+ var/species = "" // Used to update icons. Should match the name in the sprites unless all icon_* are overriden.
+
+ var/icon_grow // Used to override grow icon (default is "[species]-grow"). You can use one grow icon for multiple closely related plants with it.
+ var/icon_dead // Used to override dead icon (default is "[species]-dead"). You can use one dead icon for multiple closely related plants with it.
+ var/icon_harvest // Used to override harvest icon (default is "[species]-harvest"). If null, plant will use [icon_grow][growthstages].
+
var/lifespan = 25 // How long before the plant begins to take damage from age.
var/endurance = 15 // Amount of health the plant has.
var/maturation = 6 // Used to determine which sprite to switch to when growing.
@@ -18,44 +23,170 @@
var/oneharvest = 0 // If a plant is cleared from the tray after harvesting, e.g. a carrot.
var/potency = 10 // The 'power' of a plant. Generally effects the amount of reagent in a plant, also used in other ways.
var/growthstages = 6 // Amount of growth sprites the plant has.
- var/plant_type = 0 // 0 = 'normal plant'; 1 = weed; 2 = shroom
+ var/plant_type = PLANT_NORMAL // 0 = PLANT_NORMAL; 1 = PLANT_WEED; 2 = PLANT_MUSHROOM; 3 = PLANT_ALIEN
var/rarity = 0 // How rare the plant is. Used for giving points to cargo when shipping off to Centcom.
var/list/mutatelist = list() // The type of plants that this plant can mutate into.
+ var/list/reagents_add = list()
+ // A list of reagents to add to product.
+ // Format: "reagent_id" = potency multiplier
+ // Stronger reagents must always come first to avoid being displaced by weaker ones.
+ // Total amount of any reagent in plant is calculated by formula: 1 + round(potency * multiplier)
+
/obj/item/seeds/New(loc, parent)
..()
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
+ if(!icon_grow)
+ icon_grow = "[species]-grow"
+
+ if(!icon_dead)
+ icon_dead = "[species]-dead"
+
+ if(!icon_harvest && plant_type != PLANT_MUSHROOM && yield != -1)
+ icon_harvest = "[species]-harvest"
+
+/obj/item/seeds/proc/Copy()
+ var/obj/item/seeds/S = new type
+ // Copy all the stats
+ S.lifespan = lifespan
+ S.endurance = endurance
+ S.maturation = maturation
+ S.production = production
+ S.yield = yield
+ S.potency = potency
+ return S
+
+/obj/item/seeds/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
+ if(istype(Proj ,/obj/item/projectile/energy/florayield))
+
+ var/rating = 1
+ if(istype(loc, /obj/machinery/hydroponics))
+ var/obj/machinery/hydroponics/H = loc
+ rating = H.rating
+
+ if(yield == 0)//Oh god don't divide by zero you'll doom us all.
+ adjust_yield(1 * rating)
+ else if(prob(1/(yield * yield) * 100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
+ adjust_yield(1 * rating)
+ else
+ return ..()
+
+
+// Harvest procs
+/obj/item/seeds/proc/getYield()
+ var/return_yield = yield
+
+ var/obj/machinery/hydroponics/parent = loc
+ if(istype(loc, /obj/machinery/hydroponics))
+ if(parent.yieldmod == 0)
+ return_yield = min(return_yield, 1)//1 if above zero, 0 otherwise
+ else
+ return_yield *= parent.yieldmod
+
+ return return_yield
+
+/obj/item/seeds/proc/harvest(mob/user = usr)
+ var/obj/machinery/hydroponics/parent = loc //for ease of access
+ var/t_amount = 0
+ var/list/result = list()
+ var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK
+ var/product_name
+ while(t_amount < getYield())
+ var/obj/item/weapon/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src)
+ prepare_result(t_prod)
+ result.Add(t_prod) // User gets a consumable
+ if(!t_prod)
+ return
+ t_amount++
+ product_name = t_prod.name
+ if(getYield() >= 1)
+ feedback_add_details("food_harvested","[product_name]|[getYield()]")
+ parent.update_tray()
+
+ return result
+
+/obj/item/seeds/proc/prepare_result(var/obj/item/weapon/reagent_containers/food/snacks/grown/T)
+ if(T.reagents)
+ for(var/reagent_id in reagents_add)
+ if(reagent_id == "blood") // Hack to make blood in plants always O-
+ T.reagents.add_reagent(reagent_id, 1 + round(potency * reagents_add[reagent_id]), list("blood_type"="O-"))
+ continue
+
+ T.reagents.add_reagent(reagent_id, 1 + round(potency * reagents_add[reagent_id]))
+ return 1
+
+
+/// Setters procs ///
+/obj/item/seeds/proc/adjust_yield(adjustamt)
+ if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable
+ yield = Clamp(yield + adjustamt, 0, 10)
+
+ if(yield <= 0 && plant_type == PLANT_MUSHROOM)
+ yield = 1 // Mushrooms always have a minimum yield of 1.
+
+/obj/item/seeds/proc/adjust_lifespan(adjustamt)
+ lifespan = Clamp(lifespan + adjustamt, 10, 100)
+
+/obj/item/seeds/proc/adjust_endurance(adjustamt)
+ endurance = Clamp(endurance + adjustamt, 10, 100)
+
+/obj/item/seeds/proc/adjust_production(adjustamt)
+ production = Clamp(production + adjustamt, 2, 10)
+
+/obj/item/seeds/proc/adjust_potency(adjustamt)
+ potency = Clamp(potency + adjustamt, 0, 100)
+
+
/obj/item/seeds/proc/get_analyzer_text() //in case seeds have something special to tell to the analyzer
- return
+ var/text = ""
+ switch(plant_type)
+ if(PLANT_NORMAL)
+ text += "- Plant type: Normal plant\n"
+ if(PLANT_WEED)
+ text += "- Plant type: Weed. Can grow in nutrient-poor soil.\n"
+ if(PLANT_MUSHROOM)
+ text += "- Plant type: Mushroom. Can grow in dry soil.\n"
+ else
+ text += "- Plant type: UNKNOWN \n"
+ if(potency != -1)
+ text += "- Potency: [potency]\n"
+ if(yield != -1)
+ text += "- Yield: [yield]\n"
+ text += "- Maturation speed: [maturation]\n"
+ text += "- Production speed: [production]\n"
+ text += "- Endurance: [endurance]\n"
+ text += "- Lifespan: [lifespan]\n"
+ if(rarity)
+ text += "- Species Discovery Value: [rarity]\n"
+
+ text += "*---------*"
+
+ return text
/obj/item/seeds/proc/on_chem_reaction(datum/reagents/S) //in case seeds have some special interaction with special chems
return
/obj/item/seeds/attackby(obj/item/O, mob/user, params)
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
- user << "*** [plantname] ***"
- user << "-Plant Endurance: [endurance]"
- user << "-Plant Lifespan: [lifespan]"
- user << "-Species Discovery Value: [rarity]"
- if(yield != -1)
- user << "-Plant Yield: [yield]"
- user << "-Plant Production: [production]"
- if(potency != -1)
- user << "-Plant Potency: [potency]"
- var/list/text_strings = get_analyzer_text()
- if(text_strings)
- for(var/string in text_strings)
- user << string
+ user << "*---------*\n This is \a [src]."
+ var/text = get_analyzer_text()
+ if(text)
+ user << "[text]"
+
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()
+/proc/check_plants_growth_stages_icons()
var/list/states = icon_states('icons/obj/hydroponics/growing.dmi')
var/list/paths = typesof(/obj/item/seeds) - /obj/item/seeds
@@ -63,13 +194,13 @@ proc/check_plants_growth_stages_icons()
var/obj/item/seeds/seed = new seedpath
for(var/i in 1 to seed.growthstages)
- if("[seed.species]-grow[i]" in states)
+ if("[seed.icon_grow][i]" in states)
continue
- world << "[seed.name] ([seed.type]) lacks the [seed.species]-grow[i] icon!"
+ world << "[seed.name] ([seed.type]) lacks the [seed.icon_grow][i] icon!"
- if( !("[seed.species]-dead" in states))
- world << "[seed.name] ([seed.type]) lacks the [seed.species]-dead icon!"
+ if(!(seed.icon_dead in states))
+ world << "[seed.name] ([seed.type]) lacks the [seed.icon_dead] icon!"
- if(seed.plant_type != 2 && seed.yield != -1) // mushrooms have no grown sprites, same for items with no product
- if(!("[seed.species]-harvest" in states))
- world << "[seed.name] ([seed.type]) lacks the [seed.species]-harvest icon!"
\ No newline at end of file
+ if(seed.icon_harvest) // mushrooms have no grown sprites, same for items with no product
+ if(!(seed.icon_harvest in states))
+ world << "[seed.name] ([seed.type]) lacks the [seed.icon_harvest] icon!"
\ No newline at end of file
diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm
index e2674d81bc8..c8a86d9a3f3 100644
--- a/code/modules/mining/abandoned_crates.dm
+++ b/code/modules/mining/abandoned_crates.dm
@@ -22,7 +22,7 @@
switch(loot)
if(1 to 5) //5% chance
new /obj/item/weapon/reagent_containers/food/drinks/bottle/rum(src)
- new /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia(src)
+ new /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/deus(src)
new /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey(src)
new /obj/item/weapon/lighter(src)
if(6 to 10)
diff --git a/code/modules/mob/interactive.dm b/code/modules/mob/interactive.dm
index 99b3abd17c5..2fd3ac0abbe 100644
--- a/code/modules/mob/interactive.dm
+++ b/code/modules/mob/interactive.dm
@@ -839,7 +839,7 @@
for(var/obj/machinery/hydroponics/tester in view(12,src))
considered[tester] = 1
- if(!tester.planted)
+ if(!tester.myseed)
considered[tester] += 50
if(tester.weedlevel > 0)
considered[tester] += 5
@@ -866,7 +866,7 @@
else
if(HP.harvest || HP.dead)
HP.attack_hand(src)
- else if(!HP.planted)
+ else if(!HP.myseed)
var/seedType = pick(typesof(/obj/item/seeds) - /obj/item/seeds)
var/obj/item/seeds/SEED = new seedType(src)
customEmote("[src] [pick("gibbers","drools","slobbers","claps wildly","spits")] towards [TARGET], producing a [SEED]!")
diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
index cd3814ddc58..ce1ae64d158 100644
--- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
+++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm
@@ -41,7 +41,6 @@
//Blender Stuff
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans = list("soymilk" = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = list("ketchup" = 0),
- /obj/item/weapon/reagent_containers/food/snacks/grown/corn = list("cornoil" = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
/obj/item/weapon/reagent_containers/food/snacks/grown/oat = list("flour" = -5),
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries = list("cherryjelly" = 0),
@@ -275,18 +274,18 @@
/obj/machinery/reagentgrinder/proc/get_grownweapon_amount(obj/item/weapon/grown/O)
if (!istype(O))
return 5
- else if (O.potency == -1)
+ else if (O.seed.potency == -1)
return 5
else
- return round(O.potency)
+ return round(O.seed.potency)
/obj/machinery/reagentgrinder/proc/get_juice_amount(obj/item/weapon/reagent_containers/food/snacks/grown/O)
if (!istype(O))
return 5
- else if (O.potency == -1)
+ else if (O.seed.potency == -1)
return 5
else
- return round(5*sqrt(O.potency))
+ return round(5*sqrt(O.seed.potency))
/obj/machinery/reagentgrinder/proc/remove_object(obj/item/O)
holdingitems -= O
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index 47d9191bcfd..1a599a99bc9 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -14,7 +14,7 @@
/obj/item/weapon/reagent_containers/New(location, vol = 0)
..()
- if (vol > 0)
+ if (isnum(vol) && vol > 0)
volume = vol
create_reagents(volume)
if(spawned_disease)
diff --git a/icons/obj/hydroponics/growing.dmi b/icons/obj/hydroponics/growing.dmi
index 50440975b3c..0d7745b22d2 100644
Binary files a/icons/obj/hydroponics/growing.dmi and b/icons/obj/hydroponics/growing.dmi differ
diff --git a/icons/obj/hydroponics/harvest.dmi b/icons/obj/hydroponics/harvest.dmi
index c49b87be940..482f07dba4f 100644
Binary files a/icons/obj/hydroponics/harvest.dmi and b/icons/obj/hydroponics/harvest.dmi differ