Files
Bubberstation/code/modules/surgery/organs/internal/liver
_0Steven 8c3fc471d8 Refactor tasting code and reagent taste carrying, no longer taste your stomach contents or have non-existing flavours win out (#87329)
## About The Pull Request

Soooooooooooooooooooooooooooooooo tasting code has been jank for a good
damn while, and with this we aim to fix that- let's start from the
beginning.

Earlier when I was making a food item, I noticed that it'd never
actually have the taste I gave it, just tasting indescribable as things
without tastes do.
Weird, cause it definitely has a taste set, and plenty of nutriment
subtype reagents!...
When looking into it, I noticed that we only copy the tastes to
*specifically* the base nutriment and the vitamin subtype:

57b718ad20/code/datums/components/food/edible.dm (L215-L216)
But! Surely the other reagents should have tastes, right?.... No:

57b718ad20/code/modules/reagents/chemistry/reagents/food_reagents.dm (L119-L120)
we were always returning the tastes data, but never actually setting it
except for those two reagents, overriding any and all tastes.
This caused the non-taste of the proteins and fats to override the food
taste applied to the vitamins with their volume.

So, to fix this, we replace these hardcoded ids with a check for
`carry_food_tastes` on the nutriment reagent, such that each can
individually define whether they carry food tastes. This lets oils have
their own tastes, while letting all other nutriments carry the tastes.
We then make `get_taste_description(...)` return the base flavour if no
special flavour is found, and add base flavours to proteins and vitamins
based on what pure proteins/vitamins with no further additives would
roughly taste like.

This fixes our issue!....... Except, we now always taste something "rich
earthy pungent" when we eat. Looking into it, that's the organ tissue
reagent, used in our stomachs:

57b718ad20/code/modules/reagents/chemistry/reagents/food_reagents.dm (L232-L236)
....Because whenever we ingest something, we taste the contents of our
stomach. This was previously less noticeable, as while it *did* count,
it only added a weight for _no flavour_.

To fix this we just, well, make it so you taste what you're eating and
not the container itself.
It's as simple as separating the tasting code from the reagent holder,
and making the tasting that happens on ingest exposure use that logic
instead.
We keep the old logic for the INTJ skillchip and tasting machine, just
re-routed through this, and split up some procs to avoid too much
duplication.

This fixes our issue! Though, there's still some minor issues.
This lets us add organ tissue instead of nutriment to other organs so
they no longer taste indescribable, as it actually works properly now,
but letting organ tissue hold flavours would risk having the stomach
organ tissue permanently leech the flavours of the organ tissue you eat.
So we make a subtype of organ tissue for the stomach, stomach lining,
which cannot hold flavours.
This lets us apply the base organ tissue to all other organs without
risking stomach contamination.
## Why It's Good For The Game

It's jank to taste your stomach contents.
It's jank for organs to taste like nothing.
It's jank for reagents with flavours to never taste like anything.
It's jank for tasteless reagents to block out food flavours.
It's jank for organs to only sometimes contain organ tissues.
yeah.
## Changelog
🆑
refactor: Refactored tasting code. Please report any jank tasting
behaviours.
fix: You taste what you eat instead of the contents of your own stomach.
fix: Other basic nutriment subtypes also carry food flavours, instead of
outweighing the food flavours with their lack of flavour.
fix: Basic nutriment subtypes have a flavour they default to, in case of
not carrying any food flavours.
fix: Oils taste like oil instead of tasting indescribable.
fix: Clothing eaten by moths actually carries its flavours instead of
tasting indescribable.
fix: Organs use organ tissue instead of nutriment.
fix: You can actually taste organ tissue.
qol: Mineral slurry tastes like minerals instead of tasting
indescribable.
fix: Tasted flavours can actually be "strong" in addition to mild or "a
hint of", as intended.
qol: Flavours are only strong when their percentage of what you're
tasting is more than 4x taste sensitivity instead of 3x, for most
default tongues being 60% and lizards 40% of the drink.
qol: Tasted flavours are sorted by strength, stronger flavours coming
first.
qol: Tasted flavours are grouped into "strong", "mild", and "hint" in
the message, replacing "You can taste a hint of bitterness, alcohol, a
hint of sweetness, and a hint of cola" with "You can taste alcohol and a
hint of bitterness, sweetness, and cola".
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2024-11-02 01:44:34 +01:00
..