Tomash667 / carpg

Combination of action rpg with roguelike.
https://carpg.pl
MIT License
16 stars 15 forks source link

Recipe learning #440

Closed BottledByte closed 4 years ago

BottledByte commented 4 years ago

Character now stores known recipes. It is possible to memorize new recipe using script command or reading a book with recipes tag. CraftPanel shows only recipes which are known to the character. Memorized recipes are kept in save file. If loading old save file, prior to recipe learning, character will memorize recipes that he had available before recipe learning implementation.

Testing: Created character, scripted in a recipe, saw it was available in CraftPanel. Saved and reloaded and recipes known at save time appeared in CraftPanel. Tried an old save and saw that recipes the player had available back then are memorized properly and available for crafting. Learned a recipe in multiplayer as both client and server. Created a Book item with recipes tag. Reading the book added the recipes included.

Additional context: Using/balancing the new recipe learning mechanics in-game is not subject of this PR.

Edit: I changed this PR's meaning, so if there are any problems with it, I will try to resolve them.

Tomash667 commented 4 years ago

I'll merge this, you can change things in next commit.