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

VCAI tweaks (#311)

* Add extra priority support for town capture evaluation
* Improve building algorithm
* GatherArmy: check free gold instead of total for when hiring heroes
This commit is contained in:
Dydzio
2017-07-15 00:15:08 +02:00
committed by ArseniyShestakov
parent 98140aab6b
commit 0cb6515ae8
6 changed files with 84 additions and 36 deletions

View File

@@ -866,6 +866,11 @@ void CGHeroInstance::setPropertyDer( ui8 what, ui32 val )
setStackCount(SlotID(0), val);
}
TFaction CGHeroInstance::getFaction() const
{
return type->heroClass->faction;
}
double CGHeroInstance::getFightingStrength() const
{
return sqrt((1.0 + 0.05*getPrimSkillLevel(PrimarySkill::ATTACK)) * (1.0 + 0.05*getPrimSkillLevel(PrimarySkill::DEFENSE)));