Original Post
I am recoding my RPG (for the third time) that I have been making on and off for 8 years now (I started before I knew c++). This time I decided instead of starting with getting a map displayed, then character, then moving around I would start with the battle system as it is something I haven never got around to doing and might give me some more insight on a better engine structure for my game. Currently it goes like this: BattleEngine class handles whos turn it is, asking them for an action and doing that action, then doling out exp/items at the end of the battle. There is the Beastiary & Party classes that handle the Character class, they both basically load a character (savegame or monster) from xml and is used to be scalable (so I can have more than one character on each side of the fight). What I am implementing now is an item system so the characters can equip something. My question is how have people gone about this.... I want my game to be very item-oriented ala Diablo II but for now I'll leave random item generation alone and stick to helm with 5 fire resistance etc. My Character class has private members like health, dhealth (delta health, i.e. how much health skills/items add onto or decrease your base health), strength, dStrength, fire_resistance, dFire_resistance, etc, etc. and I was thinking of having the Character class load in the items and parse their modifiers, adding them to the 'd' members of Character to be used in damage calculations, but then I realised if I did this I wouldn't really need an item class so much as a function to open the itemstats.xml, grab the item's modifiers and return them to the Character class... to me this doesn't sound right, I want to have the items loaded so you can view them in your inventory without having to relaod an xml everytime. The other way was to have the item class and load each item into its repspective Character memeber (Head, Torso, Ring1, Ring2, etc.) and then parse the modifiers everytime you need to claculate damage, but that seems inefficient to me, haivng to loop through all the items every round (Even item in the inventory can effect the player ala Diablo II charms). I was just looking for some advice on someone who has done this before on which way to go or wether there is a different approach I can't see. Thanks for reading this long as(probably illegible) post, first time posting here, but long time reader.