1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00
vcmi/hch/CAbilityHandler.cpp
Michał W. Urbańczyk b89c951d09 * version set to 0.62
* almost redone treasure chest
* working gaining levels for heroes (including dialog with skill selection)
* corrected another typo i cr_shots
2008-08-13 00:44:31 +00:00

40 lines
1.0 KiB
C++

#include "../stdafx.h"
#include "CAbilityHandler.h"
#include "../CGameInfo.h"
#include "CGeneralTextHandler.h"
#include "CLodHandler.h"
#include "CDefHandler.h"
void CAbilityHandler::loadAbilities()
{
std::string buf = CGI->bitmaph->getTextFile("SSTRAITS.TXT");
int it=0;
std::string dump;
for(int i=0; i<2; ++i)
{
loadToIt(dump,buf,it,3);
}
for (int i=0; i<SKILL_QUANTITY; i++)
{
CAbility * nab = new CAbility; //new skill, that will be read
nab->infoTexts.resize(3);
loadToIt(nab->name,buf,it,4);
loadToIt(nab->infoTexts[0],buf,it,4);
loadToIt(nab->infoTexts[1],buf,it,4);
loadToIt(nab->infoTexts[2],buf,it,3);
nab->idNumber = abilities.size();
abilities.push_back(nab);
}
abils32 = CDefHandler::giveDef("SECSK32.DEF");
abils44 = CDefHandler::giveDef("SECSKILL.DEF");
abils82 = CDefHandler::giveDef("SECSK82.DEF");
buf = CGI->bitmaph->getTextFile("SKILLLEV.TXT");
it=0;
for(int i=0; i<6; ++i)
{
std::string buffo;
loadToIt(buffo,buf,it,3);
levels.push_back(buffo);
}
}