Minicraft3DS/source/Crafting.h
Andre Schweiger 3699414dcd Started work on new update
Added some small new map generation features
Added "NPCs" and "Quests" (atleast a first experiment for them)
Added magic compass to make search for stairs leass annoying
Added mostly visual season and weather effects
2017-01-07 21:54:28 +01:00

39 lines
839 B
C

#pragma once
#include <stdarg.h>
#include "Item.h"
typedef struct {
int costItem;
int costAmount;
} Cost;
typedef struct {
bool canCraft;
int itemResult;
int itemAmountLevel;
s8 numOfCosts;
Cost costs[6]; // Up to 6 items for costs
u8 order; // Used for stable sorting.
} Recipe;
typedef struct {
int size;
Recipe * recipes;
} RecipeManager;
RecipeManager workbenchRecipes;
RecipeManager furnaceRecipes;
RecipeManager ovenRecipes;
RecipeManager anvilRecipes;
RecipeManager loomRecipes;
RecipeManager enchanterRecipes;
Recipe defineRecipe(int item, int amountOrLevel, int numArgs, ...);
void checkCanCraftRecipes(RecipeManager * rm, Inventory * inv);
void sortRecipes(RecipeManager * rm);
bool craftItem(RecipeManager * rm, Recipe* r, Inventory* inv);
void initRecipes();
void freeRecipes();