Support mana, stamina, and blood costs in crafting recipes - #88191
Closed
Relvl wants to merge 2 commits into
Closed
Conversation
Contributor
|
You are creating a pull request with the master branch as the head branch. This is completely fine if you plan to make contribution once or do not plan to do it often, but if you are interested in making multiple pull requests within a short span of time, this would prevent you from doing it comfortably. You may read https://docs.github.com/en/get-started/quickstart/contributing-to-projects#creating-a-branch-to-work-on for a typical workflow of contributing to a project on GitHub. |
Contributor
Author
|
Wrong branch sorry :0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Features "Allow crafting recipes to consume character resources"
Purpose of change
Allow recipes to require character resources in addition to tools and components.
This is intended for recipes and practice activities that should consume mana, stamina, or blood while progressing, such as magical crafting, strenuous training, or blood-based rituals.
Describe the solution
Adds a new optional recipe field:
Supported resources are
mana,stamina, andblood.Character resource costs scale linearly with batch size and are consumed gradually according to crafting progress. Before each progress increment, all required resources are checked together. If any resource cannot be consumed, the current crafting turn is rolled back in the same way as a failed tool-charge consumption.
Mana and stamina cannot be reduced below zero. Blood cannot be reduced past the threshold for critical hypovolemia.
For unattended recipe steps, the remaining character resource cost is consumed before the passive step begins, since resources cannot be drawn from the crafter while they are no longer actively working on the item.
Characters with
DEBUG_HSare treated as having sufficient resources and do not consume them.The crafting interface displays a new
Character resourcessection below tools and components. A resource is displayed normally when the character currently has enough for the full recipe cost, and highlighted when the full amount is unavailable.Describe alternatives you've considered
Character resources could have been represented as tool charges or pseudo-items, but that would not accurately model resources stored directly on the character and would require additional supporting items or special-case behavior.
Another option was to require the entire resource cost before crafting could begin. This would prevent recipes from using resources that regenerate during long crafts, so the implementation instead checks and consumes the required amount incrementally.
Blood costs could be expressed in milliliters rather than internal blood units. This version uses the existing internal units to avoid introducing a new conversion convention without prior agreement.
Testing
Tested recipes with separate mana, stamina, and blood costs, also together.
Verified that:
DEBUG_HSbypasses resource checks and consumption;character_resourcesretain their existing behavior;Additional context
The initial implementation intentionally supports only mana, stamina, and blood. Additional character resources can be added later when there is a concrete use case and agreed behavior for their availability and consumption.