浏览代码

DISPELL should ignore all immunities

AlexVinS 10 年之前
父节点
当前提交
1747b5af9a
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 5 0
      lib/spells/BattleSpellMechanics.cpp
  2. 2 1
      lib/spells/BattleSpellMechanics.h

+ 5 - 0
lib/spells/BattleSpellMechanics.cpp

@@ -170,6 +170,11 @@ ESpellCastProblem::ESpellCastProblem DispellMechanics::canBeCasted(const CBattle
 	return ESpellCastProblem::NO_APPROPRIATE_TARGET;
 }
 
+ESpellCastProblem::ESpellCastProblem DispellMechanics::isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const
+{
+	//DISPELL ignores all immunities
+	return ESpellCastProblem::OK;
+}
 
 ///EarthquakeMechanics
 void EarthquakeMechanics::applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const

+ 2 - 1
lib/spells/BattleSpellMechanics.h

@@ -40,7 +40,8 @@ class DLL_LINKAGE DispellMechanics : public DefaultSpellMechanics
 {
 public:
 	DispellMechanics(CSpell * s): DefaultSpellMechanics(s){};
-
+	ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override;
+	
 	void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override final;
 	ESpellCastProblem::ESpellCastProblem canBeCasted(const CBattleInfoCallback * cb, PlayerColor player) const override;	
 };