浏览代码

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

DjWarmonger 12 年之前
父节点
当前提交
257be7a968
共有 3 个文件被更改,包括 9 次插入8 次删除
  1. 2 1
      config/artifacts.json
  2. 4 3
      config/spell_info.json
  3. 3 4
      lib/CSpellHandler.cpp

+ 2 - 1
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,

+ 4 - 3
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"          :
 		{

+ 3 - 4
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))