From 94cd248b2023e93647a29d04f2d164fc4909d323 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Sun, 1 Sep 2019 18:59:13 -0400 Subject: [PATCH] Fixes Some Null Tastes and Fruit Wine --- code/modules/food_and_drinks/food/snacks.dm | 21 +++++++++---------- code/modules/hydroponics/grown.dm | 5 ++++- code/modules/hydroponics/seeds.dm | 20 +++++++++--------- code/modules/reagents/chemistry/reagents.dm | 2 +- .../reagents/chemistry/reagents/drink_cold.dm | 1 - .../reagents/chemistry/reagents/food.dm | 3 +-- .../reagents/chemistry/reagents/misc.dm | 9 +++----- .../chemistry/reagents/pyrotechnic.dm | 2 +- .../reagents/chemistry/reagents/toxins.dm | 17 +++++++-------- .../reagents/chemistry/reagents/water.dm | 8 +++---- 10 files changed, 42 insertions(+), 46 deletions(-) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index 41d549c6bc1..3839c977a86 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -19,17 +19,16 @@ var/list/tastes // for example list("crisps" = 2, "salt" = 1) /obj/item/reagent_containers/food/snacks/add_initial_reagents() - if(!list_reagents) - return - if(!tastes || !tastes.len) - return ..() - var/list/nutritious_reagents = list("nutriment", "vitamin", "protein", "plantmatter") - for(var/reagent_id in list_reagents) - var/amount = list_reagents[reagent_id] - if(reagent_id in nutritious_reagents) - reagents.add_reagent(reagent_id, amount, tastes.Copy()) - else - reagents.add_reagent(reagent_id, amount) + if(tastes && tastes.len) + if(list_reagents) + for(var/rid in list_reagents) + var/amount = list_reagents[rid] + if(rid == "nutriment" || rid == "vitamin" || rid == "protein" || rid == "plantmatter") + reagents.add_reagent(rid, amount, tastes.Copy()) + else + reagents.add_reagent(rid, amount) + else + ..() //Placeholder for effect that trigger on eating that aren't tied to reagents. /obj/item/reagent_containers/food/snacks/proc/On_Consume(mob/M, mob/user) diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 361c305bb8d..63d21bced03 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -20,6 +20,9 @@ /obj/item/reagent_containers/food/snacks/grown/New(newloc, var/obj/item/seeds/new_seed = null) ..() + if(!tastes) + tastes = list("[name]" = 1) + if(new_seed) seed = new_seed.Copy() else if(ispath(seed)) @@ -68,7 +71,7 @@ if(!isturf(loc) || !(locate(/obj/structure/table) in loc) && !(locate(/obj/machinery/optable) in loc) && !(locate(/obj/item/storage/bag/tray) in loc)) to_chat(user, "You cannot slice [src] here! You need a table or at least a tray to do it.") - return TRUE + return TRUE var/slices_lost = 0 if(!inaccurate) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index ec07a4cdfc9..d9e07d96987 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -160,23 +160,23 @@ return result -/obj/item/seeds/proc/prepare_result(var/obj/item/T) +/obj/item/seeds/proc/prepare_result(obj/item/T) if(!T.reagents) CRASH("[T] has no reagents.") - for(var/reagent_id in reagents_add) - var/amount = 1 + round(potency * reagents_add[reagent_id], 1) + + for(var/rid in reagents_add) + var/amount = 1 + round(potency * reagents_add[rid], 1) + var/list/data = null - if(reagent_id == "blood") // Hack to make blood in plants always O- + if(rid == "blood") // Hack to make blood in plants always O- data = list("blood_type" = "O-") - continue - var/list/nutritious_reagents = list("nutriment", "vitamin", "protein", "plantmatter") - if(reagent_id in nutritious_reagents) + if(rid == "nutriment" || rid == "vitamin" || rid == "protein" || rid == "plantmatter") + // apple tastes of apple. if(istype(T, /obj/item/reagent_containers/food/snacks/grown)) var/obj/item/reagent_containers/food/snacks/grown/grown_edible = T - data = grown_edible.tastes + data = grown_edible.tastes.Copy() - T.reagents.add_reagent(reagent_id, amount, data) - return 1 + T.reagents.add_reagent(rid, amount, data) /// Setters procs /// diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 577b21ce3be..b1aca9820b5 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -27,7 +27,7 @@ var/drink_name = "Glass of ..what?" var/drink_desc = "You can't really tell what this is." var/taste_mult = 1 //how easy it is to taste - the more the easier - var/taste_description = "bitterness" //life's bitter by default. Cool points for using a span class for when you're tasting LIQUID FUCKING DEATH + var/taste_description = "metaphorical salt" /datum/reagent/Destroy() . = ..() diff --git a/code/modules/reagents/chemistry/reagents/drink_cold.dm b/code/modules/reagents/chemistry/reagents/drink_cold.dm index 66931ae0847..ac7adf3eadf 100644 --- a/code/modules/reagents/chemistry/reagents/drink_cold.dm +++ b/code/modules/reagents/chemistry/reagents/drink_cold.dm @@ -1,7 +1,6 @@ /datum/reagent/consumable/drink/cold name = "Cold drink" adj_temp_cool = 5 - taste_description = null /datum/reagent/consumable/drink/cold/tonic name = "Tonic Water" diff --git a/code/modules/reagents/chemistry/reagents/food.dm b/code/modules/reagents/chemistry/reagents/food.dm index 35cf0153255..2479a82decf 100644 --- a/code/modules/reagents/chemistry/reagents/food.dm +++ b/code/modules/reagents/chemistry/reagents/food.dm @@ -25,7 +25,6 @@ reagent_state = SOLID nutriment_factor = 15 * REAGENTS_METABOLISM color = "#664330" // rgb: 102, 67, 48 - taste_description = null /datum/reagent/consumable/nutriment/on_mob_life(mob/living/M) var/update_flags = STATUS_UPDATE_NONE @@ -389,7 +388,7 @@ description = "Heated beyond usefulness, this enzyme is now worthless." reagent_state = LIQUID color = "#282314" // rgb: 54, 94, 48 - taste_description = null + taste_description = "sweetness" /datum/reagent/consumable/dry_ramen name = "Dry Ramen" diff --git a/code/modules/reagents/chemistry/reagents/misc.dm b/code/modules/reagents/chemistry/reagents/misc.dm index bec91e71798..d34e6537cb8 100644 --- a/code/modules/reagents/chemistry/reagents/misc.dm +++ b/code/modules/reagents/chemistry/reagents/misc.dm @@ -38,7 +38,6 @@ description = "A colorless, odorless gas." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 - taste_description = null taste_mult = 0 /datum/reagent/nitrogen @@ -47,7 +46,6 @@ description = "A colorless, odorless, tasteless gas." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 - taste_description = null taste_mult = 0 /datum/reagent/hydrogen @@ -56,7 +54,6 @@ description = "A colorless, odorless, nonmetallic, tasteless, highly combustible diatomic gas." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 - taste_description = null taste_mult = 0 /datum/reagent/potassium @@ -197,7 +194,7 @@ description = "A secondary amine, useful as a plant nutrient and as building block for other compounds." reagent_state = LIQUID color = "#322D00" - taste_description = null + taste_description = "iron" /datum/reagent/oil name = "Oil" @@ -252,7 +249,7 @@ description = "A red-brown liquid element." reagent_state = LIQUID color = "#4E3A3A" - taste_description = null + taste_description = "chemicals" /datum/reagent/phenol name = "Phenol" @@ -260,7 +257,7 @@ description = "Also known as carbolic acid, this is a useful building block in organic chemistry." reagent_state = LIQUID color = "#525050" - taste_description = null + taste_description = "acid" /datum/reagent/ash name = "Ash" diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm index 982433f8ee1..bd4079d69c6 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm @@ -225,7 +225,7 @@ color = "#FF0000" metabolization_rate = 4 process_flags = ORGANIC | SYNTHETIC - taste_description = null + taste_mult = 0 /datum/reagent/clf3/on_mob_life(mob/living/M) if(M.on_fire) diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index 7ebdb1b6912..10c216ca60c 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -219,7 +219,7 @@ description = "A silvery-white metallic chemical element in the actinide series, weakly radioactive." reagent_state = SOLID color = "#B8B8C0" // rgb: 184, 184, 192 - taste_description = null + taste_mult = 0 /datum/reagent/uranium/on_mob_life(mob/living/M) M.apply_effect(2, IRRADIATE, negate_armor = 1) @@ -365,7 +365,7 @@ metabolization_rate = 0.1 penetrates_skin = TRUE can_synth = FALSE - taste_description = null + taste_mult = 0 /datum/reagent/polonium/on_mob_life(mob/living/M) M.apply_effect(8, IRRADIATE, negate_armor = 1) @@ -379,7 +379,7 @@ color = "#E7C4C4" metabolization_rate = 0.2 overdose_threshold = 40 - taste_description = null + taste_mult = 0 /datum/reagent/histamine/reaction_mob(mob/living/M, method=TOUCH, volume) //dumping histamine on someone is VERY mean. if(iscarbon(M)) @@ -652,7 +652,7 @@ reagent_state = LIQUID color = "#7F10C0" can_synth = FALSE - taste_description = null + taste_mult = 0 /datum/reagent/initropidril/on_mob_life(mob/living/M) var/update_flags = STATUS_UPDATE_NONE @@ -684,7 +684,6 @@ reagent_state = LIQUID color = "#1E4664" metabolization_rate = 0.2 - taste_description = null taste_mult = 0 /datum/reagent/pancuronium/on_mob_life(mob/living/M) @@ -720,7 +719,7 @@ color = "#5F8BE1" metabolization_rate = 0.7 can_synth = FALSE - taste_description = null + taste_mult = 0 /datum/reagent/sodium_thiopental/on_mob_life(mob/living/M) var/update_flags = STATUS_UPDATE_NONE @@ -750,7 +749,7 @@ metabolization_rate = 0.8 penetrates_skin = TRUE can_synth = FALSE - taste_description = null + taste_mult = 0 /datum/reagent/ketamine/on_mob_life(mob/living/M) var/update_flags = STATUS_UPDATE_NONE @@ -802,7 +801,7 @@ description = "A toxin produced by certain mushrooms. Very deadly." reagent_state = LIQUID color = "#D9D9D9" - taste_description = null + taste_mult = 0 /datum/reagent/amanitin/on_mob_delete(mob/living/M) M.adjustToxLoss(current_cycle*rand(2,4)) @@ -907,7 +906,7 @@ metabolization_rate = 0.1 penetrates_skin = TRUE overdose_threshold = 25 - taste_description = null + taste_mult = 0 /datum/reagent/sarin/on_mob_life(mob/living/M) var/update_flags = STATUS_UPDATE_NONE diff --git a/code/modules/reagents/chemistry/reagents/water.dm b/code/modules/reagents/chemistry/reagents/water.dm index 335f2ba1647..64156a7cadd 100644 --- a/code/modules/reagents/chemistry/reagents/water.dm +++ b/code/modules/reagents/chemistry/reagents/water.dm @@ -13,22 +13,22 @@ description = "A ubiquitous chemical substance that is composed of hydrogen and oxygen." reagent_state = LIQUID color = "#0064C8" // rgb: 0, 100, 200 + taste_description = "water" var/cooling_temperature = 2 process_flags = ORGANIC | SYNTHETIC drink_icon = "glass_clear" drink_name = "Glass of Water" drink_desc = "The father of all refreshments." - taste_description = null var/water_temperature = 283.15 // As reagents don't have a temperature value, we'll just use 10 celsius. /datum/reagent/water/reaction_mob(mob/living/M, method = TOUCH, volume) M.water_act(volume, water_temperature, src, method) /datum/reagent/water/reaction_turf(turf/simulated/T, volume) - T.water_act(volume, water_temperature, src) + T.water_act(volume, water_temperature, src) /datum/reagent/water/reaction_obj(obj/O, volume) - O.water_act(volume, water_temperature, src) + O.water_act(volume, water_temperature, src) /datum/reagent/lube name = "Space Lube" @@ -261,7 +261,7 @@ drink_icon = "glass_clear" drink_name = "Glass of Water" drink_desc = "The father of all refreshments." - taste_description = null + taste_description = "water" /datum/reagent/holywater/on_mob_life(mob/living/M) var/update_flags = STATUS_UPDATE_NONE