浏览代码

Remove more hardcoded immunity handling.
* ANIMATE_DEAD already limited to UNDED
* make DEATH_STARE immunties absolute

AlexVinS 11 年之前
父节点
当前提交
afd74ff649
共有 2 个文件被更改,包括 2 次插入10 次删除
  1. 1 1
      config/spells/ability.json
  2. 1 9
      server/CGameHandler.cpp

+ 1 - 1
config/spells/ability.json

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

+ 1 - 9
server/CGameHandler.cpp

@@ -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