1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fixed #1342. Animate Dead won't affect living creatures.

This commit is contained in:
DjWarmonger 2013-07-28 10:05:37 +00:00
parent abaa5b1c59
commit 257be7a968
3 changed files with 9 additions and 8 deletions

View File

@ -1325,7 +1325,8 @@
{
"type" : "NEGATE_ALL_NATURAL_IMMUNITIES",
"val" : 0,
"valueType" : "BASE_NUMBER"
"valueType" : "BASE_NUMBER",
"propagator": "BATTLE_WIDE"
}
],
"index" : 93,

View File

@ -430,8 +430,8 @@
"effect": 1,
"anim": 79,
"ranges": [ "0", "0", "0", "0" ],
"flags" : ["rising"]
//TODO: immunity for living creatures
"flags" : ["rising"],
"limit":["UNDEAD"]
},
"sacrifice" :
{
@ -439,7 +439,8 @@
"effect": 1,
"anim": 79,
"ranges": [ "0", "0", "0", "0" ],
"flags" : ["rising"]
"flags" : ["rising"],
"immunity":["UNDEAD", "NON_LIVING"]
},
"bless" :
{

View File

@ -281,6 +281,9 @@ bool CSpell::isImmuneBy(const IBonusBearer* obj) const
return true;
}
if (obj->hasBonusOfType(Bonus::NEGATE_ALL_NATURAL_IMMUNITIES)) //Orb of vulnerability
return false; //TODO: some creaures are unaffected always, for example undead to resurrection.
for(auto b : immunities)
{
if (obj->hasBonusOfType(b))
@ -322,10 +325,6 @@ bool CSpell::isImmuneBy(const IBonusBearer* obj) const
}
TBonusListPtr levelImmunities = obj->getBonuses(Selector::type(Bonus::LEVEL_SPELL_IMMUNITY));
if(obj->hasBonusOfType(Bonus::NEGATE_ALL_NATURAL_IMMUNITIES))
{
levelImmunities->remove_if([](const Bonus* b){ return b->source == Bonus::CREATURE_ABILITY; });
}
if(obj->hasBonusOfType(Bonus::SPELL_IMMUNITY, id)
|| ( levelImmunities->size() > 0 && levelImmunities->totalValue() >= level && level))