From 08bdcc3024e4ba9a51d6d0d09d45a84c4be53dfd Mon Sep 17 00:00:00 2001 From: c0 Date: Mon, 7 Mar 2016 12:46:12 +0300 Subject: [PATCH] Plant Refactor 4 --- .../awaymissions/mission_code/Cabin.dm | 2 +- code/modules/food&drinks/food/snacks.dm | 6 +- .../food&drinks/kitchen machinery/juicer.dm | 4 +- code/modules/hydroponics/grown.dm | 94 ++---- code/modules/hydroponics/grown/ambrosia.dm | 9 +- code/modules/hydroponics/grown/apple.dm | 8 +- code/modules/hydroponics/grown/banana.dm | 14 +- code/modules/hydroponics/grown/beans.dm | 6 +- code/modules/hydroponics/grown/berries.dm | 25 +- code/modules/hydroponics/grown/cereals.dm | 6 +- code/modules/hydroponics/grown/chili.dm | 7 +- code/modules/hydroponics/grown/citrus.dm | 8 +- .../hydroponics/grown/cocoa_vanilla.dm | 6 +- code/modules/hydroponics/grown/corn.dm | 4 +- code/modules/hydroponics/grown/eggplant.dm | 5 +- code/modules/hydroponics/grown/flowers.dm | 22 +- .../modules/hydroponics/grown/grass_carpet.dm | 10 +- code/modules/hydroponics/grown/kudzu.dm | 25 +- code/modules/hydroponics/grown/melon.dm | 6 +- code/modules/hydroponics/grown/misc.dm | 8 +- code/modules/hydroponics/grown/mushrooms.dm | 54 ++-- code/modules/hydroponics/grown/nettle.dm | 11 +- code/modules/hydroponics/grown/potato.dm | 8 +- code/modules/hydroponics/grown/pumpkin.dm | 4 +- code/modules/hydroponics/grown/replicapod.dm | 64 +++- code/modules/hydroponics/grown/root.dm | 10 +- code/modules/hydroponics/grown/tea_coffee.dm | 10 +- code/modules/hydroponics/grown/tobacco.dm | 6 +- code/modules/hydroponics/grown/tomato.dm | 24 +- code/modules/hydroponics/grown/towercap.dm | 4 +- code/modules/hydroponics/growninedible.dm | 59 ++-- code/modules/hydroponics/hydroponics.dm | 291 +++++------------- code/modules/hydroponics/seed_extractor.dm | 30 +- code/modules/hydroponics/seeds.dm | 147 ++++++++- code/modules/mining/abandoned_crates.dm | 2 +- code/modules/mob/interactive.dm | 4 +- .../chemistry/machinery/reagentgrinder.dm | 9 +- code/modules/reagents/reagent_containers.dm | 2 +- 38 files changed, 485 insertions(+), 529 deletions(-) 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 773bc8a17da..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 = PLANT_NORMAL 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(PLANT_NORMAL) - msg += "- Plant type: Normal plant\n" - if(PLANT_WEED) - msg += "- Plant type: Weed. Can grow in nutrient-poor soil.\n" - if(PLANT_MUSHROOM) - 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 a3b76d60f46..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 @@ -23,12 +22,12 @@ 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 @@ -39,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 @@ -46,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 f51813adcac..5deafac82fb 100644 --- a/code/modules/hydroponics/grown/apple.dm +++ b/code/modules/hydroponics/grown/apple.dm @@ -12,6 +12,7 @@ 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 @@ -19,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 @@ -43,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 @@ -50,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 5e49c8689a9..0af64abeb50 100644 --- a/code/modules/hydroponics/grown/banana.dm +++ b/code/modules/hydroponics/grown/banana.dm @@ -10,6 +10,7 @@ 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 @@ -19,7 +20,6 @@ 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." @@ -46,6 +46,7 @@ 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 @@ -55,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 @@ -68,6 +68,7 @@ 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 @@ -77,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) @@ -101,8 +101,8 @@ /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 @@ -114,7 +114,7 @@ /obj/item/weapon/grown/bananapeel/bluespace/Crossed(AM) if(..()) - var/teleport_radius = max(round(potency / 10), 1) + var/teleport_radius = max(round(seed.potency / 10), 1) do_teleport(AM, get_turf(AM), teleport_radius) AM << "You slip through spacetime!" diff --git a/code/modules/hydroponics/grown/beans.dm b/code/modules/hydroponics/grown/beans.dm index c5a139352c4..ac7def35c74 100644 --- a/code/modules/hydroponics/grown/beans.dm +++ b/code/modules/hydroponics/grown/beans.dm @@ -13,6 +13,7 @@ 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 @@ -21,7 +22,6 @@ gender = PLURAL icon_state = "soybeans" filling_color = "#F0E68C" - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05) bitesize_mod = 2 // Koibean @@ -32,8 +32,9 @@ 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 @@ -42,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 179321210cf..35c143d8fe5 100644 --- a/code/modules/hydroponics/grown/berries.dm +++ b/code/modules/hydroponics/grown/berries.dm @@ -13,6 +13,7 @@ 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 @@ -21,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 @@ -33,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 @@ -41,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 @@ -54,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 @@ -62,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 @@ -75,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 @@ -85,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 @@ -119,6 +119,7 @@ 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 @@ -127,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 @@ -147,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 @@ -168,6 +167,7 @@ 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 @@ -176,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 @@ -187,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() @@ -194,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 1638f57427a..8b6274c4e09 100644 --- a/code/modules/hydroponics/grown/cereals.dm +++ b/code/modules/hydroponics/grown/cereals.dm @@ -12,6 +12,7 @@ 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 @@ -21,7 +22,6 @@ icon_state = "wheat" filling_color = "#F0E68C" bitesize_mod = 2 - reagents_add = list("nutriment" = 0.04) // Oat /obj/item/seeds/wheat/oat @@ -41,7 +41,6 @@ icon_state = "oat" filling_color = "#556B2F" bitesize_mod = 2 - reagents_add = list("nutriment" = 0.04) // Rice /obj/item/seeds/wheat/rice @@ -61,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 f36e3eb9817..707b92e4ee8 100644 --- a/code/modules/hydroponics/grown/chili.dm +++ b/code/modules/hydroponics/grown/chili.dm @@ -13,8 +13,8 @@ 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 @@ -22,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 @@ -38,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 @@ -45,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 @@ -62,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 @@ -70,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 b21eac21697..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 @@ -43,6 +43,7 @@ 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 @@ -65,6 +66,7 @@ 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 @@ -86,6 +88,7 @@ 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 @@ -93,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 d1fce4c6247..54ee9db28bc 100644 --- a/code/modules/hydroponics/grown/cocoa_vanilla.dm +++ b/code/modules/hydroponics/grown/cocoa_vanilla.dm @@ -14,6 +14,7 @@ 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 @@ -21,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 @@ -33,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 570fcaa9874..a8d4b54a027 100644 --- a/code/modules/hydroponics/grown/corn.dm +++ b/code/modules/hydroponics/grown/corn.dm @@ -13,6 +13,7 @@ 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 @@ -22,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 @@ -69,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 124c4196fb4..f99d07ff4d7 100644 --- a/code/modules/hydroponics/grown/eggplant.dm +++ b/code/modules/hydroponics/grown/eggplant.dm @@ -11,6 +11,7 @@ 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 @@ -18,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 @@ -30,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 @@ -39,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 b1cfac1dbfa..46055517c82 100644 --- a/code/modules/hydroponics/grown/flowers.dm +++ b/code/modules/hydroponics/grown/flowers.dm @@ -15,6 +15,7 @@ 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 @@ -23,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 @@ -78,6 +78,7 @@ oneharvest = 1 growthstages = 4 plant_type = PLANT_WEED + reagents_add = list("nutriment" = 0.04) /obj/item/weapon/reagent_containers/food/snacks/grown/harebell seed = /obj/item/seeds/harebell @@ -86,7 +87,6 @@ icon_state = "harebell" slot_flags = SLOT_HEAD filling_color = "#E6E6FA" - reagents_add = list("nutriment" = 0.05) bitesize_mod = 3 @@ -106,6 +106,7 @@ 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 @@ -133,6 +134,7 @@ 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 @@ -142,7 +144,6 @@ 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 // Novaflower @@ -154,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 @@ -168,27 +170,23 @@ w_class = 1 throw_speed = 1 throw_range = 3 - plant_type = PLANT_NORMAL 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 865da51e641..a4f3e55b604 100644 --- a/code/modules/hydroponics/grown/grass_carpet.dm +++ b/code/modules/hydroponics/grown/grass_carpet.dm @@ -15,6 +15,7 @@ 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 @@ -23,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) @@ -63,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 199b1b67574..013b93c94b5 100644 --- a/code/modules/hydroponics/grown/kudzu.dm +++ b/code/modules/hydroponics/grown/kudzu.dm @@ -14,22 +14,18 @@ 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 a41adb3f0cb..3460cde8926 100644 --- a/code/modules/hydroponics/grown/melon.dm +++ b/code/modules/hydroponics/grown/melon.dm @@ -10,6 +10,7 @@ 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 @@ -21,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 @@ -33,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 @@ -41,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 62f51297d13..de334bb6098 100644 --- a/code/modules/hydroponics/grown/misc.dm +++ b/code/modules/hydroponics/grown/misc.dm @@ -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 66592fa05fd..eebfcc4c661 100644 --- a/code/modules/hydroponics/grown/mushrooms.dm +++ b/code/modules/hydroponics/grown/mushrooms.dm @@ -20,6 +20,7 @@ oneharvest = 1 growthstages = 4 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 @@ -47,6 +47,7 @@ growthstages = 3 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 @@ -74,6 +74,7 @@ oneharvest = 1 growthstages = 3 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 @@ -100,6 +100,7 @@ oneharvest = 1 growthstages = 3 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 @@ -126,6 +126,7 @@ growthstages = 3 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." @@ -189,6 +189,7 @@ oneharvest = 1 growthstages = 3 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 @@ -218,6 +218,7 @@ 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 = PLANT_MUSHROOM 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 @@ -282,6 +274,7 @@ 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 @@ -291,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 d1c4b655d3e..acc3d489f09 100644 --- a/code/modules/hydroponics/grown/nettle.dm +++ b/code/modules/hydroponics/grown/nettle.dm @@ -11,6 +11,7 @@ growthstages = 5 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 = PLANT_WEED 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 bdd05eaa98d..ef6e46c7cf4 100644 --- a/code/modules/hydroponics/grown/potato.dm +++ b/code/modules/hydroponics/grown/potato.dm @@ -15,6 +15,7 @@ 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 @@ -22,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) @@ -32,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 @@ -49,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 026dc55dba3..73fac36e961 100644 --- a/code/modules/hydroponics/grown/pumpkin.dm +++ b/code/modules/hydroponics/grown/pumpkin.dm @@ -12,6 +12,7 @@ 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 @@ -19,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) @@ -39,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 @@ -47,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 f2fcfe60793..873dda37163 100644 --- a/code/modules/hydroponics/grown/towercap.dm +++ b/code/modules/hydroponics/grown/towercap.dm @@ -13,7 +13,6 @@ potency = 50 oneharvest = 1 growthstages = 3 - plant_type = PLANT_MUSHROOM icon_dead = "towercap-dead" mutatelist = list(/obj/item/seeds/tower/steel) @@ -40,7 +39,6 @@ w_class = 3 throw_speed = 2 throw_range = 3 - plant_type = PLANT_MUSHROOM origin_tech = "materials=1" attack_verb = list("bashed", "battered", "bludgeoned", "whacked") var/plank_type = /obj/item/stack/sheet/mineral/wood @@ -56,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 137aa1d8382..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 = PLANT_NORMAL + 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(PLANT_NORMAL) - msg += "- Plant type: Normal plant\n" - if(PLANT_WEED) - msg += "- Plant type: Weed. Can grow in nutrient-poor soil.\n" - if(PLANT_MUSHROOM) - 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 2337661f6ce..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 @@ -84,9 +83,7 @@ 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 @@ -100,21 +97,14 @@ /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 @@ -124,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////////////////////////////////////////////////////////////// @@ -210,9 +203,8 @@ 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) if(myseed.plant_type == PLANT_NORMAL) // If a normal plant weedinvasion() else @@ -246,13 +238,12 @@ overlays.Cut() update_icon_hoses() - UpdateDescription() - if(planted) + if(myseed) update_icon_plant() update_icon_lights() - if(istype(myseed,/obj/item/seeds/glowshroom)) + if(istype(myseed, /obj/item/seeds/glowshroom)) SetLuminosity(round(myseed.potency / 10)) else SetLuminosity(0) @@ -277,12 +268,9 @@ 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 if(age < myseed.maturation) + 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]") - 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.icon_grow][myseed.growthstages]") // Same I.layer = MOB_LAYER + 0.1 overlays += I @@ -299,14 +287,28 @@ overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_harvest3") -/obj/machinery/hydroponics/proc/UpdateDescription() - desc = null - if (planted) - desc = "[src] has [myseed.plantname] planted." +/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 @@ -314,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 @@ -345,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() @@ -359,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 @@ -389,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 @@ -426,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 @@ -587,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)) @@ -605,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 @@ -646,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 @@ -715,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)) @@ -825,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) - user << "[src] is filled with weeds!" - if(pestlevel >= 5) - 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!" @@ -949,7 +832,7 @@ user << "You harvest [myseed.getYield()] items from the [myseed.plantname]." if(myseed.oneharvest) qdel(myseed) - planted = 0 + myseed = null dead = 0 update_icon() @@ -964,7 +847,7 @@ 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) + if(myseed && !dead) health = Clamp(health + adjustamt, 0, myseed.endurance) /obj/machinery/hydroponics/proc/adjustToxic(adjustamt) @@ -976,30 +859,6 @@ /obj/machinery/hydroponics/proc/adjustWeeds(adjustamt) weedlevel = Clamp(weedlevel + adjustamt, 0, 10) -/// Seed Setters /// -/obj/machinery/hydroponics/proc/adjustSYield(adjustamt) - if(myseed && myseed.yield != -1) // Unharvestable shouldn't suddenly turn harvestable - myseed.yield = Clamp(myseed.yield + adjustamt, 0, 10) - - if(myseed.yield <= 0 && myseed.plant_type == PLANT_MUSHROOM) - myseed.yield = 1 // Mushrooms always have a minimum yield of 1. - -/obj/machinery/hydroponics/proc/adjustSLife(adjustamt) - if(myseed) - myseed.lifespan = Clamp(myseed.lifespan + adjustamt, 10, 100) - -/obj/machinery/hydroponics/proc/adjustSEnd(adjustamt) - if(myseed) - myseed.endurance = Clamp(myseed.endurance + adjustamt, 10, 100) - -/obj/machinery/hydroponics/proc/adjustSProduct(adjustamt) - if(myseed) - myseed.production = Clamp(myseed.production + adjustamt, 2, 10) - -/obj/machinery/hydroponics/proc/adjustSPot(adjustamt) - if(myseed && myseed.potency != -1) //Not all plants have a potency - myseed.potency = Clamp(myseed.potency + adjustamt, 0, 100) - /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) var/chosen = pick(livingplants) 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 441f9d89b8e..e71bc66aaaa 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -23,9 +23,15 @@ 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 = PLANT_NORMAL // 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) ..() @@ -41,32 +47,143 @@ 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() 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)