From 28bb2b51b0475013f7a0d6e10e8e91cb98907daa Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 27 May 2023 23:36:50 +1000 Subject: [PATCH] Reworking the taste system to allow for species-level taste definitions. Reworking how data is initialized and handled by reagents. Post-rebase update for taste PR. Further work on the taste system. Updating taste strings. God help me. --- code/__defines/mobs.dm | 3 + code/_helpers/_lists.dm | 21 +- .../technomancer/spells/condensation.dm | 2 +- code/modules/food/food/snacks.dm | 336 +++++++++++---- code/modules/food/food/thecake.dm | 2 + code/modules/mob/living/carbon/taste.dm | 28 +- code/modules/reagents/holder/holder.dm | 26 +- code/modules/reagents/reagents/_reagents.dm | 93 ++++- code/modules/reagents/reagents/core.dm | 23 +- code/modules/reagents/reagents/dispenser.dm | 10 +- code/modules/reagents/reagents/food_drinks.dm | 386 +++++++++++++----- code/modules/reagents/reagents/other.dm | 24 +- code/modules/reagents/reagents/toxins.dm | 10 +- code/modules/reagents/reagents/vox.dm | 5 +- code/modules/xenobio/items/slime_objects.dm | 7 +- 15 files changed, 700 insertions(+), 276 deletions(-) diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index 54d5e473b70..07066731fca 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -277,6 +277,9 @@ #define TASTE_DULL 0.5 //anything below 30% #define TASTE_NUMB 0.1 //anything below 150% +#define TASTE_STRING_DEFAULT "default" +#define TASTE_DATA_FIELD "taste_strings" + //Used by emotes #define VISIBLE_MESSAGE 1 #define AUDIBLE_MESSAGE 2 diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index 61a66a5b36a..9acc1f0cdcb 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -890,12 +890,15 @@ This actually tests if they have the same entries and values. var/global/list/json_cache = list() /proc/cached_json_decode(var/json_to_decode) - if(!json_to_decode || !length(json_to_decode)) - return list() - try - if(isnull(global.json_cache[json_to_decode])) - global.json_cache[json_to_decode] = json_decode(json_to_decode) - . = global.json_cache[json_to_decode] - catch(var/exception/e) - log_error("Exception during JSON decoding ([json_to_decode]): [e]") - return list() \ No newline at end of file + if(length(json_to_decode)) + try + if(isnull(global.json_cache[json_to_decode])) + global.json_cache[json_to_decode] = json_decode(json_to_decode) + var/list/decoded = global.json_cache[json_to_decode] + if(islist(decoded)) // To prevent cache mutation. + return deepCopyList(decoded) + else if(decoded) + return decoded + catch(var/exception/e) + log_error("Exception during JSON decoding ([json_to_decode]): [e]") + return list() diff --git a/code/game/gamemodes/technomancer/spells/condensation.dm b/code/game/gamemodes/technomancer/spells/condensation.dm index 8d6b0790f76..cd265df0c87 100644 --- a/code/game/gamemodes/technomancer/spells/condensation.dm +++ b/code/game/gamemodes/technomancer/spells/condensation.dm @@ -41,4 +41,4 @@ add_attack_logs(user,hit_atom,"Wetted the floor with [src] at [T.x],[T.y],[T.z]") else if(hit_atom.reagents && !ismob(hit_atom)) //TODO: Something for the scepter hit_atom.reagents.add_reagent(id = "water", amount = 60, data = null, safety = 0) - adjust_instability(5) \ No newline at end of file + adjust_instability(5) diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index 35f9fbe3539..eca79885717 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -30,12 +30,20 @@ /obj/item/reagent_containers/food/snacks/Initialize() . = ..() + if(nutriment_desc) + nutriment_desc = list(TASTE_DATA_FIELD = get_cached_taste_data("nutriment", nutriment_desc)) if(nutriment_amt) - reagents.add_reagent("nutriment",nutriment_amt,nutriment_desc) + reagents.add_reagent("nutriment", nutriment_amt, nutriment_desc) if(nutriment_allergens && reagents) for(var/datum/reagent/r in reagents.reagent_list) if(r.id == "nutriment") r.allergen_type = nutriment_allergens + if(. != INITIALIZE_HINT_QDEL) + return INITIALIZE_HINT_LATELOAD + +/obj/item/reagent_containers/food/snacks/LateInitialize() + . = ..() + nutriment_desc = null //Placeholder for effect that trigger on eating that aren't tied to reagents. /obj/item/reagent_containers/food/snacks/proc/On_Consume(var/mob/M) @@ -423,7 +431,10 @@ icon = 'icons/obj/food_donuts.dmi' icon_state = "donut" filling_color = "#D9C386" - nutriment_desc = list("sweetness", "fried dough") + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness", "fried dough"), + SPECIES_TESHARI = list("fried dough") + ) nutriment_amt = 3 nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_EGGS|ALLERGEN_GRAINS bitesize = 4 @@ -1188,7 +1199,10 @@ filling_color = "#E0CF9B" center_of_mass = list("x"=17, "y"=4) nutriment_amt = 6 - nutriment_desc = list("mild sweetness" = 3, "fluffy bread" = 3) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("mild sweetness" = 3, "fluffy bread" = 3), + SPECIES_TESHARI = list("fluffy bread" = 3) + ) bitesize = 2 /obj/item/reagent_containers/food/snacks/pie @@ -1200,7 +1214,10 @@ filling_color = "#FBFFB8" center_of_mass = list("x"=16, "y"=13) nutriment_amt = 4 - nutriment_desc = list("sweet wholewheat crust" = 3, "whipped cream" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet wholewheat crust" = 3, "whipped cream" = 2), + SPECIES_TESHARI = list("wholewheat crust" = 3, "whipped cream" = 2) + ) bitesize = 3 /obj/item/reagent_containers/food/snacks/pie/Initialize() @@ -1220,7 +1237,7 @@ trash = /obj/item/trash/plate center_of_mass = list("x"=16, "y"=13) nutriment_amt = 4 - nutriment_desc = list("egg custard" = 2, "sweet pie crust" = 3) + nutriment_desc = list("egg custard" = 2, "pie crust" = 3) nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_EGGS bitesize = 3 @@ -1312,7 +1329,10 @@ filling_color = "#FFCCCC" center_of_mass = list("x"=17, "y"=9) nutriment_amt = 5 - nutriment_desc = list("sweetness" = 2, "sour fungus" = 4, "savory pastry" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 2, "sour fungus" = 4, "savory pastry" = 2), + SPECIES_TESHARI = list("subtle bitterness" = 2, "sour fungus" = 4, "savory pastry" = 2) + ) bitesize = 3 /obj/item/reagent_containers/food/snacks/amanita_pie/Initialize() @@ -1545,7 +1565,10 @@ filling_color = "#E8E79E" center_of_mass = list("x"=15, "y"=14) nutriment_amt = 3 - nutriment_desc = list("sweet cracker" = 2, "vanilla" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet cracker" = 2, "vanilla" = 1), + SPECIES_TESHARI = list("cracker" = 2, "vanilla" = 1) + ) bitesize = 2 /obj/item/reagent_containers/food/snacks/badrecipe @@ -2149,7 +2172,10 @@ filling_color = "#FF00F7" center_of_mass = list("x"=15, "y"=11) nutriment_amt = 8 - nutriment_desc = list("toasted fungal umami" = 7, "sweetness" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("toasted fungal umami" = 7, "sweetness" = 1), + SPECIES_TESHARI = list("toasted fungal umami" = 5, "unpleasant bitterness" = 2) + ) nutriment_allergens = ALLERGEN_FUNGI bitesize = 4 @@ -2359,7 +2385,10 @@ filling_color = "#F21873" center_of_mass = list("x"=15, "y"=13) nutriment_amt = 3 - nutriment_desc = list("apple" = 3, "sweetness" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("apple" = 3, "sweetness" = 2), + SPECIES_TESHARI = list("apple" = 3, "tacky, chewy blandness" = 1, "mild bitterness" = 1) + ) bitesize = 3 /obj/item/reagent_containers/food/snacks/caramelapple @@ -2369,7 +2398,10 @@ filling_color = "#F21873" center_of_mass = list("x"=15, "y"=13) nutriment_amt = 3 - nutriment_desc = list("apple" = 3, "caramel" = 3, "sweetness" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("apple" = 3, "caramel" = 3, "sweetness" = 2), + SPECIES_TESHARI = list("apple" = 3, "caramel" = 3, "tacky, chewy blandness" = 1, "mild bitterness" = 1) + ) bitesize = 3 /obj/item/reagent_containers/food/snacks/applepie @@ -2379,7 +2411,10 @@ filling_color = "#E0EDC5" center_of_mass = list("x"=16, "y"=13) nutriment_amt = 4 - nutriment_desc = list("sweetness" = 2, "apple" = 2, "sweet pie crust" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 2, "apple" = 2, "sweet pie crust" = 2), + SPECIES_TESHARI = list("mild bitterness" = 2, "apple" = 2, "pie crust" = 2) + ) nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_GRAINS|ALLERGEN_SUGARS bitesize = 3 @@ -2390,7 +2425,11 @@ filling_color = "#FF525A" center_of_mass = list("x"=16, "y"=11) nutriment_amt = 4 - nutriment_desc = list("sweetness" = 2, "cherry" = 2, "sweet pie crust" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 2, "cherry" = 2, "sweet pie crust" = 2), + SPECIES_TESHARI = list("mild bitterness" = 2, "cherry" = 2, "pie crust" = 2) + ) + nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_GRAINS|ALLERGEN_SUGARS bitesize = 3 @@ -2678,7 +2717,10 @@ slices_num = 5 filling_color = "#EDE5AD" center_of_mass = list("x"=16, "y"=9) - nutriment_desc = list("sweet bread" = 10) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet bread" = 10), + SPECIES_TESHARI = list("fruity bread" = 10, "an unpleasant bitter aftertaste" = 1) + ) nutriment_amt = 10 nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_GRAINS|ALLERGEN_SUGARS bitesize = 2 @@ -2734,7 +2776,10 @@ slices_num = 5 filling_color = "#FFD675" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "carrot" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "carrot" = 15), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "carrot" = 15) + ) nutriment_amt = 25 nutriment_allergens = ALLERGEN_VEGETABLE|ALLERGEN_GRAINS|ALLERGEN_SUGARS|ALLERGEN_EGGS bitesize = 2 @@ -2764,7 +2809,10 @@ slices_num = 5 filling_color = "#E6AEDB" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "slime" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "slime" = 15), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "slime" = 15) + ) nutriment_amt = 15 nutriment_allergens = ALLERGEN_MEAT|ALLERGEN_SUGARS|ALLERGEN_EGGS bitesize = 2 @@ -2795,7 +2843,11 @@ slices_num = 5 filling_color = "#FAF7AF" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("sweet wholewheat crust" = 5, "sweet cream cheese" = 20) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet wholewheat crust" = 5, "sweet cream cheese" = 20), + SPECIES_TESHARI = list("wholewheat crust" = 5, "cream cheese" = 20, "a mild bitter aftertaste" = 1) + ) + nutriment_amt = 25 nutriment_allergens = ALLERGEN_DAIRY|ALLERGEN_GRAINS|ALLERGEN_SUGARS|ALLERGEN_EGGS bitesize = 2 @@ -2847,7 +2899,10 @@ slices_num = 5 filling_color = "#F7EDD5" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "vanilla" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "vanilla" = 15), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "vanilla" = 15) + ) nutriment_amt = 25 nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_EGGS|ALLERGEN_DAIRY|ALLERGEN_GRAINS @@ -2872,7 +2927,10 @@ slices_num = 5 filling_color = "#FADA8E" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "orange marmalade" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "orange marmalade" = 15), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "oranges" = 15) + ) nutriment_amt = 25 nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_EGGS|ALLERGEN_DAIRY|ALLERGEN_GRAINS|ALLERGEN_FRUIT @@ -2897,7 +2955,10 @@ slices_num = 5 filling_color = "#CBFA8E" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "lime marmalade" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "lime marmalade" = 15), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "limes" = 15) + ) nutriment_amt = 25 nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_EGGS|ALLERGEN_DAIRY|ALLERGEN_GRAINS|ALLERGEN_FRUIT @@ -2922,7 +2983,10 @@ slices_num = 5 filling_color = "#FAFA8E" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "lemon curd" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "lemon curd" = 15), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "lemon curd" = 15) + ) nutriment_amt = 25 nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_EGGS|ALLERGEN_DAIRY|ALLERGEN_GRAINS|ALLERGEN_FRUIT @@ -2947,7 +3011,10 @@ slices_num = 5 filling_color = "#805930" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "ganache" = 10, "chocolate" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "ganache" = 10, "chocolate" = 15), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "rich bitterness" = 10, "chocolate" = 15) + ) nutriment_amt = 20 /obj/item/reagent_containers/food/snacks/slice/chocolatecake @@ -2992,7 +3059,11 @@ slices_num = 5 filling_color = "#FFD6D6" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "buttercream icing" = 10) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "buttercream icing" = 10), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "buttercream icing" = 10) + ) + nutriment_amt = 25 nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_EGGS|ALLERGEN_DAIRY|ALLERGEN_GRAINS bitesize = 3 @@ -3085,7 +3156,10 @@ slices_num = 5 filling_color = "#EBF5B8" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("cake" = 10, "sweetness" = 10, "baked apple" = 15) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 10, "sweetness" = 10, "baked apple" = 10), + SPECIES_TESHARI = list("cake" = 10, "mild bitterness" = 5, "baked apple" = 10) + ) nutriment_amt = 25 nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_EGGS|ALLERGEN_DAIRY|ALLERGEN_GRAINS|ALLERGEN_FRUIT @@ -3110,7 +3184,10 @@ slices_num = 5 filling_color = "#F5B951" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("sweet pie crust" = 5, "cream" = 5, "spiced pumpkin" = 5) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet pie crust" = 5, "cream" = 5, "spiced pumpkin" = 5), + SPECIES_TESHARI = list("pie crust" = 5, "cream" = 5, "spiced pumpkin" = 5, "mild bitterness" = 1) + ) nutriment_amt = 15 /obj/item/reagent_containers/food/snacks/slice/pumpkinpie @@ -3250,7 +3327,7 @@ slice_path = /obj/item/reagent_containers/food/snacks/slice/vegetablepizza slices_num = 6 center_of_mass = list("x"=16, "y"=11) - nutriment_desc = list("pizza crust" = 10, "tomato" = 10, "mozzarella cheese" = 5, "baked eggplant" = 5, "baked carrot" = 5, "sweetcorn" = 5) + nutriment_desc = list("pizza crust" = 10, "tomato" = 10, "mozzarella cheese" = 5, "baked eggplant" = 5, "baked carrot" = 5, "corn" = 5) nutriment_amt = 40 nutriment_allergens = ALLERGEN_DAIRY|ALLERGEN_GRAINS|ALLERGEN_FRUIT|ALLERGEN_VEGETABLE bitesize = 2 @@ -3862,7 +3939,10 @@ filling_color = "#A66829" center_of_mass = list("x"=17, "y"=16) nutriment_amt = 6 - nutriment_desc = list("bread" = 2, "sweetness" = 3) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("bread" = 2, "sweetness" = 3), + SPECIES_TESHARI = list("bread" = 3, "an unpleasant bitter aftertaste" = 1) + ) nutriment_allergens = ALLERGEN_GRAINS bitesize = 2 @@ -3937,7 +4017,10 @@ filling_color = "#DBC94F" icon_state = "sugarcookie" nutriment_amt = 5 - nutriment_desc = list("sweet cookie" = 5) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet cookie" = 5), + SPECIES_TESHARI = list("crisp cookie" = 5, "subtle bitterness" = 1) + ) nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_GRAINS bitesize = 1 @@ -3952,7 +4035,7 @@ filling_color = "#E0CF9B" center_of_mass = list("x"=17, "y"=4) nutriment_amt = 6 - nutriment_desc = list("sweet muffin" = 2, "berries" = 2) + nutriment_desc = list("fluffy cake" = 2, "berries" = 2) nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_GRAINS|ALLERGEN_SUGARS bitesize = 2 @@ -4024,7 +4107,10 @@ icon_state = "flowerchildsalad" filling_color = "#FF3867" nutriment_amt = 10 - nutriment_desc = list("bittersweet" = 10) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("bittersweet" = 10), + SPECIES_TESHARI = list("complex floral notes" = 8, "mild bitterness" = 4) + ) bitesize = 4 /obj/item/reagent_containers/food/snacks/rosesalad @@ -4033,7 +4119,10 @@ icon_state = "rosesalad" filling_color = "#FF3867" nutriment_amt = 10 - nutriment_desc = list("bittersweet" = 10, "iron" = 5) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("bittersweet" = 10, "iron" = 5), + SPECIES_TESHARI = list("complex floral notes" = 8, "mild bitterness" = 4, "iron" = 5) + ) bitesize = 4 /obj/item/reagent_containers/food/snacks/rosesalad/Initialize() @@ -4191,7 +4280,7 @@ desc = "This bread's got... Raisins!" icon_state = "bagelraisin" nutriment_amt = 8 - nutriment_desc = list("bread" = 4, "sweetness" = 4) + nutriment_desc = list("bread" = 4, "cinnamon" = 2, "dried fruit" = 2) nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_FRUIT bitesize = 2 @@ -4660,7 +4749,10 @@ desc = "A traditional ancient Sol recipe with a few liberties taken with meat selection." icon = 'icons/obj/food_syn.dmi' icon_state = "sweet_and_sour" - nutriment_desc = list("sweet and sour sauce" = 6, "fried pork" = 3) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet and sour sauce" = 6, "fried pork" = 3), + SPECIES_TESHARI = list("sour, somewhat bitter sauce" = 6, "fried pork" = 3) + ) nutriment_amt = 6 nutriment_allergens = ALLERGEN_MEAT|ALLERGEN_GRAINS trash = /obj/item/trash/plate @@ -4754,10 +4846,14 @@ desc = "So retro." icon = 'icons/obj/food_syn.dmi' icon_state = "pineapple_ring" - nutriment_desc = list("sweetness" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 2), + SPECIES_TESHARI = list("mild bitterness", "caustic, fruity flavour") + ) nutriment_amt = 2 nutriment_allergens = ALLERGEN_SUGARS + /obj/item/reagent_containers/food/snacks/pineapple_ring/Initialize() . = ..() reagents.add_reagent("pineapplejuice",3) @@ -4849,12 +4945,12 @@ /obj/item/reagent_containers/food/snacks/croissant name = "croissant" - desc = "True french cuisine; invented in Austria..." + desc = "True French cuisine; invented in Austria..." icon = 'icons/obj/food_syn.dmi' filling_color = "#E3D796" icon_state = "croissant" nutriment_amt = 4 - nutriment_desc = list("sweet laminated pastry" = 4) + nutriment_desc = list("buttery pastry" = 4, "flaky bread" = 4) nutriment_allergens = ALLERGEN_EGGS|ALLERGEN_GRAINS bitesize = 2 @@ -4893,7 +4989,10 @@ icon_state = "pancakes" trash = /obj/item/trash/plate center_of_mass = list("x"=15, "y"=11) - nutriment_desc = list("pancake" = 6, "sweetness" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("soft, dense cake" = 6, "syrupy sweetness" = 2), + SPECIES_TESHARI = list("soft, dense cake" = 6, "cloying bitterness" = 2) + ) nutriment_amt = 8 nutriment_allergens = ALLERGEN_EGGS|ALLERGEN_GRAINS|ALLERGEN_SUGARS|ALLERGEN_DAIRY bitesize = 2 @@ -4904,7 +5003,7 @@ icon_state = "pancake_berry" trash = /obj/item/trash/plate center_of_mass = list("x"=15, "y"=11) - nutriment_desc = list("pancake" = 6, "baked berries" = 4) + nutriment_desc = list("soft, dense cake" = 6, "baked berries" = 4) nutriment_amt = 10 nutriment_allergens = ALLERGEN_EGGS|ALLERGEN_GRAINS|ALLERGEN_SUGARS|ALLERGEN_DAIRY|ALLERGEN_FRUIT bitesize = 2 @@ -5421,7 +5520,10 @@ trash = /obj/item/trash/snack_bowl filling_color = "#58b76c" nutriment_amt = 7 - nutriment_desc = list("rice" = 2, "very powerful spices" = 3, "sweetness" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("rice" = 2, "very powerful spices" = 3, "sweetness" = 1), + SPECIES_TESHARI = list("rice" = 2, "rich and complex spices" = 3, "a pleasant bitter-sour note" = 1) + ) nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_DAIRY|ALLERGEN_VEGETABLE center_of_mass = list("x"=16, "y"=8) bitesize = 3 @@ -5623,7 +5725,10 @@ trash = /obj/item/trash/plate filling_color = "#301301" nutriment_amt = 8 - nutriment_desc = list("sweet bananas" = 6, "fried batter" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet bananas" = 6, "fried batter" = 2), + SPECIES_TESHARI = list("bananas" = 6, "fried batter" = 2) + ) nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_EGGS center_of_mass = list("x"=16, "y"=11) bitesize = 3 @@ -5740,7 +5845,10 @@ trash = /obj/item/trash/plate filling_color = "#EDE5AD" nutriment_amt = 5 - nutriment_desc = list("toasted bread" = 2, "sweet honey" = 3) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("toasted bread" = 2, "sweet honey" = 3), + SPECIES_TESHARI = list("toasted bread" = 2, "rich honey" = 3, "mild bitterness" = 1) + ) nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_SUGARS center_of_mass = list("x"=16, "y"=9) bitesize = 4 @@ -5792,7 +5900,10 @@ slices_num = 5 filling_color = "#F5B951" nutriment_amt = 20 - nutriment_desc = list("zesty lime cream" = 14, "sweet wholewheat crust" = 6) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("zesty lime cream" = 14, "sweet wholewheat crust" = 6), + SPECIES_TESHARI = list("zesty lime cream" = 14, "wholewheat crust" = 6) + ) nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_DAIRY|ALLERGEN_SUGARS center_of_mass = list("x"=16, "y"=10) @@ -5804,7 +5915,10 @@ trash = /obj/item/trash/plate filling_color = "#F5B951" bitesize = 3 - nutriment_desc = list("zesty lime cream" = 2, "sweet wholewheat crust" = 3) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("zesty lime cream" = 2, "sweet wholewheat crust" = 3), + SPECIES_TESHARI = list("zesty lime cream" = 2, "wholewheat crust" = 3) + ) nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_DAIRY|ALLERGEN_SUGARS center_of_mass = list("x"=16, "y"=12) @@ -6080,7 +6194,10 @@ icon_state = "cinnamonbun" trash = null nutriment_amt = 12 - nutriment_desc = list("sweet pastry" = 4, "cinnamon sugar" = 4, "sugar frosting" = 4) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet pastry" = 4, "cinnamon sugar" = 4, "sugar frosting" = 4), + SPECIES_TESHARI = list("dense pastry" = 4, "cinnamon" = 4, "crunchy frosting" = 2, "powerful bitterness" = 4) + ) nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_DAIRY|ALLERGEN_GRAINS bitesize = 1 @@ -6113,7 +6230,10 @@ filling_color = "#7D5F46" center_of_mass = list("x"=15, "y"=15) nutriment_amt = 10 - nutriment_desc = list("candy" = 2, "sweetness" = 2, "fruit flavouring" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("candy" = 2, "sweetness" = 2, "fruit flavouring" = 2), + SPECIES_TESHARI = list("rubbery chewiness" = 2, "chemical bitterness" = 2, "fruit flavouring" = 2) + ) bitesize = 1 /obj/item/reagent_containers/food/snacks/namagashi/Initialize() @@ -6128,7 +6248,10 @@ icon_state = "proteinbar" trash = /obj/item/trash/candy/proteinbar nutriment_amt = 9 - nutriment_desc = list("sweetener" = 1, "protein" = 8) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("artificial sweetener" = 1, "protein" = 8), + SPECIES_TESHARI = list("cloying bitterness" = 3, "protein" = 8) + ) bitesize = 6 /obj/item/reagent_containers/food/snacks/candy/proteinbar/Initialize() @@ -6158,7 +6281,11 @@ filling_color = "#DBC94F" center_of_mass = list("x"=17, "y"=18) nutriment_amt = 5 - nutriment_desc = list("sweetness" = 3, "cookie" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 3, "cookie" = 2), + SPECIES_TESHARI = list("crispness" = 2, "bitterness" = 1, "cookie" = 2) + ) + nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_GRAINS bitesize = 1 @@ -6171,7 +6298,11 @@ trash = /obj/item/trash/cookiesnack filling_color = "#DBC94F" nutriment_amt = 3 - nutriment_desc = list("sweetness" = 1, "stale cookie" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 1, "stale cookie" = 2), + SPECIES_TESHARI = list("bitterness" = 1, "stale cookie" = 2) + ) + nutriment_allergens = ALLERGEN_SUGARS|ALLERGEN_GRAINS bitesize = 1 @@ -6558,7 +6689,10 @@ trash = /obj/item/trash/syndi_cakes filling_color = "#FF5D05" center_of_mass = list("x"=16, "y"=10) - nutriment_desc = list("sweetness" = 3, "cake" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 3, "soggy cake" = 1), + SPECIES_TESHARI = list("bitterness" = 3, "soggy cake" = 1) + ) nutriment_amt = 4 nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_SUGARS bitesize = 3 @@ -6602,7 +6736,10 @@ trash = /obj/item/trash/jupiter filling_color = "#dc1919" center_of_mass = list("x"=15, "y"=9) - nutriment_desc = list("sweetness" = 4, "vanilla" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweetness" = 4, "vanilla" = 1), + SPECIES_TESHARI = list("mild bitterness" = 1, "vanilla" = 4) + ) nutriment_amt = 5 nutriment_allergens = ALLERGEN_SUGARS bitesize = 2 @@ -6674,7 +6811,10 @@ trash = /obj/item/trash/oort filling_color = "#3f7dd2" center_of_mass = list("x"=15, "y"=9) - nutriment_desc = list("fizz" = 4, "sweetness" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("fizz" = 4, "sweetness" = 1), + SPECIES_TESHARI = list("fizz" = 4, "mild bitterness" = 1) + ) nutriment_amt = 5 nutriment_allergens = ALLERGEN_SUGARS bitesize = 2 @@ -6717,7 +6857,10 @@ icon = 'icons/obj/food_snacks.dmi' icon_state = "ricecake" desc = "Ancient earth snack food made from balled up rice." - nutriment_desc = list("rice" = 4, "sweetness" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("rice" = 4, "sweetness" = 1), + SPECIES_TESHARI = list("rice" = 4, "mild bitterness" = 1) + ) nutriment_amt = 5 nutriment_allergens = ALLERGEN_GRAINS bitesize = 2 @@ -6727,7 +6870,10 @@ icon = 'icons/obj/food_snacks.dmi' icon_state = "dorayaki" desc = "Two small pancake-like patties made from castella wrapped around a filling of sweet azuki bean paste." - nutriment_desc = list("cake" = 3, "sweetness" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 3, "sweetness" = 2), + SPECIES_TESHARI = list("cake" = 3, "mild bitterness" = 1) + ) nutriment_amt = 6 nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_VEGETABLE|ALLERGEN_SUGARS bitesize = 2 @@ -6737,7 +6883,10 @@ icon = 'icons/obj/food_snacks.dmi' icon_state = "daifuku" desc = "Small round mochi stuffed with sweetened red bean paste." - nutriment_desc = list("cake" = 2, "sweetness" = 3) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 2, "sweetness" = 3), + SPECIES_TESHARI = list("cake" = 3, "mild bitterness" = 1) + ) nutriment_amt = 6 nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_VEGETABLE bitesize = 2 @@ -7001,7 +7150,10 @@ trash = /obj/item/trash/appleberry filling_color = "#FFFFFF" center_of_mass = list("x"=15, "y"=9) - nutriment_desc = list("apple" = 1, "sweetness" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("dried apple" = 1, "sweetness" = 1), + SPECIES_TESHARI = list("dried apple" = 2, "mild bitterness" = 1) + ) nutriment_amt = 10 nutriment_allergens = ALLERGEN_FRUIT bitesize = 2 @@ -7065,7 +7217,10 @@ filling_color = "#ffffff" center_of_mass = list("x"=15, "y"=9) nutriment_amt = 6 - nutriment_desc = list("sweetness" = 4, "rice" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("rice" = 1, "sweetness" = 4), + SPECIES_TESHARI = list("rice" = 2, "mild bitterness" = 1) + ) nutriment_allergens = ALLERGEN_VEGETABLE|ALLERGEN_SUGARS bitesize = 2 @@ -7081,7 +7236,10 @@ filling_color = "#FFE591" center_of_mass = list("x"=15, "y"=11) nutriment_amt = 4 - nutriment_desc = list("sweetness" = 4, "stale cake" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("stale cake" = 2, "sweetness" = 4), + SPECIES_TESHARI = list("stale cake" = 2, "mild bitterness" = 1) + ) nutriment_allergens = ALLERGEN_GRAINS|ALLERGEN_SUGARS bitesize = 2 @@ -7138,7 +7296,10 @@ filling_color = "#FFFFFF" nutriment_amt = 4 center_of_mass = list("x"=15, "y"=11) - nutriment_desc = list("sweetness" = 5, "cake" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("cake" = 1, "sweetness" = 5), + SPECIES_TESHARI = list("cake" = 2, "mild bitterness" = 1) + ) bitesize = 2 /obj/item/reagent_containers/food/snacks/packaged/sweetration/Initialize() @@ -7337,7 +7498,10 @@ trash = /obj/item/trash/asian_bowl bitesize = 2 nutriment_amt = 6 - nutriment_desc = list("sweet and spicy sauce" = 6) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet and spicy sauce" = 6), + SPECIES_TESHARI = list("spicy, somewhat bitter sauce" = 6) + ) /obj/item/reagent_containers/food/snacks/generalschicken/Initialize() . = ..() @@ -7351,8 +7515,12 @@ trash = /obj/item/trash/plate bitesize = 3 nutriment_amt = 8 - nutriment_desc = list("sweet rye pudding" = 3, "orange zest" = 3, "milk" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet rye pudding" = 3, "orange zest" = 3, "milk" = 2), + SPECIES_TESHARI = list("rye pudding" = 3, "orange zest" = 3, "milk" = 2, "mild bitterness" = 1) + ) nutriment_allergens = ALLERGEN_DAIRY|ALLERGEN_FRUIT|ALLERGEN_GRAINS + /obj/item/reagent_containers/food/snacks/lobster name = "raw lobster" desc = "A shifty lobster. You can try eating it, but its shell is extremely tough." @@ -7434,7 +7602,10 @@ icon_state = "monkfish_cooked" bitesize = 4 nutriment_amt = 10 - nutriment_desc = list("oil" = 1, "sweet chili" = 3, "spring onion" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("oil" = 1, "sweet chili" = 3, "spring onion" = 2), + SPECIES_TESHARI = list("oil" = 1, "chili" = 3, "spring onion" = 2) + ) nutriment_allergens = ALLERGEN_FISH /obj/item/reagent_containers/food/snacks/monkfishcooked/Initialize() @@ -7575,12 +7746,12 @@ reagents.add_reagent("dynjuice", 4) /obj/item/reagent_containers/food/snacks/chipplate/neaeracandy - name = "plate of candied neaera eyes" - desc = "Candied neaera eyes shaped into cubes. The mix of savoury and sweet is generally acceptable for most species, although many dislike the dish for its use of intact eyes." + name = "plate of jellied neaera eyes" + desc = "Jellied neaera eyes shaped into cubes. The mix of savoury and creamy is generally acceptable for most species, although many dislike the dish for its texture and habit of making eye contact during the meal." icon_state = "neaera_candied_eyes20" trash = /obj/item/trash/candybowl vendingobject = /obj/item/reagent_containers/food/snacks/neaeracandy - nutriment_desc = list("sweet goo" = 2) + nutriment_desc = list("savoury goo" = 2) bitesize = 1 unitname = "eye" filling_color = "#7C66DD" @@ -7603,8 +7774,8 @@ icon_state = "neaera_candied_eyes20" /obj/item/reagent_containers/food/snacks/neaeracandy - name = "candied neaera eye" - desc = "A candied neaera eye shaped into a cube. The mix of savoury and sweet is generally acceptable for most species, although many dislike the dish for its use of eyes." + name = "jellied neaera eye" + desc = "A jellied cube made from neaera eyes. The mix of savoury and creamy is generally acceptable for most species, although many dislike the dish for its texture and habit of making eye contact during the meal." icon = 'icons/obj/food_syn.dmi' icon_state = "neaera_candied_eye" bitesize = 2 @@ -7658,7 +7829,10 @@ icon = 'icons/obj/food_syn.dmi' icon_state = "qalozyn_boiled" nutriment_amt = 4 - nutriment_desc = list("sweet turnips" = 4) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet turnips" = 4), + SPECIES_TESHARI = list("turnips" = 2, "mild bitterness" = 2) + ) nutriment_allergens = ALLERGEN_VEGETABLE bitesize = 2 filling_color = "#7C66DD" @@ -7669,7 +7843,10 @@ desc = "Neaera liver stuffed with boiled qa'lozyn and fried in oil. A popular light meal for teshari." icon_state = "garani" nutriment_amt = 4 - nutriment_desc = list("sweet turnips" = 4) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet turnips" = 4), + SPECIES_TESHARI = list("turnips" = 2, "mild bitterness" = 2) + ) nutriment_allergens = ALLERGEN_FRUIT bitesize = 3 filling_color = "#7C66DD" @@ -7771,7 +7948,10 @@ desc = "A kirani fruit baked in an oven, causing the jelly inside to caramelize into a jelly donut-like crispy treat." icon_state = "baked_kirani" nutriment_amt = 4 - nutriment_desc = list("crispy sweetness" = 2, "caramelized jelly" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("crispy sweetness" = 2, "caramelized jelly" = 2), + SPECIES_TESHARI = list("crispy richness" = 2, "caramelized jelly" = 2) + ) nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_SUGARS filling_color = "#993C5C" @@ -7783,7 +7963,10 @@ nutriment_amt = 4 nutriment_allergens = ALLERGEN_FRUIT bitesize = 1 - nutriment_desc = list("sweet kirani" = 2, "minty ga'uli" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("sweet kirani" = 2, "minty ga'uli" = 2), + SPECIES_TESHARI = list("rich kirani" = 2, "minty ga'uli" = 2) + ) /obj/item/reagent_containers/food/snacks/stuffed_gauli/Initialize() . = ..() @@ -7798,7 +7981,10 @@ trash = /obj/item/trash/snack_bowl bitesize = 1 nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_SUGARS - nutriment_desc = list("minty qa'zal" = 2, "sweet kirani jelly" = 2) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("minty qa'zal" = 2, "sweet kirani jelly" = 2), + SPECIES_TESHARI = list("minty qa'zal" = 2, "rich kirani jelly" = 2) + ) /obj/item/reagent_containers/food/snacks/kirani_stew/Initialize() . = ..() @@ -7813,7 +7999,10 @@ nutriment_amt = 8 bitesize = 1 nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_SUGARS - nutriment_desc = list("chewy qa'zal noodles" = 1, "minty gu'ali juice" = 1, "sweet kirani jelly" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("chewy qa'zal noodles" = 1, "minty gu'ali juice" = 1, "sweet kirani jelly" = 1), + SPECIES_TESHARI = list("chewy qa'zal noodles" = 1, "minty gu'ali juice" = 1, "rich kirani jelly" = 1) + ) /obj/item/reagent_containers/food/snacks/kirani_jellypuff name = "kirani jellypuff" @@ -7823,4 +8012,7 @@ nutriment_allergens = ALLERGEN_FRUIT|ALLERGEN_SUGARS nutriment_amt = 8 bitesize = 2 - nutriment_desc = list("puffed minty qa'zal bread" = 1, "super-sweet kirani jelly" = 1) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("puffed minty qa'zal bread" = 1, "super-sweet kirani jelly" = 1), + SPECIES_TESHARI = list("puffed minty qa'zal bread" = 1, "rich kirani jelly" = 1) + ) diff --git a/code/modules/food/food/thecake.dm b/code/modules/food/food/thecake.dm index 69a6ad73ab2..6153c5e923f 100644 --- a/code/modules/food/food/thecake.dm +++ b/code/modules/food/food/thecake.dm @@ -181,6 +181,8 @@ nutriment_amt = 4 volume = 80 +// None of this nutriment_desc setting does anything but this +// cake is such a mess that I'm not refactoring it right now soz. /obj/item/reagent_containers/food/snacks/chaoscakeslice/Initialize() . = ..() var/i = rand(1,6) diff --git a/code/modules/mob/living/carbon/taste.dm b/code/modules/mob/living/carbon/taste.dm index ad153017975..eeb8b1baa7e 100644 --- a/code/modules/mob/living/carbon/taste.dm +++ b/code/modules/mob/living/carbon/taste.dm @@ -23,6 +23,7 @@ calculate text size per text. */ /datum/reagents/proc/generate_taste_message(mob/living/carbon/taster = null) var/minimum_percent = 10 + var/taster_species = taster?.get_species_name() if(ishuman(taster)) var/mob/living/carbon/human/H = taster minimum_percent = round(10/ (H.isSynthetic() ? TASTE_DULL : H.species.taste_sensitivity)) @@ -33,20 +34,21 @@ calculate text size per text. for(var/datum/reagent/R in reagent_list) if(!R.taste_mult) continue - if(R.type == /datum/reagent/nutriment) - var/list/taste_data = R.get_data() - for(var/taste in taste_data) - if(taste in tastes) - tastes[taste] += taste_data[taste] - else - tastes[taste] = taste_data[taste] + var/list/reagent_data = R.get_taste_data() + if(!reagent_data) + continue + reagent_data = cached_json_decode(reagent_data) + if(!islist(reagent_data) || !length(reagent_data)) + continue + var/list/taste_data + if(taster_species in reagent_data) + taste_data = reagent_data[taster_species] + else if(TASTE_STRING_DEFAULT in reagent_data) + taste_data = reagent_data[TASTE_STRING_DEFAULT] else - var/taste_desc = R.taste_description - var/taste_amount = get_reagent_amount(R.id) * R.taste_mult - if(R.taste_description in tastes) - tastes[taste_desc] += taste_amount - else - tastes[taste_desc] = taste_amount + continue + for(var/taste in taste_data) + tastes[taste] += taste_data[taste] //deal with percentages var/total_taste = 0 diff --git a/code/modules/reagents/holder/holder.dm b/code/modules/reagents/holder/holder.dm index 2bb01dd3340..a68568a5508 100644 --- a/code/modules/reagents/holder/holder.dm +++ b/code/modules/reagents/holder/holder.dm @@ -103,7 +103,6 @@ update_total() /* Holder-to-chemical */ - /datum/reagents/proc/add_reagent(var/id, var/amount, var/data = null, var/safety = 0) if(!isnum(amount) || amount <= 0) return 0 @@ -111,34 +110,11 @@ update_total() amount = min(amount, get_free_space()) - if(istype(my_atom,/obj/item/reagent_containers/food)) //The following code is targeted specifically at getting allergen reagents into food items, since for the most part they're not applied by default. - var/list/add_reagents = list() - var/totalnum = 0 - - for(var/item in data) //Try to find the ID - var/add_reagent_id = null - if(item in SSchemistry.chemical_reagents) - add_reagent_id = item - else if("[item]juice" in SSchemistry.chemical_reagents) - add_reagent_id = "[item]juice" - if(add_reagent_id) //If we did find it, add it to our list of reagents to add, and add the number to our total. - add_reagents[add_reagent_id] += data[item] - totalnum += data[item] - - if(totalnum) - var/multconst = amount/totalnum //We're going to add these extra reagents so that they share the ratio described, but only add up to 1x the existing amount at the most - for(var/item in add_reagents) - add_reagent(item,add_reagents[item]*multconst) - - - - for(var/datum/reagent/current in reagent_list) if(current.id == id) if(current.id == "blood") if(LAZYLEN(data) && !isnull(data["species"]) && !isnull(current.data["species"]) && data["species"] != current.data["species"]) // Species bloodtypes are already incompatible, this just stops it from mixing into the one already in a container. continue - current.volume += amount if(!isnull(data)) // For all we know, it could be zero or empty string and meaningful current.mix_data(data, amount) @@ -154,7 +130,7 @@ reagent_list += R R.holder = src R.volume = amount - R.initialize_data(data) + R.initialize_data(R.get_initial_data(data)) update_total() if(!safety) handle_reactions() diff --git a/code/modules/reagents/reagents/_reagents.dm b/code/modules/reagents/reagents/_reagents.dm index b0c8f7b8c5f..c1dbdd0d63d 100644 --- a/code/modules/reagents/reagents/_reagents.dm +++ b/code/modules/reagents/reagents/_reagents.dm @@ -1,5 +1,66 @@ - - +var/global/list/_cached_taste_data = list() +/proc/get_cached_taste_data(var/rid, var/list/input, var/list/existing) + + // Generate our cache key. + var/cache_key = list(rid) + if(input) + cache_key += json_encode(input) + if(existing) + cache_key += json_encode(existing) + cache_key = jointext(cache_key, null) + + if(!global._cached_taste_data[cache_key]) + + // Ensure taste data is an associative list of categories to + // associative lists of taste strings to numerical weights. + // ie. list(TASTE_STRING_DEFAULT = list("foo" = 1, "bar" = 10)) + + // Validate input is structured as expected and set our cached value. + // Take a deep copy to avoid accidental mutation elsewhere. + var/list/taste = list() + if(!input) + taste = list() + else if(!islist(input)) + taste = list(input) + else + taste = deepCopyList(input) + + if(!taste[TASTE_STRING_DEFAULT]) + taste = list(TASTE_STRING_DEFAULT = taste) + + // Wrap single values in lists for categories. + for(var/taste_cat in taste) + if(isnull(taste[taste_cat])) + taste -= taste_cat + else if(!islist(taste[taste_cat])) + taste[taste_cat] = list(taste[taste_cat]) + + // Update with pre-existing info. + if(existing) + for(var/taste_cat in existing) + if(taste[taste_cat]) + // Mix + for(var/taste_string in existing[taste_cat]) + if(!isnum(taste[taste_cat][taste_string])) + taste[taste_cat][taste_string] = 1 + if(isnum(existing[taste_cat][taste_string])) + taste[taste_cat][taste_string] += existing[taste_cat][taste_string] + else + taste[taste_cat][taste_string] += 1 + else + // Wholesale copy + taste[taste_cat] = existing[taste_cat] + + // Make sure every string has a numerical weighting. + for(var/taste_cat in taste) + for(var/taste_string in taste[taste_cat]) + if(!isnum(taste[taste_cat][taste_string])) + taste[taste_cat][taste_string] = 1 + + // Cache our generated taste data for later. + global._cached_taste_data[cache_key] = json_encode(taste) + + return global._cached_taste_data[cache_key] /datum/reagent var/name = "Reagent" @@ -195,19 +256,31 @@ M.adjustToxLoss(min(removed * overdose_mod * round(3 + 3 * volume / overdose), 3.6)) /datum/reagent/proc/initialize_data(var/newdata) // Called when the reagent is created. - if(!isnull(newdata)) + SHOULD_CALL_PARENT(TRUE) + if(islist(newdata) && length(newdata)) data = newdata - return +// Returns FALSE if no further mixing is needed, TRUE if it is. /datum/reagent/proc/mix_data(var/newdata, var/newamount) // You have a reagent with data, and new reagent with its own data get added, how do you deal with that? - return + SHOULD_CALL_PARENT(TRUE) + if(!islist(data) && islist(newdata) && length(newdata)) + initialize_data(newdata) + return FALSE + return TRUE + +/datum/reagent/proc/get_initial_data(var/list/newdata) + if(taste_description) + var/newtastedata = get_cached_taste_data(id, taste_description, LAZYACCESS(newdata, TASTE_DATA_FIELD)) + taste_description = null // This proc is never called except after new(), so ditch this to avoid memory use. + LAZYSET(newdata, TASTE_DATA_FIELD, newtastedata) + return newdata /datum/reagent/proc/get_data() // Just in case you have a reagent that handles data differently. - if(data && istype(data, /list)) - return data.Copy() - else if(data) - return data - return null + return islist(data) && length(data) ? data.Copy() : null + +/datum/reagent/proc/get_taste_data() + var/list/ret = get_data() + return LAZYACCESS(ret, TASTE_DATA_FIELD) /datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references holder = null diff --git a/code/modules/reagents/reagents/core.dm b/code/modules/reagents/reagents/core.dm index e3a33633c9e..0e92300bde8 100644 --- a/code/modules/reagents/reagents/core.dm +++ b/code/modules/reagents/reagents/core.dm @@ -15,18 +15,8 @@ glass_desc = "Are you sure this is tomato juice?" /datum/reagent/blood/initialize_data(var/newdata) - ..() - if(data && data["blood_colour"]) - color = data["blood_colour"] - - return - -/datum/reagent/blood/get_data() // Just in case you have a reagent that handles data differently. - var/t = data.Copy() - if(t["virus2"]) - var/list/v = t["virus2"] - t["virus2"] = v.Copy() - return t + . = ..() + color = LAZYACCESS(data, "blood_colour") || COLOR_RED /datum/reagent/blood/touch_turf(var/turf/simulated/T) if(!istype(T) || volume < 3) @@ -120,11 +110,10 @@ /datum/reagent/blood/synthblood/initialize_data(var/newdata) ..() - if(data && !data["blood_type"]) - data["blood_type"] = "O-" - if(data && data["species"]) - data["species"] = null - return + if(data) + if(!data["blood_type"]) + data["blood_type"] = "O-" + data -= "species" /datum/reagent/blood/synthblood/dilute name = "synthetic plasma" diff --git a/code/modules/reagents/reagents/dispenser.dm b/code/modules/reagents/reagents/dispenser.dm index c54360072b2..973c619f512 100644 --- a/code/modules/reagents/reagents/dispenser.dm +++ b/code/modules/reagents/reagents/dispenser.dm @@ -299,7 +299,10 @@ name = "Potassium" id = "potassium" description = "A soft, low-melting solid that can easily be cut with a knife. Reacts violently with water." - taste_description = "sweetness" //potassium is bitter in higher doses but sweet in lower ones. + taste_description = list( + TASTE_STRING_DEFAULT = "sweetness", + SPECIES_TESHARI = "mild bitterness" + ) //potassium is bitter in higher doses but sweet in lower ones. reagent_state = SOLID color = "#A0A0A0" @@ -445,7 +448,10 @@ name = "Sugar" id = "sugar" description = "The organic compound commonly known as table sugar and sometimes called saccharose. This white, odorless, crystalline powder has a pleasing, sweet taste." - taste_description = "sugar" + taste_description = list( + SPECIES_TESHARI = "chalk", + TASTE_STRING_DEFAULT = "sugar" + ) taste_mult = 1.8 reagent_state = SOLID color = "#FFFFFF" diff --git a/code/modules/reagents/reagents/food_drinks.dm b/code/modules/reagents/reagents/food_drinks.dm index 5db9c63260d..c238b2454a6 100644 --- a/code/modules/reagents/reagents/food_drinks.dm +++ b/code/modules/reagents/reagents/food_drinks.dm @@ -8,33 +8,62 @@ reagent_state = SOLID metabolism = REM * 4 ingest_met = REM * 4 + taste_description = null var/nutriment_factor = 30 // Per unit var/injectable = 0 color = "#664330" /datum/reagent/nutriment/mix_data(var/list/newdata, var/newamount) - - if(!islist(newdata) || !newdata.len) + . = ..(newdata) + var/list/adding_flavours = LAZYACCESS(newdata, TASTE_DATA_FIELD) + if(!. || !adding_flavours) + return + adding_flavours = cached_json_decode(adding_flavours) + if(!islist(adding_flavours) || !length(adding_flavours)) return - //add the new taste data - if(islist(data)) - for(var/taste in newdata) - if(taste in data) - data[taste] += newdata[taste] - else - data[taste] = newdata[taste] + // Get our existing taste data. This will be reencoded and rewritten after we update it. + var/list/existing_taste_data = LAZYACCESS(data, TASTE_DATA_FIELD) + if(existing_taste_data) + existing_taste_data = cached_json_decode(existing_taste_data) else - initialize_data(newdata) - - //cull all tastes below 5% of total - var/totalFlavor = 0 - for(var/taste in data) - totalFlavor += data[taste] - if(totalFlavor) //Let's not divide by zero for things w/o taste - for(var/taste in data) - if(data[taste]/totalFlavor < 0.05) - data -= taste + existing_taste_data = list() + + // Mix in any supplied flavours. + var/added_taste = FALSE + for(var/taste in adding_flavours) + var/taste_data = adding_flavours[taste] + if(islist(taste_data)) + var/list/existing_taste_category = existing_taste_data[taste] + if(!existing_taste_category) + existing_taste_category = list() + existing_taste_data[taste] = existing_taste_category + added_taste = TRUE + for(var/taste_string in taste_data) + existing_taste_category[taste_string] += taste_data[taste_string] + added_taste = TRUE + + // Cull all tastes below 10% of total. + for(var/taste_cat in existing_taste_data) + var/total_flavor = 0 + var/list/taste_data = existing_taste_data[taste_cat] + if(!length(taste_data)) + continue + for(var/taste_string in taste_data) + total_flavor += taste_data[taste_string] + if(total_flavor <= 0) //Let's not divide by zero for things w/o taste + continue + for(var/taste_string in taste_data) + if(taste_data[taste_string] /total_flavor < 0.05) + taste_data -= taste_string + added_taste = TRUE + if(!length(taste_data)) + existing_taste_data -= taste_cat + added_taste = TRUE + + // Save our mixed data if needed. + if(added_taste) + LAZYSET(data, TASTE_DATA_FIELD, json_encode(existing_taste_data)) #define ANIMAL_NUTRITION_MULTIPLIER 0.5 /datum/reagent/nutriment/affect_animal(var/mob/living/simple_mob/animal/M, var/removed) @@ -96,27 +125,20 @@ ..() /datum/reagent/nutriment/coating/initialize_data(var/newdata) // Called when the reagent is created. - ..() - if (!data) - data = list() - else - if (isnull(data["cooked"])) - data["cooked"] = 0 - return - data["cooked"] = 0 - if (holder && holder.my_atom && istype(holder.my_atom,/obj/item/reagent_containers/food/snacks)) - data["cooked"] = 1 + . = ..() + LAZYINITLIST(data) + if(holder && holder.my_atom && istype(holder.my_atom,/obj/item/reagent_containers/food/snacks)) + data["cooked"] = TRUE name = cooked_name - + else + data["cooked"] = FALSE //Batter which is part of objects at compiletime spawns in a cooked state - //Handles setting the temperature when oils are mixed /datum/reagent/nutriment/coating/mix_data(var/newdata, var/newamount) - if (!data) - data = list() - - data["cooked"] = newdata["cooked"] + . = ..() + if(. && LAZYACCESS(newdata, "cooked") != null) + LAZYSET(data, "cooked", newdata["cooked"]) /datum/reagent/nutriment/coating/batter name = "batter mix" @@ -187,28 +209,17 @@ T.wet_floor(2) /datum/reagent/nutriment/triglyceride/oil/initialize_data(var/newdata) // Called when the reagent is created. - ..() - if (!data) - data = list("temperature" = T20C) + . = ..() + LAZYSET(data, "temperature", T20C) //Handles setting the temperature when oils are mixed /datum/reagent/nutriment/triglyceride/oil/mix_data(var/newdata, var/newamount) - - if (!data) - data = list() - - var/ouramount = volume - newamount - if (ouramount <= 0 || !data["temperature"] || !volume) - //If we get here, then this reagent has just been created, just copy the temperature exactly - data["temperature"] = newdata["temperature"] - - else - //Our temperature is set to the mean of the two mixtures, taking volume into account - var/total = (data["temperature"] * ouramount) + (newdata["temperature"] * newamount) - data["temperature"] = total / volume - - return ..() - + . = ..() + if(.) + var/newtemp = LAZYACCESS(newdata, "temperature") + if(newtemp != null) + var/total = ((LAZYACCESS(data, "temperature") * (volume - newamount)) + (newtemp * newamount)) / volume + LAZYSET(data, "temperature", total) //Calculates a scaling factor for scalding damage, based on the temperature of the oil and creature's heat resistance /datum/reagent/nutriment/triglyceride/oil/proc/heatdamage(var/mob/living/carbon/M) @@ -261,7 +272,10 @@ /datum/reagent/nutriment/glucose name = "Glucose" id = "glucose" - taste_description = "sweetness" + taste_description = list( + TASTE_STRING_DEFAULT = "sweetness", + SPECIES_TESHARI = "blandness" + ) color = "#FFFFFF" injectable = 1 @@ -314,7 +328,10 @@ name = "Honey" id = "honey" description = "A golden yellow syrup, loaded with sugary sweetness." - taste_description = "sweetness" + taste_description = list( + SPECIES_TESHARI = "floral notes", + TASTE_STRING_DEFAULT = "sweetness" + ) nutriment_factor = 10 color = "#FFFF00" @@ -445,14 +462,20 @@ name = "Watermelon Juice Powder" id = "instantwatermelon" description = "Dehydrated, powdered watermelon juice." - taste_description = "dry sweet watermelon" + taste_description = list( + SPECIES_TESHARI = "dry watermelon", + TASTE_STRING_DEFAULT = "dry sweet watermelon" + ) color = "#b83333" /datum/reagent/nutriment/instantjuice/apple name = "Apple Juice Powder" id = "instantapple" description = "Dehydrated, powdered apple juice." - taste_description = "dry sweet apples" + taste_description = list( + SPECIES_TESHARI = "dry apples", + TASTE_STRING_DEFAULT = "dry sweet apples" + ) color = "#c07c40" /datum/reagent/nutriment/soysauce @@ -549,7 +572,10 @@ name = "Durian Paste" id = "durianpaste" description = "A strangely sweet and savory paste." - taste_description = "sweet and savory" + taste_description = list( + SPECIES_TESHARI = "an odd savoury flavour", + TASTE_STRING_DEFAULT = "sweet and savory flavours" + ) color = "#757631" glass_name = "durian paste" @@ -587,7 +613,10 @@ name = "Sprinkles" id = "sprinkles" description = "Multi-colored little bits of sugar, commonly found on donuts. Loved by cops." - taste_description = "sugar" + taste_description = list( + SPECIES_TESHARI = "crunchy chalk", + TASTE_STRING_DEFAULT = "crunchy sugar" + ) nutriment_factor = 1 color = "#FF00FF" @@ -646,7 +675,10 @@ name = "Universal Enzyme" id = "enzyme" description = "A universal enzyme used in the preperation of certain chemicals and foods." - taste_description = "sweetness" + taste_description = list( + SPECIES_TESHARI = "a tingling sensation", + TASTE_STRING_DEFAULT = "sweetness" + ) taste_mult = 0.7 reagent_state = LIQUID color = "#365E30" @@ -1157,7 +1189,10 @@ name = "Watermelon Juice" id = "watermelonjuice" description = "Delicious juice made from watermelon." - taste_description = "sweet watermelon" + taste_description = list( + SPECIES_TESHARI = "watermelon", + TASTE_STRING_DEFAULT = "sweet watermelon" + ) color = "#B83333" glass_name = "watermelon juice" @@ -1278,7 +1313,10 @@ name = "Iced Tea" id = "icetea" description = "No relation to a certain rap artist/ actor." - taste_description = "sweet tea" + taste_description = list( + SPECIES_TESHARI = "bitter tea", + TASTE_STRING_DEFAULT = "sweet tea" + ) color = "#AC7F24" // rgb: 16, 64, 56 adj_temp = -5 @@ -1455,8 +1493,10 @@ id = "chaitea" description = "A milky tea spiced with cinnamon and cloves." color = "#A8442C" - taste_description = "creamy cinnamon and spice" - + taste_description = list( + SPECIES_TESHARI = "creamy cinnamon", + TASTE_STRING_DEFAULT = "creamy cinnamon and spice" + ) glass_name = "chai tea" glass_desc = "A milky tea spiced with cinnamon and cloves." @@ -1706,7 +1746,10 @@ name = "Pineappleade" id = "pineappleade" description = "Pineapple, juiced up." - taste_description = "sweet`n`sour pineapples" + taste_description = list( + SPECIES_TESHARI = "sour pineapples", + TASTE_STRING_DEFAULT = "sweet and sour pineapples" + ) color = "#FFFF00" adj_temp = -5 @@ -1719,7 +1762,10 @@ name = "Kira Special" id = "kiraspecial" description = "Long live the guy who everyone had mistaken for a girl. Baka!" - taste_description = "fruity sweetness" + taste_description = list( + SPECIES_TESHARI = "fruity flavours", + TASTE_STRING_DEFAULT = "fruity sweetness" + ) color = "#CCCC99" adj_temp = -5 @@ -1964,7 +2010,10 @@ name = "Orange Soda" id = "orangesoda" description = "Soda made using fresh picked oranges." - taste_description = "sweet and citrusy" + taste_description = list( + SPECIES_TESHARI = "citrus", + TASTE_STRING_DEFAULT = "sweet citrus" + ) reagent_state = LIQUID color = "#ff992c" adj_drowsy = -3 @@ -2008,7 +2057,10 @@ name = "Bacon Soda" id = "porksoda" description = "Soda made using pork like flavoring." - taste_description = "sugar coated bacon" + taste_description = list( + SPECIES_TESHARI = "reconstituted pork", + TASTE_STRING_DEFAULT = "sugar-coated bacon" + ) reagent_state = LIQUID color = "ff8080" adj_drowsy = -3 @@ -2022,7 +2074,11 @@ name = "Mountain Wind" id = "spacemountainwind" description = "Blows right through you like a space wind." - taste_description = "sweet citrus soda" + taste_description = list( + SPECIES_TESHARI = "fizzy citrus", + TASTE_STRING_DEFAULT = "fizzy, sweet citrus" + ) + color = "#102000" adj_drowsy = -7 adj_sleepy = -1 @@ -2098,8 +2154,10 @@ name = "Diet Dr. Gibb" id = "diet_dr_gibb" color = "#102000" - taste_description = "chemically sweetened cherry soda" - + taste_description = list( + SPECIES_TESHARI = "cherries", + TASTE_STRING_DEFAULT = "sweet cherries" + ) glass_name = "glass of Diet Dr. Gibb" glass_desc = "Regular Dr.Gibb is probably healthier than this cocktail of artificial flavors." glass_special = list(DRINK_FIZZ) @@ -2108,7 +2166,10 @@ name = "Shirley Temple" id = "shirley_temple" description = "A sweet concotion hated even by its namesake." - taste_description = "sweet ginger ale" + taste_description = list( + SPECIES_TESHARI = "ginger ale", + TASTE_STRING_DEFAULT = "sweet ginger ale" + ) color = "#EF304F" adj_temp = -8 @@ -2146,7 +2207,10 @@ name = "Arnold Palmer" id = "arnold_palmer" description = "Tastes just like the old man." - taste_description = "lemon and sweet tea" + taste_description = list( + SPECIES_TESHARI = "lemon tea", + TASTE_STRING_DEFAULT = "lemon and sweet tea" + ) color = "#AF5517" adj_temp = -8 @@ -2203,7 +2267,10 @@ name = "Hell Ramen" id = "hell_ramen" description = "The noodles are boiled, the flavors are artificial, just like being back in school." - taste_description = "noodles and spice" + taste_description = list( + SPECIES_TESHARI = "noodles with a strange aftertaste", + TASTE_STRING_DEFAULT = "noodles and spice" + ) taste_mult = 1.7 reagent_state = LIQUID color = "#302000" @@ -2218,8 +2285,11 @@ /datum/reagent/drink/sweetsundaeramen name = "Dessert Ramen" id = "dessertramen" - description = "How many things can you add to a cup of ramen before it begins to question its exitance?" - taste_description = "unbearable sweetness" + description = "How many things can you add to a cup of ramen before it begins to question its existence?" + taste_description = list( + SPECIES_TESHARI = "bland, sticky slime", + TASTE_STRING_DEFAULT = "unbearable sweetness" + ) color = "#4444FF" nutrition = 5 @@ -2270,7 +2340,10 @@ name = "Dream Cream" id = "dreamcream" description = "A smoothy, silky mix of honey and dairy." - taste_description = "sweet, soothing dairy" + taste_description = list( + SPECIES_TESHARI = "bland dairy", + TASTE_STRING_DEFAULT = "sweet, soothing dairy" + ) color = "#fcfcc9" // rgb(252, 252, 201) glass_name = "Dream Cream" @@ -2293,7 +2366,11 @@ name = "Ent's Draught" id = "entdraught" description = "A natural, earthy combination of all things peaceful." - taste_description = "fresh rain and sweet memories" + // Pedantic to make Tesh not taste sweet in the context of a metaphor, but this is similar to chivalry below, what does it taste like? + taste_description = list( + SPECIES_TESHARI = "petrichor and distant tundra", + TASTE_STRING_DEFAULT = "fresh rain and sweet memories" + ) color = "#3a6617" // rgb(58, 102, 23) glass_name = "Ent's Draught" @@ -2457,7 +2534,11 @@ name = "Berry Cordial" id = "berrycordial" description = "How berry cordial of you." - taste_description = "sweet chivalry" + // Pedantic to make Tesh not taste sweet in the context of a metaphor, but what the hell does 'sweet chivalry' taste like anyway? + taste_description = list( + SPECIES_TESHARI = "chivalry", + TASTE_STRING_DEFAULT = "sweet chivalry" + ) color = "#D26EB8" glass_name = "berry cordial" @@ -2812,7 +2893,11 @@ name = "Red Wine" id = "redwine" description = "An premium alcoholic beverage made from distilled grape juice." - taste_description = "bitter sweetness" + taste_description = list( + SPECIES_TESHARI = "cloying bitterness", + TASTE_STRING_DEFAULT = "bitter sweetness" + ) + color = "#7E4043" // rgb: 126, 64, 67 strength = 15 @@ -2838,7 +2923,10 @@ name = "Carnoth" id = "carnoth" description = "An premium alcoholic beverage made with multiple hybridized species of grapes that give it a dark maroon coloration." - taste_description = "alcoholic sweet flavor" + taste_description = list( + SPECIES_TESHARI = "cloying fumes", + TASTE_STRING_DEFAULT = "alcoholic sweetness" + ) color = "#5B0000" // rgb: 0, 100, 35 strength = 20 @@ -2877,7 +2965,10 @@ name = "Champagne" id = "champagne" description = "A sparkling wine made with Pinot Noir, Pinot Meunier, and Chardonnay." - taste_description = "fizzy bitter sweetness" + taste_description = list( + SPECIES_TESHARI = "bitter fizziness", + TASTE_STRING_DEFAULT = "fizzy, bitter sweetness" + ) color = "#D1B166" glass_name = "champagne" @@ -2920,7 +3011,10 @@ name = "Allies Cocktail" id = "alliescocktail" description = "A drink made from your allies, not as sweet as when made from your enemies." - taste_description = "bitter sweetness" + taste_description = list( + SPECIES_TESHARI = "bitterness", + TASTE_STRING_DEFAULT = "bitter sweetness" + ) color = "#D8AC45" strength = 25 @@ -2933,7 +3027,10 @@ name = "Aloe" id = "aloe" description = "So very, very, very good." - taste_description = "sweet and creamy" + taste_description = list( + SPECIES_TESHARI = "creamy blandness", + TASTE_STRING_DEFAULT = "creamy sweetness" + ) color = "#B7EA75" strength = 15 @@ -2946,7 +3043,7 @@ name = "Amasec" id = "amasec" description = "Official drink of the Gun Club!" - taste_description = "dark and metallic" + taste_description = "metallic darkness" reagent_state = LIQUID color = "#FF975D" strength = 25 @@ -3030,7 +3127,10 @@ name = "Banana Mama" id = "bananahonk" description = "A drink from Clown Heaven." - taste_description = "bananas and sugar" + taste_description = list( + SPECIES_TESHARI = "bananas", + TASTE_STRING_DEFAULT = "sweet bananas" + ) nutriment_factor = 1 color = "#FFFF91" strength = 12 @@ -3116,7 +3216,10 @@ name = "Booger" id = "booger" description = "Ewww..." - taste_description = "sweet 'n creamy" + taste_description = list( + SPECIES_TESHARI = "creamy blandness", + TASTE_STRING_DEFAULT = "creamy sweetness" + ) color = "#8CFF8C" strength = 30 @@ -3191,7 +3294,10 @@ name = "Demons Blood" id = "demonsblood" description = "This thing makes the hair on the back of your neck stand up." - taste_description = "sweet tasting iron" + taste_description = list( + SPECIES_TESHARI = "metallic notes", + TASTE_STRING_DEFAULT = "metallic sweetness" + ) taste_mult = 1.5 color = "#820000" strength = 15 @@ -3392,7 +3498,10 @@ name = "Long Island Iced Tea" id = "longislandicedtea" description = "The liquor cabinet, brought together in a delicious mix. Intended for middle-aged alcoholic women only." - taste_description = "sweet tea, with a kick" + taste_description = list( + SPECIES_TESHARI = "powerfully alcoholic tea", + TASTE_STRING_DEFAULT = "sweet tea, with a kick" + ) color = "#895B1F" strength = 12 @@ -3457,7 +3566,10 @@ name = "Mead" id = "mead" description = "A Viking's drink, though a cheap one." - taste_description = "sweet yet alcoholic" + taste_description = list( + SPECIES_TESHARI = "floral alcohol", + TASTE_STRING_DEFAULT = "cloyingly sweet alcohol" + ) reagent_state = LIQUID color = "#FFBB00" strength = 30 @@ -3513,7 +3625,10 @@ name = "Red Mead" id = "red_mead" description = "The true Viking's drink! Even though it has a strange red color." - taste_description = "sweet and salty alcohol" + taste_description = list( + SPECIES_TESHARI = "salty alcohol", + TASTE_STRING_DEFAULT = "sweet, salty alcohol" + ) color = "#C73C00" strength = 30 @@ -3524,7 +3639,10 @@ name = "Sbiten" id = "sbiten" description = "A spicy Vodka! Might be a bit hot for the little guys!" - taste_description = "hot and spice" + taste_description = list( + SPECIES_TESHARI = "powerful alcohol", + TASTE_STRING_DEFAULT = "hot and spice" + ) color = "#FFA371" strength = 15 adj_temp = 50 @@ -3643,7 +3761,10 @@ name = "Toxins Special" id = "phoronspecial" description = "This thing is literally on fire!" - taste_description = "spicy toxins" + taste_description = list( + SPECIES_TESHARI = "pure poison", + TASTE_STRING_DEFAULT = "spicy toxins" + ) reagent_state = LIQUID color = "#7F00FF" strength = 10 @@ -3788,7 +3909,10 @@ name = "Ginza Mary" id = "ginzamary" description = "An alcoholic drink made with vodka, sake, and juices." - taste_description = "spicy tomato sake" + taste_description = list( + SPECIES_TESHARI = "tomato sake", + TASTE_STRING_DEFAULT = "spicy tomato sake" + ) color = "#FF3232" strength = 25 @@ -3893,7 +4017,10 @@ name = "Xanadu Cannon" id = "xanaducannon" description = "Common in the entertainment districts of Titan." - taste_description = "sweet alcohol" + taste_description = list( + SPECIES_TESHARI = "alcohol", + TASTE_STRING_DEFAULT = "sweet alcohol" + ) color = "#614126" strength = 50 @@ -3985,7 +4112,10 @@ name = "Wine Brandy" id = "winebrandy" description = "A premium spirit made from distilled wine." - taste_description = "very sweet dried fruit with many elegant notes" + taste_description = list( + SPECIES_TESHARI = "complex, fruity alcohol", + TASTE_STRING_DEFAULT = "sweet alcohol with elegant notes of dried fruit" + ) color = "#4C130B" // rgb(76,19,11) strength = 20 @@ -4108,7 +4238,10 @@ name = "Clover Club" id = "cloverclub" description = "A light and refreshing raspberry cocktail." - taste_description = "sweet raspberry" + taste_description = list( + SPECIES_TESHARI = "raspberries", + TASTE_STRING_DEFAULT = "sweet raspberry" + ) color = "#dd00a6" // rgb(221, 0, 166) strength = 30 @@ -4200,8 +4333,11 @@ /datum/reagent/ethanol/piscosour name = "Pisco Sour" id = "piscosour" - description = "Wine Brandy, Lemon, and a dream. A South American classic" - taste_description = "light sweetness" + description = "Wine brandy, lemon, and a dream. A South American classic" + taste_description = list( + SPECIES_TESHARI = "light, refreshing alcohol", + TASTE_STRING_DEFAULT = "light sweetness" + ) color = "#f9f96b" // rgb(249, 249, 107) strength = 30 @@ -4306,10 +4442,13 @@ allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from vodka(grain), holy wine(fruit), and lime juice(fruit) /datum/reagent/ethanol/angelswrath - name = "Angels Wrath" + name = "Angel's Wrath" id = "angelswrath" description = "This thing makes the hair on the back of your neck stand up." - taste_description = "sweet victory and sour iron" + taste_description = list( + SPECIES_TESHARI = "hot victory and bitter iron", + TASTE_STRING_DEFAULT = "sweet victory and sour iron" + ) taste_mult = 1.5 color = "#F3C906" strength = 30 @@ -4322,10 +4461,13 @@ allergen_type = ALLERGEN_FRUIT|ALLERGEN_STIMULANT //Made from space mountain wind(fruit), dr.gibb(caffine) and holy wine(fruit) /datum/reagent/ethanol/angelskiss - name = "Angels Kiss" + name = "Angel's Kiss" id = "angelskiss" description = "Miracle time!" - taste_description = "sweet forgiveness and bitter iron" + taste_description = list( + SPECIES_TESHARI = "warm forgiveness and bitter iron", + TASTE_STRING_DEFAULT = "sweet forgiveness and bitter iron" + ) color = "#AD772B" strength = 25 @@ -4375,7 +4517,10 @@ name = "Lemonade Schnapps" id = "schnapps_lem" description = "Childhood memories are not included." - taste_description = "sweet, lemon-y alcohol" + taste_description = list( + SPECIES_TESHARI = "sour lemon with a kick", + TASTE_STRING_DEFAULT = "sweet lemon with a kick" + ) color = "#FFFF00" strength = 25 @@ -4436,7 +4581,10 @@ name = "Kompot" id = "kompot" description = "A traditional Eastern European beverage once used to preserve fruit in the 1980s" - taste_description = "refreshingly sweet and fruity" + taste_description = list( + SPECIES_TESHARI = "sticky, fruity flavours", + TASTE_STRING_DEFAULT = "sweet, fresh and fruity flavours" + ) color = "#ed9415" // rgb: 237, 148, 21 adj_drowsy = -1 adj_temp = -6 @@ -4492,7 +4640,10 @@ name = "Qa'zal flour" id = "qazal_flour" description = "Harvested from ground qa'zal, this is one of the main ingredients in qa'zal bread." - taste_description = "chalky, sweet dryness" + taste_description = list( + SPECIES_TESHARI = "bland, chalky dryness", + TASTE_STRING_DEFAULT = "sweet, chalky dryness" + ) reagent_state = SOLID nutriment_factor = 1 color = "#c499bc" @@ -4501,7 +4652,10 @@ name = "Kirani jelly" id = "kirani_jelly" description = "Sticky, sweet jelly from ground kiriani fruits." - taste_description = "ultra-sweet fruity jelly" + taste_description = list( + SPECIES_TESHARI = "a melange of subtle, fruity flavours", + TASTE_STRING_DEFAULT = "ultra-sweet jelly" + ) color = "#993c5c" /datum/reagent/drink/gauli_juice @@ -4515,7 +4669,11 @@ name = "Kirani cider" id = "kirani_cider" description = "Fermented kirani jelly, popular among teshari packs." - taste_description = "sweet, tangy, fruity alcohol" + taste_description = list( + TASTE_STRING_DEFAULT = list("sweet, tangy, fruity alcohol"), + SPECIES_TESHARI = list("subtle floral tones", "tangy, fruity alcohol", "mild bitterness") + ) + color = "#993c5c" strength = 10 glass_name = "kirani cider" @@ -4526,7 +4684,10 @@ name = "Sirisaian pole" id = "sirisaian_pole" description = "Fermented kirani mixed with ga'uli and ice, for a fruity cocktail as cold as Sirisai's poles." - taste_description = "chilled, minty, sweet fruit with an alcoholic kick" + taste_description = list( + TASTE_STRING_DEFAULT = list("chilled, minty, sweet fruit with an alcoholic kick"), + SPECIES_TESHARI = list("complex floral undertones", "chilled, minty fruit with an alcoholic kick") + ) color = "#993c5c" strength = 10 adj_temp = -20 @@ -4539,7 +4700,10 @@ name = "Kiraniade" id = "kiraniade" description = "Kirani jelly mixed with soda water into a more drinkable form, sweet enough to not even need extra sugar added." - taste_description = "super sweet, fizzy fruit" + taste_description = list( + TASTE_STRING_DEFAULT = list("super sweet, fizzy fruit"), + SPECIES_TESHARI = list("strong, fizzy, fruity flavours") + ) color = "#993c5c" adj_temp = -5 glass_name = "kiraniade" diff --git a/code/modules/reagents/reagents/other.dm b/code/modules/reagents/reagents/other.dm index d2fabf65ee3..d5ed35c946f 100644 --- a/code/modules/reagents/reagents/other.dm +++ b/code/modules/reagents/reagents/other.dm @@ -128,19 +128,16 @@ if(istype(M) && !istype(M, /mob/observer)) //painting ghosts: not allowed M.color = color //maybe someday change this to paint only clothes and exposed body parts for human mobs. -/datum/reagent/paint/get_data() - return color - /datum/reagent/paint/initialize_data(var/newdata) - color = newdata - return + . = ..() + color = LAZYACCESS(data, "color") || COLOR_WHITE /datum/reagent/paint/mix_data(var/newdata, var/newamount) + . = ..() var/list/colors = list(0, 0, 0, 0) var/tot_w = 0 - var/hex1 = uppertext(color) - var/hex2 = uppertext(newdata) + var/hex2 = uppertext(LAZYACCESS(newdata, "color") || COLOR_WHITE) if(length(hex1) == 7) hex1 += "FF" if(length(hex2) == 7) @@ -157,9 +154,8 @@ colors[3] += hex2num(copytext(hex2, 6, 8)) * newamount colors[4] += hex2num(copytext(hex2, 8, 10)) * newamount tot_w += newamount - color = rgb(colors[1] / tot_w, colors[2] / tot_w, colors[3] / tot_w, colors[4] / tot_w) - return + LAZYSET(data, "color", color) /* Things that didn't fit anywhere else */ @@ -416,7 +412,10 @@ name = "Thermite" id = "thermite" description = "Thermite produces an aluminothermic reaction known as a thermite reaction. Can be used to melt walls." - taste_description = "sweet tasting metal" + taste_description = list( + SPECIES_TESHARI = "metallic tones", + TASTE_STRING_DEFAULT = "metallic sweetness" + ) reagent_state = SOLID color = "#673910" touch_met = 50 @@ -552,7 +551,10 @@ name = "Glycerol" id = "glycerol" description = "Glycerol is a simple polyol compound. Glycerol is sweet-tasting and of low toxicity." - taste_description = "sweetness" + taste_description = list( + SPECIES_TESHARI = "blandness", + TASTE_STRING_DEFAULT = "sweetness" + ) reagent_state = LIQUID color = "#808080" diff --git a/code/modules/reagents/reagents/toxins.dm b/code/modules/reagents/reagents/toxins.dm index add0e3046d7..74e81029a84 100644 --- a/code/modules/reagents/reagents/toxins.dm +++ b/code/modules/reagents/reagents/toxins.dm @@ -222,7 +222,10 @@ name = "Stimm" id = "stimm" description = "A homemade stimulant with some serious side-effects." - taste_description = "sweetness" + taste_description = list( + SPECIES_TESHARI = "chalk", + TASTE_STRING_DEFAULT = "sweetness" + ) taste_mult = 1.8 color = "#d0583a" metabolism = REM * 3 @@ -489,7 +492,10 @@ name = "Pyrotoxin" id = "thermite_v" description = "A biologically produced compound capable of melting steel or other metals, similarly to thermite." - taste_description = "sweet chalk" + taste_description = list( + SPECIES_TESHARI = "chalk", + TASTE_STRING_DEFAULT = "sweet chalk" + ) reagent_state = SOLID color = "#673910" touch_met = 50 diff --git a/code/modules/reagents/reagents/vox.dm b/code/modules/reagents/reagents/vox.dm index 666d0c37885..6cad438b322 100644 --- a/code/modules/reagents/reagents/vox.dm +++ b/code/modules/reagents/reagents/vox.dm @@ -36,7 +36,10 @@ /datum/reagent/toxin/voxmeds name = "repair gel" id = "voxmeds" - taste_description = "fizzing sweetness" + taste_description = list( + SPECIES_TESHARI = "fizziness", + TASTE_STRING_DEFAULT = "fizzing sweetness" + ) description = "A complex serum composed of vox-manufactured nanomachines, complex protein chains and microscopic bundles of metallic fibers." strength = 8 scannable = FALSE diff --git a/code/modules/xenobio/items/slime_objects.dm b/code/modules/xenobio/items/slime_objects.dm index 39ae636008b..c4409892b2e 100644 --- a/code/modules/xenobio/items/slime_objects.dm +++ b/code/modules/xenobio/items/slime_objects.dm @@ -121,8 +121,11 @@ filling_color = "#FFBB00" center_of_mass = list("x"=17, "y"=10) nutriment_amt = 25 // Very filling. - nutriment_desc = list("slime" = 10, "sweetness" = 10, "bliss" = 5) + nutriment_desc = list( + TASTE_STRING_DEFAULT = list("slime" = 10, "sweetness" = 10, "bliss" = 5), + SPECIES_TESHARI = list("slime" = 10, "subtle bitterness" = 10, "bliss" = 5) + ) /obj/item/reagent_containers/food/snacks/slime/Initialize() . = ..() - bitesize = 5 \ No newline at end of file + bitesize = 5