瀏覽代碼

* support for orb of vulnerability
* updated changelog

mateuszb 15 年之前
父節點
當前提交
6541e89f90
共有 2 個文件被更改,包括 25 次插入13 次删除
  1. 9 1
      ChangeLog
  2. 16 12
      server/CGameHandler.cpp

+ 9 - 1
ChangeLog

@@ -2,7 +2,15 @@
 GENERAL:
 * It's possible to start campaign
 * Support for build grail victory condition
-* New artifacts supported: Angel's Wings and Boots of levitation
+* New artifacts supported:
+- Angel's Wings
+- Boots of levitation
+- Orb of Vulnerability
+- Ammo cart
+- Golden Bow
+- Hourglass of Evil Hour
+- Bow of Sharpshooter
+- Armor of the Damned
 
 ADVENTURE MAP:
 * Creatures now guard surrounding tiles

+ 16 - 12
server/CGameHandler.cpp

@@ -3598,18 +3598,22 @@ static std::vector<ui32> calculateResistedStacks(const CSpell * sp, const CGHero
 		if (caster->hasBonusOfType(Bonus::NEGATE_ALL_NATURAL_IMMUNITIES) ||
 			hero2->hasBonusOfType(Bonus::NEGATE_ALL_NATURAL_IMMUNITIES))
 		{
-			//Here we need "source different than" selector
-// 			BonusList bl = (*it)->getBonuses(Selector::sourceNotType(Bonus::CREATURE_ABILITY));
-// 
-// 			BOOST_FOREACH(Bonus bb, bl)
-// 			{
-// 				if(bb.type == Bonus::SPELL_IMMUNITY && bb.subtype == sp->id || //100% sure spell immunity
-// 					bb.type == Bonus::LEVEL_SPELL_IMMUNITY && bb.val >= sp->level) //some creature abilities have level 0
-// 				{
-// 					ret.push_back((*it)->ID);
-// 					continue;
-// 				}
-// 			}
+			//don't use natural immunities when one of heroes has this bonus
+ 			BonusList bl = (*it)->getBonuses(Selector::type(Bonus::SPELL_IMMUNITY)),
+				b2 = (*it)->getBonuses(Selector::type(Bonus::LEVEL_SPELL_IMMUNITY));
+
+			bl.insert(bl.end(), b2.begin(), b2.end());
+ 
+ 			BOOST_FOREACH(Bonus bb, bl)
+ 			{
+ 				if( (bb.type == Bonus::SPELL_IMMUNITY && bb.subtype == sp->id || //100% sure spell immunity
+ 					bb.type == Bonus::LEVEL_SPELL_IMMUNITY && bb.val >= sp->level) //some creature abilities have level 0
+					&& bb.source != Bonus::CREATURE_ABILITY)
+ 				{
+ 					ret.push_back((*it)->ID);
+ 					continue;
+ 				}
+ 			}
 		}
 		else
 		{