1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
vcmi/hch/CCreatureHandler.h
Michał W. Urbańczyk 4cca2da9c0 * added #38
* CDefEssential is now useful
* initGameState shouldn't overwrite starting armies
* loading more graphics (small creature icons, large hero portraits)
* functions for getting current valueof morale/luck (unfinished)
* added in CLodHandler function that returns CDefEssential with images from desired .def
* copySurface works correctly (I hope)
2007-10-16 22:39:11 +00:00

56 lines
2.0 KiB
C++

#ifndef CCREATUREHANDLER_H
#define CCREATUREHANDLER_H
#include <string>
#include <vector>
#include <map>
#include "CDefHandler.h"
class CCreature
{
public:
std::string namePl, nameSing, nameRef; //name in singular and plural form; and reference name
int wood, mercury, ore, sulfur, crystal, gems, gold, fightValue, AIValue, growth, hordeGrowth, hitPoints, speed, attack, defence, shots, spells;
int low1, low2, high1, high2; //TODO - co to w ogóle jest???
std::string abilityText; //description of abilities
std::string abilityRefs; //references to abilities, in textformat
int idNumber;
///animation info
float timeBetweenFidgets, walkAnimationTime, attackAnimationTime, flightAnimationDistance;
int upperRightMissleOffsetX, rightMissleOffsetX, lowerRightMissleOffsetX, upperRightMissleOffsetY, rightMissleOffsetY, lowerRightMissleOffsetY;
float missleFrameAngles[12];
int troopCountLocationOffset, attackClimaxFrame;
///end of anim info
//for some types of towns
bool isDefinite; //if the creature type is wotn dependent, it should be true
int indefLevel; //only if indefinite
bool indefUpgraded; //onlu if inddefinite
//end
CDefHandler * battleAnimation;
//TODO - zdolnoœci - na typie wyliczeniowym czy czymœ
};
class CCreatureSet //seven combined creatures
{
public:
std::map<int,std::pair<CCreature*,int> > slots;
//CCreature * slot1, * slot2, * slot3, * slot4, * slot5, * slot6, * slot7; //types of creatures on each slot
//unsigned int s1, s2, s3, s4, s5, s6, s7; //amounts of units in slots
bool formation; //false - wide, true - tight
};
class CCreatureHandler
{
public:
std::map<int,SDL_Surface*> smallImgs; //creature ID -> small 32x32 img of creature; //ID=-2 is for blank (black) img; -1 for the border
std::vector<CCreature> creatures;
std::map<std::string,int> nameToID;
void loadCreatures();
void loadAnimationInfo();
void loadUnitAnimInfo(CCreature & unit, std::string & src, int & i);
void loadUnitAnimations();
};
#endif //CCREATUREHANDLER_H