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

Version set to 0.83c, to be released as development build.

Code reorganizations in bonus system, allowing defining bonusNode-like classes.
Fixed some issues with artifact handling (proper updating of GUI when moving, minor fixes). 
Restoring battle AI for neutrals after loading game.
This commit is contained in:
Michał W. Urbańczyk
2011-02-27 19:58:14 +00:00
parent d7b586f1fd
commit 03fdd22b1a
13 changed files with 319 additions and 250 deletions

View File

@ -622,30 +622,11 @@ int3 CGHeroInstance::getPosition(bool h3m) const //h3m=true - returns position o
}
}
si32 CGHeroInstance::manaLimit() const
{
return si32(getPrimSkillLevel(3) * (100.0f + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, 24)) / 10.0f);
}
//void CGHeroInstance::setPosition(int3 Pos, bool h3m) //as above, but sets position
//{
// if (h3m)
// pos = Pos;
// else
// pos = convertPosition(Pos,true);
//}
bool CGHeroInstance::canWalkOnSea() const
{
return hasBonusOfType(Bonus::FLYING_MOVEMENT) || hasBonusOfType(Bonus::WATER_WALKING);
}
int CGHeroInstance::getPrimSkillLevel(int id) const
{
int ret = valOfBonuses(Bonus::PRIMARY_SKILL, id);
amax(ret, id/2); //minimal value is 0 for attack and defense and 1 for spell power and knowledge
return ret;
}
ui8 CGHeroInstance::getSecSkillLevel(SecondarySkill skill) const
{
for(size_t i=0; i < secSkills.size(); ++i)