1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

First attempt to replace rule-of-a-thumb behavior with actual reasoning

- GATHER_ARMY goal replaces wander function
- Heroes will remember their own goals until they are fulfilled
- Goal search handles mutual dependency
- AI will recruit multiple heroes for exploration
- Lots of tweaks
This commit is contained in:
DjWarmonger
2012-03-13 12:47:47 +00:00
parent f2f39f1497
commit 9518474ec7
5 changed files with 543 additions and 470 deletions

View File

@ -2889,7 +2889,7 @@ bool CGameHandler::hireHero(const CGObjectInstance *obj, ui8 hid, ui8 player)
//common preconditions
if( (p->resources[Res::GOLD]<2500 && complain("Not enough gold for buying hero!"))
|| (getHeroCount(player, false) >= 8 && complain("Cannot hire hero, only 8 wandering heroes are allowed!")))
|| (getHeroCount(player, false) >= GameConstants::MAX_HEROES_PER_PLAYER && complain("Cannot hire hero, only 8 wandering heroes are allowed!")))
return false;
if(t) //tavern in town