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

Implemented rule-based evaluation of tactical advantage between armies.

AI will creep more agressively and smarter.
This commit is contained in:
DjWarmonger
2012-03-04 10:43:46 +00:00
parent c5007f8bef
commit cd0ed39fbf
6 changed files with 620 additions and 388 deletions

View File

@ -1820,15 +1820,15 @@ void CGTownInstance::setPropertyDer(ui8 what, ui32 val)
break;
}
}
int CGTownInstance::fortLevel() const //0 - none, 1 - fort, 2 - citadel, 3 - castle
CGTownInstance::EFortLevel CGTownInstance::fortLevel() const //0 - none, 1 - fort, 2 - citadel, 3 - castle
{
if((builtBuildings.find(9))!=builtBuildings.end())
return 3;
return CASTLE;
if((builtBuildings.find(8))!=builtBuildings.end())
return 2;
return CITADEL;
if((builtBuildings.find(7))!=builtBuildings.end())
return 1;
return 0;
return FORT;
return NONE;
}
int CGTownInstance::hallLevel() const // -1 - none, 0 - village, 1 - town, 2 - city, 3 - capitol