1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Added trivial fuzzy logic to handle creature banks estimation.

Check http://forum.vcmi.eu/viewtopic.php?p=6570#6570 for new library used.
This commit is contained in:
DjWarmonger
2012-03-03 10:08:01 +00:00
parent ebfbccdd0e
commit 998d8bf501
6 changed files with 231 additions and 79 deletions

View File

@ -190,6 +190,25 @@ void CObjectHandler::loadObjects()
tlog5 << "\t\tDone loading banks configs \n";
}
int CObjectHandler::bankObjToIndex (const CGObjectInstance * obj)
{
switch (obj->ID) //find apriopriate key
{
case 16: //bank
return obj->subID;
case 24: //derelict ship
return 8;
case 25: //utopia
return 10;
case 84: //crypt
return 9;
case 85: //shipwreck
return 7;
default:
tlog2 << "Unrecognixed Bank indetifier!\n";
return 0;
}
}
int CGObjectInstance::getOwner() const
{
//if (state)
@ -5688,19 +5707,7 @@ void CGOnceVisitable::searchTomb(const CGHeroInstance *h, ui32 accept) const
void CBank::initObj()
{
switch (ID) //find apriopriate key
{
case 16: //bank
index = subID; break;
case 24: //derelict ship
index = 8; break;
case 25: //utopia
index = 10; break;
case 84: //crypt
index = 9; break;
case 85: //shipwreck
index = 7; break;
}
index = VLC->objh->bankObjToIndex(this);
bc = NULL;
daycounter = 0;
multiplier = 1;