Wow, what a week. A task that I had assumed would take 1.5 days ended up sucking up around 32 hours. While my lack of scheduling foresight sucks, the time was DEFIANTLY worth it to have this vital feature done right...
In previous builds, all unit stat handling was done with a basic array of stats. There was a hard-coded list of what could and could not be stored in it (Strength, Defense, and HP to name a few). It worked, but with several new stats in the pipeline (Magic Attack, Magic Strength, Structural Damage) and the ongoing discussion on other damage types, I figured it was time to rework the system in a data-friendly way.
We now store all unit stat data in what are called MAPS, where entries are sorted by a STRING, opposed to a numeric INDEX. Now, instead of using afStats to get hit points, the developers use mapfStats['HitPoints']. We also have a file that defines the given stats for the game...
<Description>How much damage a unit can endure before kickin' the bucket.</Description>
The above would let the game know that 'UnitStat_HitPoints' is a valid unit stat. You could then add a stat type by defining it in XML...
<Description>The blunt damage this unit will deal when attacking.</Description>
You then add a stat modifier to a weapon...
And the game will know that any unit with that weapon does 5 points blunt attack. Hooking this up to the battle system in a data-driven fashion will be another adventure, but at least the raw data is now organized and manageable. A good week...even if I wish I had more to show for it