1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Support for Death Stare.

Some tweaks are still needed. Level 0 spell-like abilities won't work correctly.
This commit is contained in:
DjWarmonger
2011-04-23 17:10:54 +00:00
parent 61af4c745e
commit 7591d06b05
9 changed files with 92 additions and 13 deletions

View File

@@ -1791,9 +1791,10 @@ SpellCasting::ESpellCastProblem BattleInfo::battleIsImmune(const CGHeroInstance
std::remove_if(immunities.begin(), immunities.end(), NegateRemover);
}
if(subject->hasBonusOfType(Bonus::SPELL_IMMUNITY, spell->id)
|| ( immunities.size() > 0 && immunities.totalValue() >= spell->level))
{
if(subject->hasBonusOfType(Bonus::SPELL_IMMUNITY, spell->id) ||
( immunities.size() > 0 && immunities.totalValue() >= spell->level)
&& spell->level) //many creature abilities have level equal to 0, may cause bugs
{
return SpellCasting::STACK_IMMUNE_TO_SPELL;
}
//dispel helpful spells