mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Remove more hardcoded immunity handling.
* ANIMATE_DEAD already limited to UNDED * make DEATH_STARE immunties absolute
This commit is contained in:
parent
b6b12ad8f6
commit
afd74ff649
@ -578,7 +578,7 @@
|
||||
"range" : "0"
|
||||
}
|
||||
},
|
||||
"immunity" : {
|
||||
"absoluteImmunity" : {
|
||||
"UNDEAD": true,
|
||||
"NON_LIVING": true
|
||||
},
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user