Implement recipe system #245
Labels
No labels
Blocked
Duplicate
MoSCoW/Could Have
MoSCoW/Must Have
MoSCoW/Should Have
Points/1
Points/13
Points/2
Points/21
Points/3
Points/5
Points/8
Priority/Backlog
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
State/Completed
State/In progress
State/In review
State/Paused
State/Unverified
State/Verified
State/Wont Do
Type/Bug
Type/Epic
Type/Feature
Type/Legendary
Type/Task
Type/Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#211 Epic: Crafting Minigame Engine
aethyr/Aethyr
Reference: aethyr/Aethyr#245
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
feature/m4-recipe-systemImplement recipe system (#245)Background and Context
Recipes are the blueprints that tie the crafting system together. A recipe defines what ingredients are needed, what skill and level are required, what challenge sequence the player will face in the minigame, and what item is produced on completion. Recipes are stored in
conf/recipes.yamland loaded at server startup.The
Recipeclass is responsible for validating that a player has the required ingredients in their inventory, checking skill requirements, generating theCraftingMinigamestep sequence from the recipe's challenge definition, and producing the output item with quality determined by the minigame score.This is the glue between the harvesting/resource system, the minigame engine, and the item/inventory system.
Expected Behavior
The
Recipedata model includes:Array<Hash>) — A list of required ingredients with item type and quantity (e.g.,[{item: "iron_ore", qty: 3}, {item: "coal", qty: 1}]).String) — The crafting skill required (e.g.,"smithing").Integer) — The minimum skill level required to attempt this recipe.Array<Hash>) — An ordered list of challenge step definitions (e.g.,[{type: "strike", difficulty: 3}, {type: "hold", duration: 4}, ...]).Hash) — The template for the output item, including base stats that are modified by quality (e.g.,{type: "iron_sword", base_damage: 10, base_durability: 100}).Workflow:
craft <recipe_name>.Recipevalidates ingredients are present in the player's inventory.Recipechecks the player's skill level meetsrequired_levelforrequired_skill.Recipegenerates aCraftingMinigamewith the definedchallenge_sequence.output_item_templateto produce the final item.Acceptance Criteria
Recipeclass exists with all 5 fields properly defined.conf/recipes.yamlat server startup.Recipe#validate_ingredients(player)returns true if the player has all required ingredients, false otherwise.Recipe#check_skill(player)returns true if the player meets the skill and level requirements.Recipe#consume_ingredients(player)removes the required ingredients from the player's inventory.Recipe#generate_minigamecreates aCraftingMinigamewith the recipe's challenge sequence.Recipe#craft_item(quality_score)produces an item from the output template with stats modified by quality.craft <recipe_name>command initiates the full crafting workflow.conf/recipes.yaml.Subtasks
Recipeclass with all 5 fields and accessors.conf/recipes.yamlwith validation and error handling.validate_ingredientsto check player inventory against the ingredient list.check_skillto verify the player's skill level meets requirements.consume_ingredientsto remove ingredients from inventory on craft start.generate_minigameto create aCraftingMinigamefrom the challenge sequence.craft_itemto produce a quality-scaled item from the output template.craft <recipe_name>command handler that orchestrates the full workflow.conf/recipes.yamlwith at least 5 example recipes spanning different skills.tests/unit/recipe_system.featurecovering YAML loading, ingredient validation, skill checks, ingredient consumption, minigame generation, item crafting with quality.tests/integration/for end-to-end recipe crafting flow.bundle exec rake unit_profileand verify no performance regressions.bundle exec rake unit. If coverage is <97% then review the current unit test coverage report atbuild/tests/unit/coverage/and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerunbundle exec rake unitto verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.bundle exec rake(default task: unit tests with coverage) andbundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.Definition of Done
This issue is complete when:
master, reviewed, and merged before this issue is marked done.