I would go anvilfolks way, too. In 'something with zombies' i used composition instead of inheritance. So i got a single entity object which had lots of internal property objects.
And as i feel boring, i'll write something more:
- CompDestroyable (Component destroyable)
- CompDamageInflictor (several damage attributes and so on)
- CompDamageRepellent
- CompExhaustible ( amount, maxamount... e.g. clips, food, everything which decreases in quantity )
- CompWasteable ( everything which decreases in quality )
- CompConsumable
- CompPickup ( weight, volume )
- CompCreature ( strength, intelligence ... )
Keep track of all your objects in a calc sheet, divide their attributes in components and there you go with the most generic system you can have. I ended with a hundreds of rows for objects and ~15 components.
And a little bit more, how everything works together:
The steps for taking damage e.g. are the following:
- Check if item is DamageInflicting > store the base damage
- Check if any other damageInflicting objects are attached to the item -> add damage (e.g. a scope mounted on the rifle could increase damage, or different ammunition types could modify base damage of rifle)
- Check if target itself is destroyable
- Check if target itself is DamageRepellent -> modify damage
- Check if any other damagerepellent objects are attached to the item -> modify damage
- Do the damage to the target
Goes a little bit off, but i could not stop writing... sorry