From 257be7a9688e1a430c819ece54a027909535b76b Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sun, 28 Jul 2013 10:05:37 +0000 Subject: [PATCH] Fixed #1342. Animate Dead won't affect living creatures. --- config/artifacts.json | 3 ++- config/spell_info.json | 7 ++++--- lib/CSpellHandler.cpp | 7 +++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config/artifacts.json b/config/artifacts.json index a4d1848cd..177e7e57e 100644 --- a/config/artifacts.json +++ b/config/artifacts.json @@ -1325,7 +1325,8 @@ { "type" : "NEGATE_ALL_NATURAL_IMMUNITIES", "val" : 0, - "valueType" : "BASE_NUMBER" + "valueType" : "BASE_NUMBER", + "propagator": "BATTLE_WIDE" } ], "index" : 93, diff --git a/config/spell_info.json b/config/spell_info.json index 2c4a3d369..ca50c3b7e 100644 --- a/config/spell_info.json +++ b/config/spell_info.json @@ -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" : { diff --git a/lib/CSpellHandler.cpp b/lib/CSpellHandler.cpp index be539ad3b..03285ccd6 100644 --- a/lib/CSpellHandler.cpp +++ b/lib/CSpellHandler.cpp @@ -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))