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

Fixed total spell immunity granted by 2212.

Improvements for Life Drain.
This commit is contained in:
DjWarmonger
2011-06-25 15:05:01 +00:00
parent 212bc13ad6
commit 9ca5d9048a
7 changed files with 16 additions and 8 deletions

View File

@ -1782,7 +1782,7 @@ bool BattleInfo::battleTestElementalImmunity(const CStack * subject, const CSpel
{
if (spell->positiveness < 1) //negative or indifferent
{
if (damageSpell && subject->hasBonusOfType(element, 2) || subject->hasBonusOfType(element, 1))
if ((damageSpell && subject->hasBonusOfType(element, 2)) || subject->hasBonusOfType(element, 1))
return true;
}
else if (spell->positiveness == 1) //positive
@ -1806,27 +1806,27 @@ SpellCasting::ESpellCastProblem BattleInfo::battleIsImmune(const CGHeroInstance
bool damageSpell = (VLC->spellh->damageSpells.find(spell->id) != VLC->spellh->damageSpells.end());
if (damageSpell && subject->hasBonusOfType(Bonus::DIRECT_DAMAGE_IMMUNITY));
if (damageSpell && subject->hasBonusOfType(Bonus::DIRECT_DAMAGE_IMMUNITY))
return SpellCasting::STACK_IMMUNE_TO_SPELL;
if (spell->fire)
{
if (battleTestElementalImmunity(subject, spell, Bonus::FIRE_IMMUNITY, damageSpell));
if (battleTestElementalImmunity(subject, spell, Bonus::FIRE_IMMUNITY, damageSpell))
return SpellCasting::STACK_IMMUNE_TO_SPELL;
}
if (spell->water)
{
if (battleTestElementalImmunity(subject, spell, Bonus::WATER_IMMUNITY, damageSpell));
if (battleTestElementalImmunity(subject, spell, Bonus::WATER_IMMUNITY, damageSpell))
return SpellCasting::STACK_IMMUNE_TO_SPELL;
}
if (spell->earth)
{
if (battleTestElementalImmunity(subject, spell, Bonus::EARTH_IMMUNITY, damageSpell));
if (battleTestElementalImmunity(subject, spell, Bonus::EARTH_IMMUNITY, damageSpell))
return SpellCasting::STACK_IMMUNE_TO_SPELL;
}
if (spell->air)
{
if (battleTestElementalImmunity(subject, spell, Bonus::AIR_IMMUNITY, damageSpell));
if (battleTestElementalImmunity(subject, spell, Bonus::AIR_IMMUNITY, damageSpell))
return SpellCasting::STACK_IMMUNE_TO_SPELL;
}