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

Vitamin-based allergy #74763

Merged
merged 17 commits into from
Jun 27, 2024
Merged

Vitamin-based allergy #74763

merged 17 commits into from
Jun 27, 2024

Conversation

GuardianDll
Copy link
Member

@GuardianDll GuardianDll commented Jun 24, 2024

Summary

Features "Food can inherit the allergens of materials it was cooked from"

Purpose of change

Continuation of #72224
Makes allergy a bit more robust - before the only way to assign allergy was giving a specific material to a food, which is both unflexible, do not allow to use the properties of ingredients, and created stuff like "wheat-free bread" as a separate item

Describe the solution

With the power of code, json, Harakka and Renech, fix it:

  • before allergy code checked the specific flags, and this flags were assigned based on the material - now it's checks a vitamin presented in item (part, mostly made by Renech)
  • to prevent regression at this initial step, all food that have had material assigned, got the vitamin as replacement (part, mostly made by Harakka, using https://github.com/harakka/vitaminer) - in the future we could slowly strip this vitamins away, and use components field in itemgroups to, for example, spawn bread and wheat-free bread dynamically, instead of deluxe_cheeseburger_wheat_free existing in a single form, having no recipe, not used anywhere, abandoned

Testing

Took baklava, and removed it's material and vitamins fields, then debug spawned, gave the character grain intolerance, and cooked out of three flours, in order:

debug spawned, no vitamins
cooked out of flour
cooked out of wheat-free flour
cooked out of bread flour
image
image

walked around the city, food spawned looks good

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Items: Food / Vitamins Comestibles and drinks Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mechanics: Enchantments / Spells Enchantments and spells Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods: Tamable Wildlife Mods: Xedra Evolved Anything to do with Xedra Evolved <Enhancement / Feature> New features, or enhancements on existing labels Jun 24, 2024
src/consumption.cpp Outdated Show resolved Hide resolved
src/consumption.cpp Outdated Show resolved Hide resolved
src/consumption.cpp Outdated Show resolved Hide resolved
src/item.h Outdated Show resolved Hide resolved
GuardianDll and others added 2 commits June 24, 2024 20:10
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Jun 24, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Enhancement / Feature> New features, or enhancements on existing Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mechanics: Enchantments / Spells Enchantments and spells Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Tamable Wildlife Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods: Xedra Evolved Anything to do with Xedra Evolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants