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

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...

Important Information

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