1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

kilka drobnych poprawek

This commit is contained in:
mateuszb 2007-06-18 12:48:29 +00:00
parent bc7532e4dd
commit 14715a22c8
2 changed files with 106 additions and 2 deletions

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "CHeroHandler.h"
#include "CGameInfo.h"
void CHeroHandler::loadHeroes()
{
@ -23,6 +24,7 @@ void CHeroHandler::loadHeroes()
{
loadSpecialAbilities();
loadBiographies();
loadHeroClasses();
return;
}
while(base[iit]!='\t')
@ -263,6 +265,105 @@ void CHeroHandler::loadHeroClasses()
hc->initialKnowledge = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proAttack[0] = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proDefence[0] = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proPower[0] = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proKnowledge[0] = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proAttack[1] = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proDefence[1] = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proPower[1] = atoi(buf.substr(befi, i-befi).c_str());
++i;
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
hc->proKnowledge[1] = atoi(buf.substr(befi, i-befi).c_str());
++i;
CHero kkk = heroes[0];
for(int dd=0; dd<CGameInfo::mainObj->abilh->abilities.size(); ++dd)
{
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t')
break;
}
int buff = atoi(buf.substr(befi, i-befi).c_str());
++i;
hc->proSec.push_back(buff);
}
for(int dd=0; dd<9; ++dd)
{
befi=i;
for(i; i<andame; ++i)
{
if(buf[i]=='\t' || buf[i]=='\r')
break;
}
hc->selectionProbability[dd] = atoi(buf.substr(befi, i-befi).c_str());
++i;
}
++i;
heroClasses.push_back(hc);
}
}

View File

@ -6,6 +6,8 @@
#include "CCreatureHandler.h"
#include "nodrze.h"
class CHeroClass;
class CHero
{
public:
@ -16,6 +18,7 @@ public:
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;
bool operator<(CHero& drugi){if (ID < drugi.ID) return true; else return false;}
};
@ -45,8 +48,8 @@ public:
class CHeroHandler
{
public:
nodrze<CHero> heroes;
std::vector<CHeroClass> heroClasses;
nodrze<CHero> heroes; //by³o nodrze
std::vector<CHeroClass *> heroClasses;
void loadHeroes();
void loadSpecialAbilities();
void loadBiographies();