Feature: Support mana, stamina, and blood costs in crafting recipes - #88192
Feature: Support mana, stamina, and blood costs in crafting recipes#88192Relvl wants to merge 5 commits into
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Firstly, instead of In general, is there a reason to consume stamina specifically? training recipes already make character weary, after all |
Yeah, that's a good idea! I'll update that soon.
That's a bit outside the scope of this feature, but I agree it would be useful. I'll make a separate PR for it.
Welp. I have no answer :] Originally I only planned to support mana, but while looking through the available character resources I noticed stamina and thought, “why not?”... It didn't add much complexity to the implementation. |
|
At last, vampire-only recipes (or an easier means of doing so) for XE |
|
Instead of using raw strings, check out the |
|
@GuardianDll I replaced blood crafting costs with generic vitamin costs; please review. @mqrause I replaces string literals with enum; please review. Updated initial comment. |
Github action bot suggestions Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Please fix the CI errors first |
|
Yeah, I saw it, thanks. I'll fix it soon. |
|
Converted to draft: I will write a tests instead of recipe_debug.json |
| #include "build_reqs.h" | ||
| #include "calendar.h" | ||
| #include "crafting_enums.h" | ||
| #include "magic_type.h" |
There was a problem hiding this comment.
| #include "magic_type.h" |
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 vitamins 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, andvitamins.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.
Testing
Tested recipes with separate mana, stamina, and vitamins costs, also together.
Verified that:
safe_level);DEBUG_HSbypasses resource checks and consumption;character_resourcesretain their existing behavior;Additional context
The initial implementation intentionally supports only mana, stamina, and
bloodvitamins. Additional character resources can be added later when there is a concrete use case and agreed behavior for their availability and consumption.