Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Toxins not working with simplified nutrition #35917

Merged
merged 1 commit into from
Dec 7, 2019

Conversation

anothersimulacrum
Copy link
Member

@anothersimulacrum anothersimulacrum commented Dec 7, 2019

Summary

SUMMARY: Infrastructure "Implement vitamin types"

Purpose of change

Everything of type vitamin was disabled by the NO_VITAMINS external option.
This meant that non-vitamin things of type vitamin were also disabled by this, notably toxins from mutant meat.

Describe the solution

Add vit_type JSON field to vitamins, and type to the vitamin class.
Create a vitamin_type enum, and load the vit_type strings in the vitamin JSON into these enum values.
Make the NO_VITAMINS external option only zero out vitamin type vitamins.

Describe alternatives you've considered

I considered renaming the vitamin class to prevent future confusing, but I judged that to be a fairly large change without too much gain.

Testing

Create a world without simplified nutrition, look at the vitamin values for mutant meat. Notice they match the values defined in JSON.
Create a world with simplified nutrition, look at the vitamins in mutant meat. Notice that it only has Toxins, because they are the only type of vitamin it has that is not of vitamin type.

Additional context

No documentation because vitamins aren't documented. I'll make a PR for that soon.
image
image

This commit adds vitamin `types`, different variations of vitamins that
can later be expanded to have different effects.

These are dynamically loaded from JSON into 4 types, vitamin, toxin,
drug, and counter. Only vitamin, toxin, and counter are used right now.

Only the vitamin type has an effect, used with simplified nutrition to
make it so that that vitamin has no effect.
@Night-Pryanik
Copy link
Contributor

I think the Vitamins (RDA) part in Vitamins (RDA): Toxins (x%) text is... useless? Maybe omit this part and leave only the Toxins?

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Items: Food / Vitamins Comestibles and drinks Mods Issues related to mods or modding labels Dec 7, 2019
@ZhilkinSerg ZhilkinSerg merged commit 74e1841 into CleverRaven:master Dec 7, 2019
@anothersimulacrum anothersimulacrum deleted the vita-type branch December 7, 2019 05:58
@anothersimulacrum
Copy link
Member Author

Well, since this was just merged, I guess I'll do that in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants