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

vcmi: replace school bonuses to unified ones

Except immunity now
This commit is contained in:
Konstantin P
2023-05-05 17:56:04 +03:00
parent 8764765dcf
commit 9e1cdc410f
9 changed files with 106 additions and 64 deletions

View File

@@ -619,7 +619,7 @@ int64_t CGHeroInstance::getSpellBonus(const spells::Spell * spell, int64_t base,
spell->forEachSchool([&maxSchoolBonus, this](const spells::SchoolInfo & cnf, bool & stop)
{
vstd::amax(maxSchoolBonus, valOfBonuses(cnf.damagePremyBonus));
vstd::amax(maxSchoolBonus, valOfBonuses(BonusType::SPELL_DAMAGE, vstd::to_underlying(cnf.id)));
});
base = static_cast<int64_t>(base * (100 + maxSchoolBonus) / 100.0);
@@ -708,7 +708,7 @@ bool CGHeroInstance::canCastThisSpell(const spells::Spell * spell) const
spell->forEachSchool([this, &schoolBonus](const spells::SchoolInfo & cnf, bool & stop)
{
if(hasBonusOfType(cnf.knoledgeBonus))
if(hasBonusOfType(BonusType::SPELLS_OF_SCHOOL, vstd::to_underlying(cnf.id)))
{
schoolBonus = stop = true;
}