-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Allow vitamin-providing drugs to be deposited into faction camp larder #76025
Allow vitamin-providing drugs to be deposited into faction camp larder #76025
Conversation
it was copied from flesh because most of drug fillers are made out of gelatine, but i didn't want to make it |
}, | ||
"//": "Yes, the vitamins are intentionally duplicated here. The consume/use/iteminfo UI needs them in use_action, but to actually pass on the vitamins they need to be in the comestible data, as below.", | ||
"//2": "TODO: Fix this...", | ||
"vitamins": [ [ "calcium", 24, 48 ], [ "iron", 24, 48 ], [ "vitC", 24, 48 ] ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB this is the wrong form for vitamins
, it's only allowed to be [string, number]:
Cataclysm-DDA/src/item_factory.cpp
Lines 3397 to 3399 in 88ecaf6
vitamin_id vit( pair.get_string( 0 ) ); | |
if( pair.has_int( 1 ) ) { | |
slot.default_nutrition.set_vitamin( vit, pair.get_int( 1 ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, I thought that might be the case but it didn't throw an error on load. Use_action allows 2 int values because it gives a random value from within the range(??), right?
Yep, the use_action here is correct but the vitamins on the comestible are
a fixed amount, not randomizable.
…On Fri, Aug 30, 2024 at 20:43 RenechCDDA ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In data/json/items/comestibles/med.json
<#76025 (comment)>
:
> @@ -1773,7 +1773,10 @@
"type": "consume_drug",
"activation_message": "You take the %s.",
"vitamins": [ [ "calcium", 24, 48 ], [ "iron", 24, 48 ], [ "vitC", 24, 48 ] ]
- }
+ },
+ "//": "Yes, the vitamins are intentionally duplicated here. The consume/use/iteminfo UI needs them in use_action, but to actually pass on the vitamins they need to be in the comestible data, as below.",
+ "//2": "TODO: Fix this...",
+ "vitamins": [ [ "calcium", 24, 48 ], [ "iron", 24, 48 ], [ "vitC", 24, 48 ] ]
Huh, I thought that might be the case but it didn't throw an error on
load. Use_action allows 2 int values because it gives a random value from
within the range(??), right?
—
Reply to this email directly, view it on GitHub
<#76025 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABKGAET5G4ORRAN66R7VX3ZUE3XVAVCNFSM6AAAAABNJL6RYGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENZTG42DAOBSHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Summary
Features "Add drugs and mutagens to your faction camp stores."
Purpose of change
Describe the solution
Loosen the check to not exclude 0-kcal items that do have vitamins, if player says yes on a query. (Or they can just mash enter a second time and ignore it, which distributes exactly the same as before)
Add some handling to the messages so it lets you know what's going on
Describe alternatives you've considered
Some sort of check against the comestible's type
NPCs should maybe get upset/suspicious if you're mixing mutagens into the food supply? But some of them might want to mutate, or want for example human purifier(technically a mutagen!) available to them. So that's a whole other issue
Testing
Added some food, got the expected kcal+vitamins value
Tried to add some meds with no vitamins or calories, got rejected
Tried to add some multivitamins(meds), multivitamins were added to the larder and consumed from the local map.
Note that despite the "duplicated" vitamins in the multivitamins item, both 'E'ating and 'a'ctivating the item gives only the use_action's amount, not double. So the actual vitamin value of them did not change.
Additional context
I added a note because this requires the vitamins on the multivitamins item to be duplicated. use_action and the comestible data are already duplicating this. A problem for another day.
I specifically gave drug_filler material an empty vitamin array so it didn't copy-from flesh's default vitamins. Otherwise drugs made of it would always have vitamins and be consumedVitamins extend by default! So instead it now copies from powder, as many of the drug items were originally using. Powder does not have any default vitamins and will avoid this case.@GuardianDll I went over #70176 to make sure I got your intention right, I'd appreciate if you just gave this a quick look.