Jump to content

Need feedback on how I should implement my 'recipe'


Recommended Posts

Hey all,

A little bit of context first: I'm trying to implement the Materia system from Final Fantasy 7. Basically the player can equip and combine items, that can result in some effect. I already have the effects in place (Each effect is a class which implements certain interfaces, that I defined previously), but now I would like to have some sort of 'crafting' system for the effects. I need a mapping, that maps up to 4 items to an effect.
Short example to clear things up: I have the FireMateria and the AreaMateria. Equipping the FireMateria on a pick will result in an autosmelt, while the AreaMateria will increase the amount of mined blocks (like TC hammer). Combining these 2 materias will result in a hammer-like mining with autosmelt. For each of these effect I have seperate classes (FireEffect, AreaEffect, FireAreaEffect) These are necessary, because some effects will be more abstract then just an autosmelt

Should I write my own recipe type or can those only map items to a resulting item? If a recipe type is not the answer, what could I do instead? Some kind of HashMap<customKey, Effect>? I just need some general direction and maybe some example code (for a custom recipe type) that I could analyze :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.