Bläddra i källkod

DISPELL should ignore all immunities

AlexVinS 10 år sedan
förälder
incheckning
1747b5af9a
2 ändrade filer med 7 tillägg och 1 borttagningar
  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;
 	return ESpellCastProblem::NO_APPROPRIATE_TARGET;
 }
 }
 
 
+ESpellCastProblem::ESpellCastProblem DispellMechanics::isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const
+{
+	//DISPELL ignores all immunities
+	return ESpellCastProblem::OK;
+}
 
 
 ///EarthquakeMechanics
 ///EarthquakeMechanics
 void EarthquakeMechanics::applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const
 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:
 public:
 	DispellMechanics(CSpell * s): DefaultSpellMechanics(s){};
 	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;
 	void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override final;
 	ESpellCastProblem::ESpellCastProblem canBeCasted(const CBattleInfoCallback * cb, PlayerColor player) const override;	
 	ESpellCastProblem::ESpellCastProblem canBeCasted(const CBattleInfoCallback * cb, PlayerColor player) const override;	
 };
 };