1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-11 01:10:26 +02:00

* a bit more work on campaigns; hero crossover still buggy

This commit is contained in:
mateuszb
2013-02-06 10:16:44 +00:00
parent 1ef205e5f1
commit 3958364884
10 changed files with 100 additions and 32 deletions

View File

@ -1286,7 +1286,7 @@ void CGHeroInstance::setPropertyDer( ui8 what, ui32 val )
double CGHeroInstance::getHeroStrength() const
{
return sqrt((1.0 + 0.05*getPrimSkillLevel(0)) * (1.0 + 0.05*getPrimSkillLevel(1)));
return sqrt((1.0 + 0.05*getPrimSkillLevel(PrimarySkill::ATTACK)) * (1.0 + 0.05*getPrimSkillLevel(PrimarySkill::DEFENSE)));
}
ui64 CGHeroInstance::getTotalStrength() const
@ -4115,9 +4115,9 @@ bool CQuest::checkQuest (const CGHeroInstance * h) const
return true;
return false;
case MISSION_PRIMARY_STAT:
for (int i = 0; i < 4; ++i)
for (int i = 0; i < GameConstants::PRIMARY_SKILLS; ++i)
{
if (h->getPrimSkillLevel(i) < m2stats[i])
if (h->getPrimSkillLevel(static_cast<PrimarySkill::PrimarySkill>(i)) < m2stats[i])
return false;
}
return true;