1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00
This commit is contained in:
AlexVinS
2018-02-20 14:29:06 +03:00
parent 2b49df2cab
commit 6d8536b12a

View File

@@ -853,12 +853,15 @@ int64_t CGHeroInstance::getSpellBonus(const spells::Spell * spell, int64_t base,
base *= (100.0 + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::SORCERY)) / 100.0; base *= (100.0 + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::SORCERY)) / 100.0;
base *= (100.0 + valOfBonuses(Bonus::SPELL_DAMAGE) + valOfBonuses(Bonus::SPECIFIC_SPELL_DAMAGE, spell->getIndex())) / 100.0; base *= (100.0 + valOfBonuses(Bonus::SPELL_DAMAGE) + valOfBonuses(Bonus::SPECIFIC_SPELL_DAMAGE, spell->getIndex())) / 100.0;
spell->forEachSchool([&base, this](const spells::SchoolInfo & cnf, bool & stop) int maxSchoolBonus = 0;
spell->forEachSchool([&maxSchoolBonus, this](const spells::SchoolInfo & cnf, bool & stop)
{ {
base *= (100.0 + valOfBonuses(cnf.damagePremyBonus)) / 100.0; vstd::amax(maxSchoolBonus, valOfBonuses(cnf.damagePremyBonus));
stop = true; //only bonus from one school is used
}); });
base *= (100.0 + maxSchoolBonus) / 100.0;
if(affectedStack && affectedStack->creatureLevel() > 0) //Hero specials like Solmyr, Deemer if(affectedStack && affectedStack->creatureLevel() > 0) //Hero specials like Solmyr, Deemer
base *= (100. + ((valOfBonuses(Bonus::SPECIAL_SPELL_LEV, spell->getIndex()) * level) / affectedStack->creatureLevel())) / 100.0; base *= (100. + ((valOfBonuses(Bonus::SPECIAL_SPELL_LEV, spell->getIndex()) * level) / affectedStack->creatureLevel())) / 100.0;