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

Correct, yet ugly handling of Magic Resistance.

This commit is contained in:
DjWarmonger
2011-05-29 18:28:50 +00:00
parent 5786c26586
commit 936005aa1c
7 changed files with 38 additions and 13 deletions

View File

@ -1905,14 +1905,7 @@ std::vector<ui32> BattleInfo::calculateResistedStacks( const CSpell * sp, const
else
bonusHero = hero2;
int prob = (*it)->valOfBonuses(Bonus::MAGIC_RESISTANCE); //probability of resistance in %
if(bonusHero)
{
//bonusHero's resistance support (secondary skils and artifacts)
prob += bonusHero->valOfBonuses(Bonus::MAGIC_RESISTANCE);
//resistance skill
prob += bonusHero->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, 26) / 100.0f;
}
int prob = (*it)->magicResistance(); //probability of resistance in %
if(prob > 100) prob = 100;