1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

* hints for cregens

* moved battle loop to the activeStack
This commit is contained in:
Michał W. Urbańczyk
2008-02-29 22:14:53 +00:00
parent 8c0536be8e
commit 17d5d298ca
11 changed files with 72 additions and 14 deletions

View File

@@ -647,13 +647,13 @@ void CHeroScript::onHeroVisit(CGObjectInstance *os, int heroID)
std::vector<int> CHeroScript::yourObjects() //returns IDs of objects which are handled by script
{
std::vector<int> ret(1);
ret.push_back(34); //town
ret.push_back(34); //hero
return ret;
}
void CMonsterS::newObject(CGObjectInstance *os)
{
os->blockVisit = true;
//os->blockVisit = true;
switch(CGI->creh->creatures[os->subID].level)
{
case 1:
@@ -694,18 +694,37 @@ std::string CMonsterS::hoverText(CGObjectInstance *os)
{
int pom = CCreature::getQuantityID(((CCreatureObjInfo*)os->info)->number);
pom = 174 + 3*pom + 1;
return CGI->generaltexth->arraytxt[pom] + CGI->creh->creatures[os->subID].namePl;
return CGI->generaltexth->arraytxt[pom] + " " + CGI->creh->creatures[os->subID].namePl;
}
void CMonsterS::onHeroVisit(CGObjectInstance *os, int heroID)
{
CCreatureSet set;
//TODO: zrobic secik w sposob wyrafinowany
set.slots[0] = std::pair<CCreature*,int>(&CGI->creh->creatures[os->subID],((CCreatureObjInfo*)os->info)->number);
//cb->startBattle(heroID,&set,os->pos);
cb->startBattle(heroID,&set,os->pos);
}
std::vector<int> CMonsterS::yourObjects() //returns IDs of objects which are handled by script
{
std::vector<int> ret(1);
ret.push_back(54); //town
ret.push_back(54); //monster
return ret;
}
void CCreatureGen::newObject(CGObjectInstance *os)
{
amount[os] = CGI->creh->creatures[CGI->objh->cregens[os->subID]].growth;
}
std::string CCreatureGen::hoverText(CGObjectInstance *os)
{
return CGI->objh->creGens[os->subID];
}
void CCreatureGen::onHeroVisit(CGObjectInstance *os, int heroID)
{
}
std::vector<int> CCreatureGen::yourObjects() //returns IDs of objects which are handled by script
{
std::vector<int> ret(1);
ret.push_back(17); //cregen1
return ret;
}