2
0
Эх сурвалжийг харах

DISPELL should ignore all immunities

AlexVinS 10 жил өмнө
parent
commit
1747b5af9a

+ 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;	
 };