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:
29
CLua.cpp
29
CLua.cpp
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user