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

[CR] Add activity levels to recipes #42873

Closed
wants to merge 22 commits into from

Conversation

anothersimulacrum
Copy link
Member

Summary

SUMMARY: Features "Allow recipes to specify individual activity levels"

Purpose of change

Related to: #42343, #36976

With recent adjustments to activity levels, a problem came up: spending all day sewing is as intensive as spending all day making an anvil, or forging a set of armor.
So, to solve this, specify the activity level of a recipe in the recipe definition, and use that for activity level calculations.

This PR depends on #42794

This PR is NOT ready to merge, and probably never will be - what it currently has should be split out and done over many PRs.

Describe the solution

The real changes that this PR makes:
Allow activity actors in particular to specify and activity level, and access an activity's activity level through the associated player_activity, not the activity_type.

In recipes, when they are marked obsolete, skip loading all other members. This is because I intend to make activity_level mandatory for recipes, and it doesn't need to be specified in the obsolete recipe stubs.

Add an activity_level member to recipes, and override the exertion_level() function in the craft_activity_actor to return this.
If this activity level is not specified, load it as MODERATE_EXERCISE. Also allow it to be specified as 'fake', for easier automated changes of it to a proper level. When it is specified as 'fake', it is loaded as MODERATE_EXERCISE.
I chose to specify it as 'fake' instead of just adding the key when it did not exist because it meant that I could easily position the activity_level to be near the result of the recipe, making it easier to review the changes.

Add an activity level to all recipes.

Remove the 'fake' hack, and make activity_level a mandatory member of recipes.

Describe alternatives you've considered

Not messing around with this 'fake' stuff, but it makes reviewing it easier, and it'd be fairly hard to back out now.

Testing

No errors on game load, all tests pass.
Crafting knives for 24 hours gives 24 hours of brisk exercise, sewing for 24 hours gives 24 hours of light exercise.

Additional context

While this does not correspond directly to any of the 0.E blocker issues, I'd like this to be merged (well, the parts of it I'll be PR-ing later) before 0.E to help with some of our exertion/calorie problems.

@anothersimulacrum anothersimulacrum added <Enhancement / Feature> New features, or enhancements on existing Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items: Food / Vitamins Comestibles and drinks Mechanics: Character / Player Character / Player mechanics labels Aug 11, 2020
@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/excessive-calorie-burn-while-cooking/24466/2

Any recipes using blacksmithing_standard are now BRISK_EXERCISE
Automatically change all recipes using forging to BRISK_EXERCISE
Change everything yet unchanged using welding_standard to be
BRISK_EXERCISE.
Changed all recipes using soldering to MODERATE_EXERCISE if not already
set.
Change all sewing recipes without an exercise value assigned to be
LIGHT_EXERCISE
Change all recipes without an activity level using the metal sawing
quality to MODERATE_EXERCISE
Change all recipes using wood sawing without an activity level to be
MODERATE_EXERCISE
Change all recipes without an activity level using hammering to be
MODERATE_EXERCISE
Change all mutagens recipe to be LIGHT_EXERCISE
Make all cooking recipes without activity level be LIGHT_EXERCISE
Convert all recipes without an activity level using boiling to be
LIGHT_EXERCISE
Convert all recipes without an activity level that use chemistry to be
LIGHT_EXERCISE
Change all recipes using the sew quality that do not already have an
activity level to be LIGHT_EXERCISE
Change all chiseling recipes without an activity level to be
MODERATE_EXERCISE
All the recipes which there was no easy data on.
These don't actually currently use it, just set it all to
LIGHT_EXERCISE. None of them appear to have easy info to automate
different changes on.
Some recipes that missed adjustment
Prevent potential unintended behavior and remove the hacks necessary
for automation - make all recipes specify an activity level.
@anothersimulacrum
Copy link
Member Author

We won't be merging this before 0.F (at least, I don't want to), and as is, I think it's just going to accumulate problems. I'll come back when 0.F is out.

@actual-nh
Copy link
Contributor

Perhaps move the project "card" for this from "in progress" for 0.F to 0.G blockers?

@anothersimulacrum anothersimulacrum deleted the recime branch July 9, 2021 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing Items: Food / Vitamins Comestibles and drinks Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants