From 8dee9d844aa20f9368fa68de4b61001dda5941b6 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Sun, 28 Feb 2021 21:35:30 -0700 Subject: [PATCH 1/3] part 1 cause I wanna do other things --- .../food_and_drinks/food/snacks_vend.dm | 2 +- code/modules/hydroponics/hydro_chemreact.dm | 264 ---------------- code/modules/hydroponics/hydroponics.dm | 9 +- code/modules/reagents/chemistry/reagents.dm | 6 + .../chemistry/reagents/drink_reagents.dm | 4 +- .../reagents/hydroponics_reactions.dm | 293 ++++++++++++++++++ tgstation.dme | 2 +- 7 files changed, 307 insertions(+), 273 deletions(-) delete mode 100644 code/modules/hydroponics/hydro_chemreact.dm create mode 100644 hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm diff --git a/code/modules/food_and_drinks/food/snacks_vend.dm b/code/modules/food_and_drinks/food/snacks_vend.dm index db4abc6c..f4249432 100644 --- a/code/modules/food_and_drinks/food/snacks_vend.dm +++ b/code/modules/food_and_drinks/food/snacks_vend.dm @@ -107,7 +107,7 @@ filling_color = "#F5F5DC" tastes = list("sweetness" = 3, "cake" = 1) foodtype = GRAIN | FRUIT | VEGETABLES | ANTITOXIC - price = 5 + price = 5 /obj/item/reagent_containers/food/snacks/carbonnanotube_noodles name = "carbon nanotube noodles" diff --git a/code/modules/hydroponics/hydro_chemreact.dm b/code/modules/hydroponics/hydro_chemreact.dm deleted file mode 100644 index b0821ae3..00000000 --- a/code/modules/hydroponics/hydro_chemreact.dm +++ /dev/null @@ -1,264 +0,0 @@ -/obj/machinery/hydroponics/proc/applyFertilizer(datum/reagents/S, mob/user) - // Ambrosia Gaia produces earthsblood. - if(S.has_reagent(/datum/reagent/medicine/earthsblood)) - self_sufficiency_progress += S.get_reagent_amount(/datum/reagent/medicine/earthsblood) - if(self_sufficiency_progress >= self_sufficiency_req) - become_self_sufficient() - else if(!self_sustaining) - to_chat(user, "[src] warms as it might on a spring day under a genuine Sun.") - - // Requires 5 mutagen to possibly change species.// Poor man's mutagen. - if(S.has_reagent(/datum/reagent/toxin/mutagen, 5) || S.has_reagent(/datum/reagent/radium, 10) || S.has_reagent(/datum/reagent/uranium, 10)) - switch(rand(100)) - if(91 to 100) - adjustHealth(-10) - to_chat(user, "The plant shrivels and burns.") - if(81 to 90) - mutatespecie() - if(66 to 80) - hardmutate() - if(41 to 65) - mutate() - if(21 to 41) - to_chat(user, "The plants don't seem to react...") - if(11 to 20) - mutateweed() - if(1 to 10) - mutatepest(user) - else - to_chat(user, "Nothing happens...") - - // 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen - else if(S.has_reagent(/datum/reagent/toxin/mutagen, 2) || S.has_reagent(/datum/reagent/radium, 5) || S.has_reagent(/datum/reagent/uranium, 5)) - hardmutate() - else if(S.has_reagent(/datum/reagent/toxin/mutagen, 1) || S.has_reagent(/datum/reagent/radium, 2) || S.has_reagent(/datum/reagent/uranium, 2)) - mutate() - - // Nutriments - if(S.has_reagent(/datum/reagent/plantnutriment/eznutriment, 1)) - yieldmod = 1 - mutmod = 1 - adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/eznutriment) * 1)) - if(S.has_reagent(/datum/reagent/plantnutriment/left4zednutriment, 1)) - yieldmod = 0 - mutmod = 2 - adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/left4zednutriment) * 1)) - if(S.has_reagent(/datum/reagent/plantnutriment/robustharvestnutriment, 1)) - yieldmod = 1.3 - mutmod = 0 - adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/robustharvestnutriment) * 1)) - - - - -/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S, mob/user) - if(!myseed) - return - myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines - - // After handling the mutating, we now handle the damage from adding crude radioactives... - if(S.has_reagent(/datum/reagent/uranium, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/uranium) * 1)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/uranium) * 2)) - if(S.has_reagent(/datum/reagent/radium, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/radium) * 1)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/radium) * 3)) // Radium is harsher (OOC: also easier to produce) - - if(S.has_reagent(/datum/reagent/plantnutriment/endurogrow, 1)) - var/total_transferred = S.get_reagent_amount(/datum/reagent/plantnutriment/endurogrow) - if(total_transferred >= 20) - myseed.adjust_potency(-round(total_transferred / 10)) - myseed.adjust_yield(-round(total_transferred / 20)) - myseed.adjust_endurance(round(total_transferred / 60)) - else - to_chat(user, "The plants don't seem to react...") - - if(S.has_reagent(/datum/reagent/plantnutriment/liquidearthquake, 1)) - var/total_transferred = S.get_reagent_amount(/datum/reagent/plantnutriment/liquidearthquake) - if(total_transferred >= 20) - myseed.adjust_weed_chance(round(total_transferred / 10)) - myseed.adjust_weed_rate(round(total_transferred / 60)) - myseed.adjust_production(round(total_transferred / 60)) - else - to_chat(user, "The plants don't seem to react...") - - // Antitoxin binds shit pretty well. So the tox goes significantly down - if(S.has_reagent(/datum/reagent/medicine/charcoal, 1)) - adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/charcoal) * 2)) - - // Toxins, not good for anything - if(S.has_reagent(/datum/reagent/toxin, 1)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin) * 2)) - - // Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. Not shrooms though. I can't deal with this now... - if(S.has_reagent(/datum/reagent/consumable/milk, 1)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.1)) - adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.9)) - - // Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay? - if(S.has_reagent(/datum/reagent/consumable/ethanol/beer, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.05)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.25)) - adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.7)) - - // Fluorine one of the most corrosive and deadly gasses - if(S.has_reagent(/datum/reagent/fluorine, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 2)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/fluorine) * 2.5)) - adjustWater(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 0.5)) - adjustWeeds(-rand(1,4)) - - // Chlorine one of the most corrosive and deadly gasses - if(S.has_reagent(/datum/reagent/chlorine, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 1)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/chlorine) * 1.5)) - adjustWater(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 0.5)) - adjustWeeds(-rand(1,3)) - - // White Phosphorous + water -> phosphoric acid. That's not a good thing really. - // Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. - if(S.has_reagent(/datum/reagent/phosphorus, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.75)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.1)) - adjustWater(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.5)) - adjustWeeds(-rand(1,2)) - - // Plants should not have sugar, they can't use it and it prevents them getting water/nutients, it is good for mold though... - if(S.has_reagent(/datum/reagent/consumable/sugar, 1)) - adjustWeeds(rand(1,2)) - adjustPests(rand(1,2)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sugar) * 0.1)) - - // It is water! - if(S.has_reagent(/datum/reagent/water, 1)) - adjustWater(round(S.get_reagent_amount(/datum/reagent/water) * 1)) - - // Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits~ - if(S.has_reagent(/datum/reagent/water/holywater, 1)) - adjustWater(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 0.1)) - - // A variety of nutrients are dissolved in club soda, without sugar. - // These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth. - if(S.has_reagent(/datum/reagent/consumable/sodawater, 1)) - adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1)) - - // Sulphuric Acid - if(S.has_reagent(/datum/reagent/toxin/acid, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1.5)) - adjustWeeds(-rand(1,2)) - - // Acid - if(S.has_reagent(/datum/reagent/toxin/acid/fluacid, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 2)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 3)) - adjustWeeds(-rand(1,4)) - - // Plant-B-Gone is just as bad - if(S.has_reagent(/datum/reagent/toxin/plantbgone, 1)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 5)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 6)) - adjustWeeds(-rand(4,8)) - - // Napalm, not known for being good for anything organic - if(S.has_reagent(/datum/reagent/napalm, 1)) - if(!(myseed.resistance_flags & FIRE_PROOF)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/napalm) * 6)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/napalm) * 7)) - adjustWeeds(-rand(5,9)) - - //Weed Spray - if(S.has_reagent(/datum/reagent/toxin/plantbgone/weedkiller, 1)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone/weedkiller) * 0.5)) - //old toxicity was 4, each spray is default 10 (minimal of 5) so 5 and 2.5 are the new ammounts - adjustWeeds(-rand(1,2)) - - //Pest Spray - if(S.has_reagent(/datum/reagent/toxin/pestkiller, 1)) - adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/pestkiller) * 0.5)) - adjustPests(-rand(1,2)) - - // Healing - if(S.has_reagent(/datum/reagent/medicine/cryoxadone, 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3)) - adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3)) - - // Ammonia is bad ass. - if(S.has_reagent(/datum/reagent/ammonia, 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.5)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/ammonia) * 1)) - if(myseed) - myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.01)) - - // Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants - if(S.has_reagent(/datum/reagent/saltpetre, 1)) - var/salt = S.get_reagent_amount(/datum/reagent/saltpetre) - adjustHealth(round(salt * 0.25)) - if (myseed) - myseed.adjust_production(-round(salt/100)-prob(salt%100)) - myseed.adjust_potency(round(salt*0.5)) - // Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer - if(S.has_reagent(/datum/reagent/ash, 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/ash) * 0.25)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/ash) * 0.5)) - adjustWeeds(-1) - - // Diethylamine is more bad ass, and pests get hurt by the corrosive nature of it, not the plant. - if(S.has_reagent(/datum/reagent/diethylamine, 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 1)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 2)) - if(myseed) - myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 0.02)) - adjustPests(-rand(1,2)) - - // Enduro Grow sacrifices potency + yield for endurance - if(S.has_reagent(/datum/reagent/plantnutriment/endurogrow, 1)) - myseed.adjust_potency(-round(S.get_reagent_amount(/datum/reagent/plantnutriment/endurogrow) * 0.1)) - myseed.adjust_yield(-round(S.get_reagent_amount(/datum/reagent/plantnutriment/endurogrow) * 0.075)) - myseed.adjust_endurance(round(S.get_reagent_amount(/datum/reagent/plantnutriment/endurogrow) * 0.35)) - - // Liquid Earthquake increases production speed but increases weeds - if(S.has_reagent(/datum/reagent/plantnutriment/liquidearthquake, 1)) - myseed.adjust_weed_rate(round(S.get_reagent_amount(/datum/reagent/plantnutriment/liquidearthquake) * 0.1)) - myseed.adjust_weed_chance(round(S.get_reagent_amount(/datum/reagent/plantnutriment/liquidearthquake) * 0.3)) - myseed.adjust_production(round(S.get_reagent_amount(/datum/reagent/plantnutriment/liquidearthquake) * 0.075)) - - // Nutriment Compost, effectively - if(S.has_reagent(/datum/reagent/consumable/nutriment, 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 0.5)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 1)) - - // Virusfood Compost for EVERYTHING - if(S.has_reagent(/datum/reagent/toxin/mutagen/mutagenvirusfood, 1)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5)) - adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5)) - - // Blood - if(S.has_reagent(/datum/reagent/blood, 1)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/blood) * 1)) - adjustPests(rand(2,4)) - - // Strange reagent - if(S.has_reagent(/datum/reagent/medicine/strange_reagent, 1)) - spawnplant() - - // Adminordrazine the best stuff there is. For testing/debugging. - if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 1)) - adjustWater(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1)) - adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1)) - adjustNutri(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1)) - adjustPests(-rand(1,5)) - adjustWeeds(-rand(1,5)) - if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 5)) - switch(rand(100)) - if(66 to 100) - mutatespecie() - if(33 to 65) - mutateweed() - if(1 to 32) - mutatepest(user) - else - to_chat(user, "Nothing happens...") diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 15960fee..89053916 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -529,15 +529,13 @@ for(var/obj/machinery/hydroponics/H in trays) //cause I don't want to feel like im juggling 15 tamagotchis and I can get to my real work of ripping flooring apart in hopes of validating my life choices of becoming a space-gardener - var/datum/reagents/S = new /datum/reagents() //This is a strange way, but I don't know of a better one so I can't fix it at the moment... - S.my_atom = H + var/datum/reagents/S = new /datum/reagents //This is a strange way, but I don't know of a better one so I can't fix it at the moment... reagent_source.reagents.trans_to(S,split) if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill)) qdel(reagent_source) - lastuser = user - H.applyFertilizer(S, user) - H.applyChemicals(S, user) + if(S.on_tray(H, split, user) >= 1) + lastuser = user S.clear_reagents() qdel(S) @@ -545,6 +543,7 @@ if(reagent_source) // If the source wasn't composted and destroyed reagent_source.update_icon() + else if(istype(O, /obj/item/seeds) && !istype(O, /obj/item/seeds/sample)) if(!myseed) if(istype(O, /obj/item/seeds/kudzu)) diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 61d32c29..ca0349d8 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -77,6 +77,12 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) /datum/reagent/proc/reaction_turf(turf/T, volume) return +//Hyperstation Edit: Hydroponics trays reactions, idea stolen from citadel but not directly referenced +/datum/reagent/proc/on_tray(/obj/machinery/hydroponics/T, volume, mob/user, override = FALSE) //See hyperstation's reagent module + if(!tray.myseed) + return 0 + return -1 + /datum/reagent/proc/on_mob_life(mob/living/carbon/M) current_cycle++ if(holder) diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index b45e56d8..853a0000 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -942,7 +942,7 @@ glass_icon_state = "glass_yellow" glass_name = "glass of bungo juice" glass_desc = "Exotic! You feel like you are on vacation already." - hydration = 1 * REAGENTS_METABOLISM + hydration = 1 * REAGENTS_METABOLISM /datum/reagent/consumable/aloejuice name = "Aloe Juice" @@ -952,7 +952,7 @@ glass_icon_state = "glass_yellow" glass_name = "glass of aloe juice" glass_desc = "A healthy and refreshing juice." - hydration = 2 * REAGENTS_METABOLISM + hydration = 2 * REAGENTS_METABOLISM /datum/reagent/consumable/aloejuice/on_mob_life(mob/living/M) if(prob(30)) diff --git a/hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm b/hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm new file mode 100644 index 00000000..5dae50eb --- /dev/null +++ b/hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm @@ -0,0 +1,293 @@ +/* + * If you ever decide to add more reactions, please remember to keep these + * in alphabetical order, according to reagent names and not their datums. + * It could be hard to find reactions when code diving. + * Due note, unlike before this change, that subtypes will apply to the tray the same as their parents + * -DT + */ + +#define DEFAULT_ACT_MUTAGEN switch(rand(100)){\ + if(91 to 100){\ + tray.adjustHealth(-10);\ + to_chat(user, "The plant shrivels and burns.");}\ + if(81 to 90)\ + tray.mutatespecie();\ + if(66 to 80)\ + tray.hardmutate();\ + if(41 to 65)\ + tray.mutate();\ + if(21 to 41)\ + to_chat(user, "The plants don't seem to react...");\ + if(11 to 20)\ + tray.mutateweed();\ + if(1 to 10)\ + tray.mutatepest(user);\ + else\ + to_chat(user, "Nothing happens...");} + +//Ammonia +/datum/reagent/ammonia/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustHealth(round(volume * 0.5)) + tray.adjustNutri(round(volume * 1)) + if(..()) + tray.myseed.adjust_yield(round(volume * 0.01)) + return 1 + +//Ash +/datum/reagent/ash/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + // Ash is used IRL in gardening, as a fertilizer enhancer and weed killer + adjustHealth(round(volume * 0.25)) + adjustNutri(round(volume * 0.5)) + adjustWeeds(-round(volume / 10)) + return 1 + +//Beer +/datum/reagent/consumable/ethanol/beer/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + // Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay? + tray.adjustHealth(-round(volume * 0.05)) + tray.adjustNutri(round(volume * 0.25)) + tray.adjustWater(round(volume * 0.7)) + return 1 + +//Blood +/datum/reagent/blood/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustNutri(round(volume * 0.6)) + tray.adjustHealth(-round(volume)) + tray.adjustPests(rand(2,4)) + return 1 + +//Charcoal +/datum/reagent/medicine/charcoal/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustToxic(-round(volume * 2)) //Antitoxin binds shit pretty well. So the tox goes significantly down + return 1 + +//Chlorine +/datum/reagent/chlorine/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustHealth(-round(volume * 1)) + tray.adjustToxic(round(volume * 1.5)) + tray.adjustWater(-round(volume * 0.5)) + tray.adjustWeeds(-rand(1,volume * 0.125)) + return 1 + +//Diethylamine +/datum/reagent/diethylamine/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + //Corrosive to pests, but not to plants + if(..()) + tray.myseed.adjust_yield(round(volume * 0.02)) + tray.adjustHealth(round(volume)) + tray.adjustNutri(round(volume * 2)) + tray.adjustPests(-rand(1,round(volume / 30))) + return 1 + +//Earthsblood +/datum/reagent/medicine/earthsblood/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.self_sufficiency_progress += volume + if(tray.self_sufficiency_progress >= tray.self_sufficiency_req) + tray.become_self_sufficient() + else + to_chat(user, "[tray] warms as it might on a spring day under a genuine Sun.") + return 1 + +//Enduro-Grow +/datum/reagent/plantnutriment/endurogrow/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + if(!..()) + return -1 + tray.myseed.adjust_potency(-round(volume / 10)) + tray.myseed.adjust_yield(-round(volume / 30)) + tray.myseed.adjust_endurance(round(volume / 30)) + return 1 + +//E-Z Nutrient +/datum/reagent/plantnutriment/eznutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.yieldmod = 1 + tray.mutmod = 1 + return ..() + +//Flourine +/datum/reagent/fluorine/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + // Fluorine one of the most corrosive and deadly gasses + tray.adjustHealth(-round(volume * 2)) + tray.adjustToxic(round(volume * 2.5)) + tray.adjustWater(-round(volume * 0.5)) + tray.adjustWeeds(-rand(1, volume * 0.25)) + return 1 + +//Fluorosulfuric acid +/datum/reagent/toxin/acid/fluacid/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustHealth(-round(volume * 2)) + tray.adjustToxic(round(volume * 3)) + trayadjustWeeds(-rand(1,volume * 0.5)) + return 1 + +//Holy Water +/datum/reagent/water/holywater/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + //Mostly the same as water, it also heals the plant a little with the power of the spirits~ + tray.adjustWater(round(volume)) + tray.adjustHealth(round(volume * 0.1)) + return 1 + +//Left-4-Zed +/datum/reagent/plantnutriment/left4zednutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.yieldmod = 0 + tray.mutmod = 2 + return ..() + +//Liquid Earthquake +/datum/reagent/plantnutriment/liquidearthquake/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + if(!..()) + return -1 + tray.myseed.adjust_weed_chance(round(volume / 10)) + tray.myseed.adjust_weed_rate(round(volume / 30)) + tray.myseed.adjust_production(-round(volume / 30)) + return 1 + +//Milk +/datum/reagent/consumable/milk/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustNutri(round(volume * 0.2)) + tray.adjustWater(round(volume * 0.5)) + if(..()) // Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. + if(!tray.myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) //Not shrooms though + tray.adjustHealth(-round(volume / 2)) + return 1 + +//Napalm +/datum/reagent/napalm/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + if(..()) + if(tray.myseed.resistance_flags & FIRE_PROOF) + return 1 + tray.adjustHealth(-round(S.get_reagent_amount(/datum/reagent/napalm) * 6)) + tray.adjustToxic(round(S.get_reagent_amount(/datum/reagent/napalm) * 7)) + tray.adjustWeeds(-rand(5,9)) + return 1 + +//Nutriment +/datum/reagent/consumable/nutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + //Compost, effectively + tray.adjustHealth(round(volume * 0.5)) + tray.adjustNutri(round(volume)) + return 1 + +//Pest Killer +/datum/reagent/toxin/pestkiller/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustToxic(round(volume * 0.5)) + tray.adjustPests(-rand(1,volume / 5)) + return 1 + +//Phosphorus +/datum/reagent/phosphorus/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + // White Phosphorous + water -> phosphoric acid. That's not a good thing really. + // Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. + tray.adjustHealth(-round(volume * 0.75)) + tray.adjustNutri(round(volume * 0.1)) + tray.adjustWater(-round(volume * 0.5)) + tray.adjustWeeds(-rand(1, volume * 0.1)) + return 1 + +//Plant-B-Gone +/datum/reagent/toxin/plantbgone/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustHealth(-round(volume * 5)) + tray.adjustToxic(round(volume * 6)) + tray.adjustWeeds(-rand(4,8)) + return 1 + +//Plant Base +//For subtypes of /datum/reagent/plantnutriment/ +/datum/reagent/plantnutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustNutri(round(volume)) + return ..() + +//Radium +/datum/reagent/radium/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + if(volume >= 10) + DEFAULT_ACT_MUTAGEN + else if(volume >= 5) + tray.hardmutate() + else if(volume >= 2) + tray.mutate() + + tray.adjustHealth(-round(volume)) + tray.adjustToxic(round(volume * 3)) // Radium is harsher (OOC: also easier to produce) + return 1 + +//Robust Harvest +/datum/reagent/plantnutriment/robustharvestnutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.yieldmod = 1.3 + tray.mutmod = 0 + return ..() + +//Saltpetre +/datum/reagent/saltpetre/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + // Saltpetre is used for gardening IRL. To simplify highly, it speeds up growth and strengthens plants + adjustHealth(round(salt * 0.25)) + if (..()) + tray.myseed.adjust_production(-round(volume/100)-prob(volume%100)) + tray.myseed.adjust_potency(round(volume*0.5)) + return 1 + +//Soda Water +/datum/reagent/consumable/sodawater/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + // A variety of nutrients are dissolved in club soda, without sugar. + // These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth. + tray.adjustWater(round(volume) * 0.9) + tray.adjustHealth(round(volume * 0.1)) + tray.adjustNutri(round(volume * 0.1)) + return 1 + +//Sugar +/datum/reagent/consumable/sugar/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustWeeds(round(rand(1, volume / 5))) + tray.adjustPests(round(rand(1, volume / 5))) + return 1 + +//Sulphuric Acid +/datum/reagent/toxin/acid/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustHealth(-round(volume * 1)) + tray.adjustToxic(round(volume * 1.5)) + tray.adjustWeeds(-rand(1,volume * 0.25)) + return 1 + +//Toxin +/datum/reagent/toxin/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + adjustToxic(round(volume * 2)) + return 1 + +//Unstable Mutagen +/datum/reagent/toxin/mutagen/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + if(volume >= 5) + DEFAULT_ACT_MUTAGEN + else if(volume >= 2) + tray.hardmutate() + else if(volume >= 1) + tray.mutate() + return 1 + +//Uranium +/datum/reagent/uranium/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + if(volume >= 10) + DEFAULT_ACT_MUTAGEN + else if(volume >= 5) + tray.hardmutate() + else if(volume >= 2) + tray.mutate() + + tray.adjustHealth(-round(volume)) + tray.adjustToxic(round(volume * 2)) + return 1 + +//Virus Food +/datum/reagent/toxin/mutagen/mutagenvirusfood/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustNutri(round(volume * 0.5)) + tray.adjustHealth(-round(volume * 0.5)) + +//Water +/datum/reagent/water/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + tray.adjustWater(round(volume)) + return 1 + +//Weed Killer +/datum/reagent/toxin/plantbgone/weedkiller/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) + adjustToxic(round(volume / 2)) + adjustWeeds(-rand(1,volume / 5)) + return 1 + +#undef DEFAULT_ACT_MUTAGEN diff --git a/tgstation.dme b/tgstation.dme index 0f9ce34b..80e0ba16 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1823,7 +1823,6 @@ #include "code\modules\hydroponics\gene_modder.dm" #include "code\modules\hydroponics\grown.dm" #include "code\modules\hydroponics\growninedible.dm" -#include "code\modules\hydroponics\hydro_chemreact.dm" #include "code\modules\hydroponics\hydroitemdefines.dm" #include "code\modules\hydroponics\hydroponics.dm" #include "code\modules\hydroponics\plant_genes.dm" @@ -3061,6 +3060,7 @@ #include "hyperstation\code\modules\mob\mob_helpers.dm" #include "hyperstation\code\modules\patreon\patreon.dm" #include "hyperstation\code\modules\reagents\chemistry\reagents\food_reagents.dm" +#include "hyperstation\code\modules\reagents\chemistry\reagents\hydroponics_reactions.dm" #include "hyperstation\code\modules\resize\resizing.dm" #include "hyperstation\code\modules\resize\sizechems.dm" #include "hyperstation\code\modules\resize\sizegun.dm" From 26937f3bdeafd28d675c9fa0b707822cb2873ac7 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Mon, 1 Mar 2021 09:00:51 -0700 Subject: [PATCH 2/3] modular chemical reactions for hydroponics trays --- code/modules/hydroponics/hydroponics.dm | 6 +- .../subtypes/reagents.dm | 5 +- code/modules/reagents/chemistry/reagents.dm | 4 +- .../reagents/hydroponics_reactions.dm | 267 +++++++++--------- 4 files changed, 144 insertions(+), 138 deletions(-) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 89053916..c7bed07a 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -534,8 +534,12 @@ if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill)) qdel(reagent_source) - if(S.on_tray(H, split, user) >= 1) + if(myseed) + myseed.on_chem_reaction(S) lastuser = user + for(var/datum/reagent/R in S.reagent_list) + if(R.on_tray(H, R.volume, user) >= 1) + lastuser = user S.clear_reagents() qdel(S) diff --git a/code/modules/integrated_electronics/subtypes/reagents.dm b/code/modules/integrated_electronics/subtypes/reagents.dm index 0fc9f58d..bfa2532d 100644 --- a/code/modules/integrated_electronics/subtypes/reagents.dm +++ b/code/modules/integrated_electronics/subtypes/reagents.dm @@ -36,10 +36,11 @@ for(var/obj/machinery/hydroponics/H in trays) var/datum/reagents/temp_reagents = new /datum/reagents() - temp_reagents.my_atom = H source.reagents.trans_to(temp_reagents, split) - H.applyChemicals(temp_reagents) + for(var/datum/reagent/R in temp_reagents.reagent_list) + if(R.on_tray(H, R.volume, src) >= 1) + tray.lastuser = src temp_reagents.clear_reagents() qdel(temp_reagents) diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index ca0349d8..0a98ade5 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -78,8 +78,8 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) return //Hyperstation Edit: Hydroponics trays reactions, idea stolen from citadel but not directly referenced -/datum/reagent/proc/on_tray(/obj/machinery/hydroponics/T, volume, mob/user, override = FALSE) //See hyperstation's reagent module - if(!tray.myseed) +/datum/reagent/proc/on_tray(obj/machinery/hydroponics/T, volume, mob/user) //See hyperstation's reagent module + if(!T.myseed) return 0 return -1 diff --git a/hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm b/hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm index 5dae50eb..da1d8983 100644 --- a/hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm +++ b/hyperstation/code/modules/reagents/chemistry/reagents/hydroponics_reactions.dm @@ -8,286 +8,287 @@ #define DEFAULT_ACT_MUTAGEN switch(rand(100)){\ if(91 to 100){\ - tray.adjustHealth(-10);\ + T.adjustHealth(-10);\ to_chat(user, "The plant shrivels and burns.");}\ if(81 to 90)\ - tray.mutatespecie();\ + T.mutatespecie();\ if(66 to 80)\ - tray.hardmutate();\ + T.hardmutate();\ if(41 to 65)\ - tray.mutate();\ + T.mutate();\ if(21 to 41)\ to_chat(user, "The plants don't seem to react...");\ if(11 to 20)\ - tray.mutateweed();\ + T.mutateweed();\ if(1 to 10)\ - tray.mutatepest(user);\ + T.mutatepest(user);\ else\ to_chat(user, "Nothing happens...");} //Ammonia -/datum/reagent/ammonia/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustHealth(round(volume * 0.5)) - tray.adjustNutri(round(volume * 1)) +/datum/reagent/ammonia/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustHealth(round(volume * 0.5)) + T.adjustNutri(round(volume * 1)) if(..()) - tray.myseed.adjust_yield(round(volume * 0.01)) + T.myseed.adjust_yield(round(volume * 0.01)) return 1 //Ash -/datum/reagent/ash/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/ash/on_tray(obj/machinery/hydroponics/T, volume, mob/user) // Ash is used IRL in gardening, as a fertilizer enhancer and weed killer - adjustHealth(round(volume * 0.25)) - adjustNutri(round(volume * 0.5)) - adjustWeeds(-round(volume / 10)) + T.adjustHealth(round(volume * 0.25)) + T.adjustNutri(round(volume * 0.5)) + T.adjustWeeds(-round(volume / 10)) return 1 //Beer -/datum/reagent/consumable/ethanol/beer/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/consumable/ethanol/beer/on_tray(obj/machinery/hydroponics/T, volume, mob/user) // Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay? - tray.adjustHealth(-round(volume * 0.05)) - tray.adjustNutri(round(volume * 0.25)) - tray.adjustWater(round(volume * 0.7)) + T.adjustHealth(-round(volume * 0.05)) + T.adjustNutri(round(volume * 0.25)) + T.adjustWater(round(volume * 0.7)) return 1 //Blood -/datum/reagent/blood/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustNutri(round(volume * 0.6)) - tray.adjustHealth(-round(volume)) - tray.adjustPests(rand(2,4)) +/datum/reagent/blood/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustNutri(round(volume * 0.6)) + T.adjustHealth(-round(volume)) + T.adjustPests(rand(2,4)) //they HUNGER return 1 //Charcoal -/datum/reagent/medicine/charcoal/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustToxic(-round(volume * 2)) //Antitoxin binds shit pretty well. So the tox goes significantly down +/datum/reagent/medicine/charcoal/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustToxic(-round(volume * 2)) //Antitoxin binds shit pretty well. So the tox goes significantly down return 1 //Chlorine -/datum/reagent/chlorine/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustHealth(-round(volume * 1)) - tray.adjustToxic(round(volume * 1.5)) - tray.adjustWater(-round(volume * 0.5)) - tray.adjustWeeds(-rand(1,volume * 0.125)) +/datum/reagent/chlorine/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustHealth(-round(volume * 1)) + T.adjustToxic(round(volume * 1.5)) + T.adjustWater(-round(volume * 0.5)) + T.adjustWeeds(-rand(1,volume * 0.125)) return 1 //Diethylamine -/datum/reagent/diethylamine/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/diethylamine/on_tray(obj/machinery/hydroponics/T, volume, mob/user) //Corrosive to pests, but not to plants if(..()) - tray.myseed.adjust_yield(round(volume * 0.02)) - tray.adjustHealth(round(volume)) - tray.adjustNutri(round(volume * 2)) - tray.adjustPests(-rand(1,round(volume / 30))) + T.myseed.adjust_yield(round(volume * 0.02)) + T.adjustHealth(round(volume)) + T.adjustNutri(round(volume * 2)) + T.adjustPests(-rand(1,round(volume / 30))) return 1 //Earthsblood -/datum/reagent/medicine/earthsblood/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.self_sufficiency_progress += volume - if(tray.self_sufficiency_progress >= tray.self_sufficiency_req) - tray.become_self_sufficient() +/datum/reagent/medicine/earthsblood/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.self_sufficiency_progress += volume + if(T.self_sufficiency_progress >= T.self_sufficiency_req) + T.become_self_sufficient() else - to_chat(user, "[tray] warms as it might on a spring day under a genuine Sun.") + to_chat(user, "[T] warms as it might on a spring day under a genuine Sun.") return 1 //Enduro-Grow -/datum/reagent/plantnutriment/endurogrow/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/plantnutriment/endurogrow/on_tray(obj/machinery/hydroponics/T, volume, mob/user) if(!..()) return -1 - tray.myseed.adjust_potency(-round(volume / 10)) - tray.myseed.adjust_yield(-round(volume / 30)) - tray.myseed.adjust_endurance(round(volume / 30)) + T.myseed.adjust_potency(-round(volume / 10)) + T.myseed.adjust_yield(-round(volume / 30)) + T.myseed.adjust_endurance(round(volume / 30)) return 1 //E-Z Nutrient -/datum/reagent/plantnutriment/eznutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.yieldmod = 1 - tray.mutmod = 1 +/datum/reagent/plantnutriment/eznutriment/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.yieldmod = 1 + T.mutmod = 1 return ..() //Flourine -/datum/reagent/fluorine/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/fluorine/on_tray(obj/machinery/hydroponics/T, volume, mob/user) // Fluorine one of the most corrosive and deadly gasses - tray.adjustHealth(-round(volume * 2)) - tray.adjustToxic(round(volume * 2.5)) - tray.adjustWater(-round(volume * 0.5)) - tray.adjustWeeds(-rand(1, volume * 0.25)) + T.adjustHealth(-round(volume * 2)) + T.adjustToxic(round(volume * 2.5)) + T.adjustWater(-round(volume * 0.5)) + T.adjustWeeds(-rand(1, volume * 0.25)) return 1 //Fluorosulfuric acid -/datum/reagent/toxin/acid/fluacid/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustHealth(-round(volume * 2)) - tray.adjustToxic(round(volume * 3)) - trayadjustWeeds(-rand(1,volume * 0.5)) +/datum/reagent/toxin/acid/fluacid/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustHealth(-round(volume * 2)) + T.adjustToxic(round(volume * 3)) + T.adjustWeeds(-rand(1,volume * 0.5)) return 1 //Holy Water -/datum/reagent/water/holywater/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/water/holywater/on_tray(obj/machinery/hydroponics/T, volume, mob/user) //Mostly the same as water, it also heals the plant a little with the power of the spirits~ - tray.adjustWater(round(volume)) - tray.adjustHealth(round(volume * 0.1)) + T.adjustWater(round(volume)) + T.adjustHealth(round(volume * 0.1)) return 1 //Left-4-Zed -/datum/reagent/plantnutriment/left4zednutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.yieldmod = 0 - tray.mutmod = 2 +/datum/reagent/plantnutriment/left4zednutriment/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.yieldmod = 0 + T.mutmod = 2 return ..() //Liquid Earthquake -/datum/reagent/plantnutriment/liquidearthquake/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/plantnutriment/liquidearthquake/on_tray(obj/machinery/hydroponics/T, volume, mob/user) if(!..()) return -1 - tray.myseed.adjust_weed_chance(round(volume / 10)) - tray.myseed.adjust_weed_rate(round(volume / 30)) - tray.myseed.adjust_production(-round(volume / 30)) + T.myseed.adjust_weed_chance(round(volume / 10)) + T.myseed.adjust_weed_rate(round(volume / 30)) + T.myseed.adjust_production(-round(volume / 30)) return 1 //Milk -/datum/reagent/consumable/milk/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustNutri(round(volume * 0.2)) - tray.adjustWater(round(volume * 0.5)) +/datum/reagent/consumable/milk/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustNutri(round(volume * 0.2)) + T.adjustWater(round(volume * 0.5)) if(..()) // Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. - if(!tray.myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) //Not shrooms though - tray.adjustHealth(-round(volume / 2)) + if(!T.myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) //Not shrooms though + T.adjustHealth(-round(volume / 2)) return 1 //Napalm -/datum/reagent/napalm/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/napalm/on_tray(obj/machinery/hydroponics/T, volume, mob/user) if(..()) - if(tray.myseed.resistance_flags & FIRE_PROOF) + if(T.myseed.resistance_flags & FIRE_PROOF) return 1 - tray.adjustHealth(-round(S.get_reagent_amount(/datum/reagent/napalm) * 6)) - tray.adjustToxic(round(S.get_reagent_amount(/datum/reagent/napalm) * 7)) - tray.adjustWeeds(-rand(5,9)) + T.adjustHealth(-round(volume * 6)) + T.adjustToxic(round(volume * 7)) + T.adjustWeeds(-rand(5,9)) return 1 //Nutriment -/datum/reagent/consumable/nutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/consumable/nutriment/on_tray(obj/machinery/hydroponics/T, volume, mob/user) //Compost, effectively - tray.adjustHealth(round(volume * 0.5)) - tray.adjustNutri(round(volume)) + T.adjustHealth(round(volume * 0.5)) + T.adjustNutri(round(volume)) return 1 //Pest Killer -/datum/reagent/toxin/pestkiller/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustToxic(round(volume * 0.5)) - tray.adjustPests(-rand(1,volume / 5)) +/datum/reagent/toxin/pestkiller/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustToxic(round(volume * 0.5)) + T.adjustPests(-rand(1,volume / 5)) return 1 //Phosphorus -/datum/reagent/phosphorus/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/phosphorus/on_tray(obj/machinery/hydroponics/T, volume, mob/user) // White Phosphorous + water -> phosphoric acid. That's not a good thing really. // Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. - tray.adjustHealth(-round(volume * 0.75)) - tray.adjustNutri(round(volume * 0.1)) - tray.adjustWater(-round(volume * 0.5)) - tray.adjustWeeds(-rand(1, volume * 0.1)) + T.adjustHealth(-round(volume * 0.75)) + T.adjustNutri(round(volume * 0.1)) + T.adjustWater(-round(volume * 0.5)) + T.adjustWeeds(-rand(1, volume * 0.1)) return 1 //Plant-B-Gone -/datum/reagent/toxin/plantbgone/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustHealth(-round(volume * 5)) - tray.adjustToxic(round(volume * 6)) - tray.adjustWeeds(-rand(4,8)) +/datum/reagent/toxin/plantbgone/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustHealth(-round(volume * 5)) + T.adjustToxic(round(volume * 6)) + T.adjustWeeds(-rand(4,8)) return 1 //Plant Base //For subtypes of /datum/reagent/plantnutriment/ -/datum/reagent/plantnutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustNutri(round(volume)) +/datum/reagent/plantnutriment/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustNutri(round(volume)) return ..() //Radium -/datum/reagent/radium/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/radium/on_tray(obj/machinery/hydroponics/T, volume, mob/user) if(volume >= 10) DEFAULT_ACT_MUTAGEN else if(volume >= 5) - tray.hardmutate() + T.hardmutate() else if(volume >= 2) - tray.mutate() + T.mutate() - tray.adjustHealth(-round(volume)) - tray.adjustToxic(round(volume * 3)) // Radium is harsher (OOC: also easier to produce) + T.adjustHealth(-round(volume)) + T.adjustToxic(round(volume * 3)) // Radium is harsher (OOC: also easier to produce) return 1 //Robust Harvest -/datum/reagent/plantnutriment/robustharvestnutriment/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.yieldmod = 1.3 - tray.mutmod = 0 +/datum/reagent/plantnutriment/robustharvestnutriment/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.yieldmod = 1.3 + T.mutmod = 0 return ..() //Saltpetre -/datum/reagent/saltpetre/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/saltpetre/on_tray(obj/machinery/hydroponics/T, volume, mob/user) // Saltpetre is used for gardening IRL. To simplify highly, it speeds up growth and strengthens plants - adjustHealth(round(salt * 0.25)) + T.adjustHealth(round(volume * 0.25)) if (..()) - tray.myseed.adjust_production(-round(volume/100)-prob(volume%100)) - tray.myseed.adjust_potency(round(volume*0.5)) + T.myseed.adjust_production(-round(volume/100)-prob(volume%100)) + T.myseed.adjust_potency(round(volume*0.5)) return 1 //Soda Water -/datum/reagent/consumable/sodawater/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/consumable/sodawater/on_tray(obj/machinery/hydroponics/T, volume, mob/user) // A variety of nutrients are dissolved in club soda, without sugar. // These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth. - tray.adjustWater(round(volume) * 0.9) - tray.adjustHealth(round(volume * 0.1)) - tray.adjustNutri(round(volume * 0.1)) + T.adjustWater(round(volume) * 0.9) + T.adjustHealth(round(volume * 0.1)) + T.adjustNutri(round(volume * 0.1)) return 1 //Sugar -/datum/reagent/consumable/sugar/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustWeeds(round(rand(1, volume / 5))) - tray.adjustPests(round(rand(1, volume / 5))) +/datum/reagent/consumable/sugar/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustWeeds(round(rand(1, volume / 5))) + T.adjustPests(round(rand(1, volume / 5))) return 1 //Sulphuric Acid -/datum/reagent/toxin/acid/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustHealth(-round(volume * 1)) - tray.adjustToxic(round(volume * 1.5)) - tray.adjustWeeds(-rand(1,volume * 0.25)) +/datum/reagent/toxin/acid/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustHealth(-round(volume * 1)) + T.adjustToxic(round(volume * 1.5)) + T.adjustWeeds(-rand(1,volume * 0.25)) return 1 //Toxin -/datum/reagent/toxin/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - adjustToxic(round(volume * 2)) +/datum/reagent/toxin/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustToxic(round(volume * 2)) return 1 //Unstable Mutagen -/datum/reagent/toxin/mutagen/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/toxin/mutagen/on_tray(obj/machinery/hydroponics/T, volume, mob/user) if(volume >= 5) DEFAULT_ACT_MUTAGEN else if(volume >= 2) - tray.hardmutate() + T.hardmutate() else if(volume >= 1) - tray.mutate() + T.mutate() return 1 //Uranium -/datum/reagent/uranium/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) +/datum/reagent/uranium/on_tray(obj/machinery/hydroponics/T, volume, mob/user) if(volume >= 10) DEFAULT_ACT_MUTAGEN else if(volume >= 5) - tray.hardmutate() + T.hardmutate() else if(volume >= 2) - tray.mutate() + T.mutate() - tray.adjustHealth(-round(volume)) - tray.adjustToxic(round(volume * 2)) + T.adjustHealth(-round(volume)) + T.adjustToxic(round(volume * 2)) return 1 //Virus Food -/datum/reagent/toxin/mutagen/mutagenvirusfood/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustNutri(round(volume * 0.5)) - tray.adjustHealth(-round(volume * 0.5)) +/datum/reagent/toxin/mutagen/mutagenvirusfood/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustNutri(round(volume * 0.5)) + T.adjustHealth(-round(volume * 0.5)) + return 1 //Water -/datum/reagent/water/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - tray.adjustWater(round(volume)) +/datum/reagent/water/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustWater(round(volume)) return 1 //Weed Killer -/datum/reagent/toxin/plantbgone/weedkiller/on_tray(/obj/machinery/hydroponics/tray, volume, mob/user) - adjustToxic(round(volume / 2)) - adjustWeeds(-rand(1,volume / 5)) +/datum/reagent/toxin/plantbgone/weedkiller/on_tray(obj/machinery/hydroponics/T, volume, mob/user) + T.adjustToxic(round(volume / 2)) + T.adjustWeeds(-rand(1,volume / 5)) return 1 #undef DEFAULT_ACT_MUTAGEN From 11fac8bd1e61109ba36af576fec9d33bc1c4bae3 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Mon, 1 Mar 2021 09:03:48 -0700 Subject: [PATCH 3/3] conflict --- code/modules/food_and_drinks/food/snacks_vend.dm | 2 +- code/modules/reagents/chemistry/reagents/drink_reagents.dm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/food_and_drinks/food/snacks_vend.dm b/code/modules/food_and_drinks/food/snacks_vend.dm index f4249432..db4abc6c 100644 --- a/code/modules/food_and_drinks/food/snacks_vend.dm +++ b/code/modules/food_and_drinks/food/snacks_vend.dm @@ -107,7 +107,7 @@ filling_color = "#F5F5DC" tastes = list("sweetness" = 3, "cake" = 1) foodtype = GRAIN | FRUIT | VEGETABLES | ANTITOXIC - price = 5 + price = 5 /obj/item/reagent_containers/food/snacks/carbonnanotube_noodles name = "carbon nanotube noodles" diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index 853a0000..b45e56d8 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -942,7 +942,7 @@ glass_icon_state = "glass_yellow" glass_name = "glass of bungo juice" glass_desc = "Exotic! You feel like you are on vacation already." - hydration = 1 * REAGENTS_METABOLISM + hydration = 1 * REAGENTS_METABOLISM /datum/reagent/consumable/aloejuice name = "Aloe Juice" @@ -952,7 +952,7 @@ glass_icon_state = "glass_yellow" glass_name = "glass of aloe juice" glass_desc = "A healthy and refreshing juice." - hydration = 2 * REAGENTS_METABOLISM + hydration = 2 * REAGENTS_METABOLISM /datum/reagent/consumable/aloejuice/on_mob_life(mob/living/M) if(prob(30))