Jump to content
  • Advertisement

vincero

Member
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

106 Neutral

About vincero

  • Rank
    Newbie
  1. Hello, I want to design an easily extensible item system for my game where I don't need to modify existing code much. I want to add items with new effects on the fly. Traits my items have in common: A name, a description, an npc sell price, if it can be equipped, required level, if it is usable in battle, if it is usable outside of battle, a cooldown So I can encapsulate this already into a class. But now there are item effects. Example: heals x health points, heals x mana points, removes debuff x, adds buff x, gives x stat points on equipping, has x% chance to create some other effect when equipped, etc. And those can be combined like: heals x health and mana points. The first four are examples for effects a usable item can have while the last two are examples for effects equipable items can have. The idea behind it is that I have this structure in a database as well and I can add a new item with a new effect combination in my database, my code reads this then and builds it together into a new fancy item, without me having to modify much. The only time I need to modify my code is when I add new effects obviously. How would you put this together in design pattern(s)? I am writing my game in a language which has support for OO obviously.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!