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

CSpell: !isMagical() -> no sorcery and no generic spell dmg reduction

Other bonus are still applied.
This commit is contained in:
Konstantin 2023-03-21 12:24:48 +03:00
parent a639bd2606
commit 3bbff0588d
2 changed files with 5 additions and 3 deletions

View File

@ -603,7 +603,9 @@ int64_t CGHeroInstance::getSpellBonus(const spells::Spell * spell, int64_t base,
{
//applying sorcery secondary skill
base = static_cast<int64_t>(base * (valOfBonuses(Bonus::SPELL_DAMAGE)) / 100.0);
if(spell->isMagical())
base = static_cast<int64_t>(base * (valOfBonuses(Bonus::SPELL_DAMAGE)) / 100.0);
base = static_cast<int64_t>(base * (100 + valOfBonuses(Bonus::SPECIFIC_SPELL_DAMAGE, spell->getIndex())) / 100.0);
int maxSchoolBonus = 0;

View File

@ -403,8 +403,8 @@ int64_t CSpell::adjustRawDamage(const spells::Caster * caster, const battle::Uni
CSelector selector = Selector::type()(Bonus::SPELL_DAMAGE_REDUCTION).And(Selector::subtype()(-1));
//general spell dmg reduction
if(bearer->hasBonus(selector))
//general spell dmg reduction, works only on magical effects
if(bearer->hasBonus(selector) && isMagical())
{
ret *= 100 - bearer->valOfBonuses(selector);
ret /= 100;