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

Infrastructure for using vitamin system for toxins #34695

Merged

Conversation

Davi-DeGanne
Copy link
Contributor

@Davi-DeGanne Davi-DeGanne commented Oct 13, 2019

Summary

SUMMARY: Infrastructure "Add infrastructure to support using vitamin system for toxins"

Purpose of change

The vitamin system would be perfectly set up for representing food-borne toxin buildup in the body with only a few small modifications.

Required for #34878

Describe the solution

  • Allow vitamins with side-effects from excess, even if they don't have deficiency symptoms.
  • Implement distinct severity levels for vitamin excesses.
  • Fixed a bug that capped vitamins at 0 regardless of their listed max.
  • Fixed a bug that caused infinite vitamin buildup even if the player only consumed a small amount a single time.
  • Fixed a test that broke because it relied on the above bug to work.

@Davi-DeGanne Davi-DeGanne changed the title Make vitamin 'deficiency' field optional [WIP] Infrastructure for using vitamin system for toxins Oct 13, 2019
@Davi-DeGanne Davi-DeGanne changed the title [WIP] Infrastructure for using vitamin system for toxins Infrastructure for using vitamin system for toxins Oct 13, 2019
@KorGgenT KorGgenT added [C++] Changes (can be) made in C++. Previously named `Code` Items: Food / Vitamins Comestibles and drinks labels Oct 13, 2019
@Lunaimon
Copy link

Would this be able to be used for intolerances like gluten and lactose?

@Davi-DeGanne
Copy link
Contributor Author

Would this be able to be used for intolerances like gluten and lactose?

Yes, definitely.

@Davi-DeGanne Davi-DeGanne force-pushed the vitamin-optional-deficiency branch from 6e150bb to 16de776 Compare October 17, 2019 09:57
Davi added 4 commits October 18, 2019 07:13
To make it possible to use the vitamin infrastructure for toxin buildup.
Required infrastructure for re-PR of 34636.
@Davi-DeGanne Davi-DeGanne force-pushed the vitamin-optional-deficiency branch from 16de776 to 4f8e68c Compare October 18, 2019 11:31
@Davi-DeGanne
Copy link
Contributor Author

Making this a WIP until I can test it more, keep running into bugs in the vitamin code.

@Davi-DeGanne Davi-DeGanne changed the title Infrastructure for using vitamin system for toxins [WIP] Infrastructure for using vitamin system for toxins Oct 18, 2019
Davi added 2 commits October 20, 2019 05:05
Previously, starve_test_hunger3 was way too strict to ever pass, and the
diet it was supplying was deficient in several vitamins. However, it was
going unnoticed because the buffer-not-being-cleared bug meant that by
the end of the 20 days, the test player was getting ~2000% vitamins/day.
@Davi-DeGanne Davi-DeGanne changed the title [WIP] Infrastructure for using vitamin system for toxins Infrastructure for using vitamin system for toxins Oct 20, 2019
@Davi-DeGanne
Copy link
Contributor Author

Removing the [WIP] tag, I have tested this pretty thoroughly using #34878 and it is working as intended.

@kevingranade kevingranade merged commit e941a73 into CleverRaven:master Oct 22, 2019
va5h pushed a commit to va5h/Cataclysm-DDA that referenced this pull request Oct 23, 2019
* Make vitamin 'deficiency' field optional
To make it possible to use the vitamin infrastructure for toxin buildup.
Required infrastructure for re-PR of 34636.
* Implement severity above 1 for vitamin excess
* Fix existing bug that capped stored vitamins at 0
* Clear vitamins_absorbed buffer after using it
* Loosen up starve_test_hunger3 so it passes
Previously, starve_test_hunger3 was way too strict to ever pass, and the
diet it was supplying was deficient in several vitamins. However, it was
going unnoticed because the buffer-not-being-cleared bug meant that by
the end of the 20 days, the test player was getting ~2000% vitamins/day.
@Davi-DeGanne Davi-DeGanne deleted the vitamin-optional-deficiency branch October 25, 2019 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Items: Food / Vitamins Comestibles and drinks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants