1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/CHeroHandler.h
Michał W. Urbańczyk 0ea7a46309 * new files (CAdvmapInterface.h and CAdvmapInterface.cpp)
* more player interface (but it's still beginning)
* int3 members public
* more usage of int3
* adjusted animation speed
* reversed changes from rev.165 in CPreGame - it wasn't bug, it just works so. That change was breaking a few things in CPreGame and was needless - Player ID == Player's Color. I thought it was obvious.
* minor stuff
2007-08-03 21:47:34 +00:00

75 lines
2.4 KiB
C++

#ifndef CHEROHANDLER_H
#define CHEROHANDLER_H
#include <string>
#include <vector>
#include "CCreatureHandler.h"
#include "SDL.h"
#include "int3.h"
class CHeroClass;
class CHero
{
public:
std::string name;
int ID;
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
std::string bonusName, shortBonus, longBonus; //for special abilities
std::string biography; //biography, of course
bool isAllowed; //true if we can play with this hero (depends on map)
CHeroClass * heroClass;
EHeroClasses heroType; //hero class
//bool operator<(CHero& drugi){if (ID < drugi.ID) return true; else return false;}
SDL_Surface * portraitSmall; //48x32 p
};
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
};
class CHeroInstance
{
public:
int owner;
CHero type;
int exp; //experience point
int level; //current level of hero
std::string name; //may be custom
std::string biography; //may be custom
int portrait; //may be custom
int3 pos; //position on adventure map
CCreatureSet army; //army
int mana; // remaining spell points
int movement; //remaining movement points
//TODO: artifacts, primary and secondary skills, known spells, commander, blessings, curses, morale/luck special modifiers
};
class CHeroHandler
{
public:
std::vector<CHero*> heroes; //by�o nodrze
std::vector<CHeroClass *> heroClasses;
void loadHeroes();
void loadSpecialAbilities();
void loadBiographies();
void loadHeroClasses();
void loadPortraits();
void initHeroClasses();
~CHeroHandler();
};
#endif //CHEROHANDLER_H