1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Remove more hardcoded immunity handling.

* ANIMATE_DEAD already limited to UNDED
* make DEATH_STARE immunties absolute
This commit is contained in:
AlexVinS 2014-05-18 14:42:24 +04:00
parent b6b12ad8f6
commit afd74ff649
2 changed files with 2 additions and 10 deletions

View File

@ -578,7 +578,7 @@
"range" : "0"
}
},
"immunity" : {
"absoluteImmunity" : {
"UNDEAD": true,
"NON_LIVING": true
},

View File

@ -4231,9 +4231,7 @@ void CGameHandler::handleSpellCasting( SpellID spellID, int spellLvl, BattleHex
shr.tentHealing = (ui8)false;
for(auto & attackedCre : attackedCres)
{
if(vstd::contains(sc.resisted, (attackedCre)->ID) //this creature resisted the spell
|| (spellID == SpellID::ANIMATE_DEAD && !(attackedCre)->hasBonusOfType(Bonus::UNDEAD)) //we try to cast animate dead on living stack, TODO: showuld be not affected earlier
)
if(vstd::contains(sc.resisted, (attackedCre)->ID)) //this creature resisted the spell
continue;
StacksHealedOrResurrected::HealInfo hi;
hi.stackID = (attackedCre)->ID;
@ -4411,12 +4409,6 @@ void CGameHandler::handleSpellCasting( SpellID spellID, int spellLvl, BattleHex
{
for(auto & attackedCre : attackedCres)
{
if((attackedCre)->hasBonusOfType(Bonus::UNDEAD) || (attackedCre)->hasBonusOfType(Bonus::NON_LIVING)) //this creature is immune
{
sc.dmgToDisplay = 0; //TODO: handle Death Stare for multiple targets (?)
continue;
}
BattleStackAttacked bsa;
bsa.flags |= BattleStackAttacked::EFFECT;
bsa.effect = spell->mainEffectAnim; //from config\spell-Info.txt