2007-06-08 17:58:04 +03:00
# ifndef CHEROHANDLER_H
# define CHEROHANDLER_H
2008-06-13 11:16:51 +03:00
# include "../global.h"
2007-06-08 17:58:04 +03:00
# include <string>
# include <vector>
2007-06-18 15:48:29 +03:00
class CHeroClass ;
2007-09-15 21:04:12 +03:00
class CDefHandler ;
2007-09-30 19:16:00 +03:00
class CGameInfo ;
2007-10-27 22:38:48 +03:00
class CGHeroInstance ;
2008-06-17 20:48:32 +03:00
class DLL_EXPORT CHero
2007-06-08 17:58:04 +03:00
{
public :
std : : string name ;
2007-06-16 16:33:58 +03:00
int ID ;
2008-05-03 18:30:11 +03:00
int lowStack [ 3 ] , highStack [ 3 ] ; //amount of units; described below
std : : string refTypeStack [ 3 ] ; //reference names of units appearing in hero's army if he is recruited in tavern
2007-06-09 16:28:03 +03:00
std : : string bonusName , shortBonus , longBonus ; //for special abilities
2007-06-11 20:21:27 +03:00
std : : string biography ; //biography, of course
2007-06-09 21:14:41 +03:00
bool isAllowed ; //true if we can play with this hero (depends on map)
2007-06-18 15:48:29 +03:00
CHeroClass * heroClass ;
2007-07-16 13:03:54 +03:00
EHeroClasses heroType ; //hero class
//bool operator<(CHero& drugi){if (ID < drugi.ID) return true; else return false;}
2007-06-08 17:58:04 +03:00
} ;
2008-06-17 20:48:32 +03:00
class DLL_EXPORT CHeroClass
2007-06-18 13:49:06 +03:00
{
public :
std : : string name ;
float aggression ;
int initialAttack , initialDefence , initialPower , initialKnowledge ;
2008-05-03 18:30:11 +03:00
std : : vector < std : : pair < int , int > > primChance ; //primChance[PRIMARY_SKILL_ID] - first is for levels 2 - 9, second for 10+;;; probability (%) of getting point of primary skill when getting new level
2007-06-18 13:49:06 +03:00
std : : vector < int > proSec ; //probabilities of gaining secondary skills (out of 112), in id order
int selectionProbability [ 9 ] ; //probability of selection in towns
2007-08-15 18:13:11 +03:00
std : : vector < int > terrCosts ; //default costs of going through terrains: dirt, sand, grass, snow, swamp, rough, subterrain, lava, water, rock; -1 means terrain is imapassable
2007-10-08 21:47:23 +03:00
CDefHandler * moveAnim ; //added group 10: up - left, 11 - left and 12 - left down // 13 - up-left standing; 14 - left standing; 15 - left down standing
2007-06-18 13:49:06 +03:00
} ;
2008-06-14 13:20:18 +03:00
class DLL_EXPORT CHeroHandler
2007-06-08 17:58:04 +03:00
{
public :
2007-07-16 13:03:54 +03:00
std : : vector < CHero * > heroes ; //by�o nodrze
2007-06-18 15:48:29 +03:00
std : : vector < CHeroClass * > heroClasses ;
2007-11-19 00:58:28 +02:00
std : : vector < std : : string > pskillsn ;
2008-01-27 18:07:27 +02:00
std : : vector < int > expPerLevel ; //expPerLEvel[i] is amount of exp needed to reach level i; if it is not in this vector, multiplicate last value by 1,2 to get next value
2007-08-12 20:48:05 +03:00
unsigned int level ( unsigned int experience ) ;
2008-01-27 18:07:27 +02:00
unsigned int reqExp ( unsigned int level ) ;
2007-06-08 17:58:04 +03:00
void loadHeroes ( ) ;
2007-06-09 16:28:03 +03:00
void loadSpecialAbilities ( ) ;
2007-06-11 20:21:27 +03:00
void loadBiographies ( ) ;
2007-06-18 13:49:06 +03:00
void loadHeroClasses ( ) ;
2008-06-13 11:16:51 +03:00
void loadPortraits ( ) ; //loads names of primary skills
2007-07-16 13:03:54 +03:00
void initHeroClasses ( ) ;
2007-07-20 02:38:11 +03:00
~ CHeroHandler ( ) ;
2007-08-15 18:13:11 +03:00
void initTerrainCosts ( ) ;
2007-06-08 17:58:04 +03:00
} ;
# endif //CHEROHANDLER_H