- Joined
- Nov 17, 2010
- Messages
- 1,266
I'm trying to figure out a better way to use armor. I basically want it to act as a number that can be referenced so I can reduce the damage taken by that number.
For example:
Damage = 50
Armor = 10
Damage Taken = (50-10) = 40
This can easily be done with a DDS, but what I cannot do is detect the armor of a unit. So basically I want to assign an armor value to each unit-type so I can just reference that. (For my heroes I can adjust their armor by detecting when they pick up items, level up, etc.)
I was thinking a hashtable would be the best way to save armor values for individual unit-types, but I have no idea where to start. I have a very basic idea of how hashtables work, but I need a small example of where to start.
If someone could help me out I would be very grateful!
For example:
Damage = 50
Armor = 10
Damage Taken = (50-10) = 40
This can easily be done with a DDS, but what I cannot do is detect the armor of a unit. So basically I want to assign an armor value to each unit-type so I can just reference that. (For my heroes I can adjust their armor by detecting when they pick up items, level up, etc.)
I was thinking a hashtable would be the best way to save armor values for individual unit-types, but I have no idea where to start. I have a very basic idea of how hashtables work, but I need a small example of where to start.
If someone could help me out I would be very grateful!