Class Data Structure

by Dale M.A. Johnson


created 9/16/06


This is an overview of the intended structure for unit classes.


The Structure and Its Members

The data for unit classes are stored in CClasses and accessed using the object handle uclass[#].member (the handle "class" cannot be used because it is a C++ keyword). There can be up to 250 unit classes. Each class has the following information stored for it.




string tName
The name of the class.
string tFile
The name of the image file used for this class.
bool bProperties[#]
Flags for the special unit properties. Used primarily for extra damage from special weapons.
int iType
The type of unit this is. By default: 0 = light foot unit; 1 = heavy foot unit; 2 = mounted unit; 3 = flying unit; 4 = lithe (very light) foot unit; 5 = wheeled vehicle; 6 = ships. Used to determain movement costs.
int iMaxLEV
The highest level this unit can achieve.


Base Stats


int iBHP
Base hit points.
int iBMP
Base magic points.
int iBSTR
Base strength.
int iBMAG
Base magic.
int iBDEF
Base defense.
int iBRES
Base resistance.
int iBSKL
Base skill.
int iBSPD
Base speed.
int iBLUK
Base luck.
int iBCON
Base constitution.
int iBMOV
Base movement points.
int iNear
The closest point (in tiles) this unit can attack when unarmed. 0 means they cannot attack unarmed.
int iRange
The range (in tiles) that this unit can attack, starting from the iNear point. 0 means they have a range of 1 tile, the iNear tile.


Growth Rates


int iGHP
Hit point growth.
int iGMP
Magic point growth.
int iGSTR
Strength growth.
int iGMAG
Magic growth.
int iGDEF
Defense growth.
int iGRES
Resistance growth.
int iSKL
Skill growth.
int iSPD
Speed growth.
int iGLUK
Luck growth.
int iGCON
Constitution growth.
int iMOV
Movement points growth.