2007-06-08 14:58:04 +00:00
# ifndef CHEROHANDLER_H
# define CHEROHANDLER_H
# include <string>
# include <vector>
2007-06-11 17:21:27 +00:00
# include "CCreatureHandler.h"
2007-07-17 20:51:49 +00:00
# include "SDL.h"
2007-08-30 10:11:53 +00:00
# include "../int3.h"
2007-09-30 16:16:00 +00:00
# include "CAmbarCendamo.h"
2007-10-21 16:52:41 +00:00
# include "../CGameInterface.h"
2007-06-08 14:58:04 +00:00
2007-06-18 12:48:29 +00:00
class CHeroClass ;
2007-09-15 18:04:12 +00:00
class CDefHandler ;
2007-09-30 16:16:00 +00:00
class CGameInfo ;
2007-10-27 19:38:48 +00:00
class CGHeroInstance ;
2007-06-08 14:58:04 +00:00
class CHero
{
public :
std : : string name ;
2007-06-16 13:33:58 +00:00
int ID ;
2007-06-08 14:58:04 +00:00
int low1stack , high1stack , low2stack , high2stack , low3stack , high3stack ; //amount of units; described below
std : : string refType1stack , refType2stack , refType3stack ; //reference names of units appearing in hero's army if he is recruited in tavern
2007-06-09 13:28:03 +00:00
std : : string bonusName , shortBonus , longBonus ; //for special abilities
2007-06-11 17:21:27 +00:00
std : : string biography ; //biography, of course
2007-06-09 18:14:41 +00:00
bool isAllowed ; //true if we can play with this hero (depends on map)
2007-06-18 12:48:29 +00:00
CHeroClass * heroClass ;
2007-07-16 10:03:54 +00:00
EHeroClasses heroType ; //hero class
//bool operator<(CHero& drugi){if (ID < drugi.ID) return true; else return false;}
2007-10-16 22:39:11 +00:00
SDL_Surface * portraitSmall ; //48x32 px
SDL_Surface * portraitLarge ; //58x64 px
2007-06-08 14:58:04 +00:00
} ;
2007-06-18 10:49:06 +00:00
class CHeroClass
{
public :
std : : string name ;
float aggression ;
int initialAttack , initialDefence , initialPower , initialKnowledge ;
int proAttack [ 2 ] ; //probability of gaining attack point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
int proDefence [ 2 ] ; //probability of gaining defence point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
int proPower [ 2 ] ; //probability of gaining power point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
int proKnowledge [ 2 ] ; //probability of gaining knowledge point on levels [0]: 2 - 9; [1]: 10+ (out of 100)
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 15:13:11 +00: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 18:47:23 +00: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 10:49:06 +00:00
} ;
2007-06-08 14:58:04 +00:00
class CHeroHandler
{
public :
2007-10-27 19:38:48 +00:00
std : : vector < CGHeroInstance * > heroInstances ;
2007-07-16 10:03:54 +00:00
std : : vector < CHero * > heroes ; //by�o nodrze
2007-06-18 12:48:29 +00:00
std : : vector < CHeroClass * > heroClasses ;
2007-11-18 22:58:28 +00:00
std : : vector < CDefHandler * > flags1 , flags2 , flags3 , flags4 ; //flags blitted on heroes when ,
2007-11-23 22:33:55 +00:00
CDefHandler * pskillsb , * resources ; //82x93
2008-01-15 18:50:52 +00:00
CDefHandler * un44 ; //many things
2007-11-18 22:58:28 +00:00
std : : vector < std : : string > pskillsn ;
2008-01-27 16:07:27 +00: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 17:48:05 +00:00
unsigned int level ( unsigned int experience ) ;
2008-01-27 16:07:27 +00:00
unsigned int reqExp ( unsigned int level ) ;
2007-06-08 14:58:04 +00:00
void loadHeroes ( ) ;
2007-06-09 13:28:03 +00:00
void loadSpecialAbilities ( ) ;
2007-06-11 17:21:27 +00:00
void loadBiographies ( ) ;
2007-06-18 10:49:06 +00:00
void loadHeroClasses ( ) ;
2007-11-18 22:58:28 +00:00
void loadPortraits ( ) ; //loads also imgs and names of primary skills
2007-07-16 10:03:54 +00:00
void initHeroClasses ( ) ;
2007-07-19 23:38:11 +00:00
~ CHeroHandler ( ) ;
2007-08-15 15:13:11 +00:00
void initTerrainCosts ( ) ;
2007-09-30 16:16:00 +00:00
friend void CAmbarCendamo : : deh3m ( ) ;
friend void initGameState ( CGameInfo * cgi ) ;
2008-01-09 17:21:31 +00:00
//friend class CConsoleHandler;
2007-09-30 16:16:00 +00:00
//friend void CPlayerInterface::heroMoved(const HeroMoveDetails & details); //TODO: wywalic, wstretne!!!
2007-06-08 14:58:04 +00:00
} ;
# endif //CHEROHANDLER_H