From dad0569bc798ff8f6ff8ea9e878b2cd8ba444c43 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Mon, 31 Oct 2016 15:38:53 +0300 Subject: [PATCH] Relaxed cast requirements for Quicksand --- lib/spells/BattleSpellMechanics.cpp | 6 +++--- lib/spells/BattleSpellMechanics.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/spells/BattleSpellMechanics.cpp b/lib/spells/BattleSpellMechanics.cpp index e20c52fec..f9ccdc43a 100644 --- a/lib/spells/BattleSpellMechanics.cpp +++ b/lib/spells/BattleSpellMechanics.cpp @@ -492,9 +492,10 @@ void PatchObstacleMechanics::applyBattleEffects(const SpellCastEnvironment * env placeObstacle(env, parameters, availableTiles.at(i)); } -ESpellCastProblem::ESpellCastProblem PatchObstacleMechanics::canBeCast(const CBattleInfoCallback * cb, const ECastingMode::ECastingMode mode, const ISpellCaster * caster) const +///LandMineMechanics +ESpellCastProblem::ESpellCastProblem LandMineMechanics::canBeCast(const CBattleInfoCallback * cb, const ECastingMode::ECastingMode mode, const ISpellCaster * caster) const { - //Quicksand|LandMine are useless if enemy has native stack, check for LandMine damage immunity is done in general way by CSpell + //LandMine are useless if enemy has native stack and can see mines, check for LandMine damage immunity is done in general way by CSpell const ui8 otherSide = !cb->playerToSide(caster->getOwner()); if(cb->battleHasNativeStack(otherSide)) @@ -503,7 +504,6 @@ ESpellCastProblem::ESpellCastProblem PatchObstacleMechanics::canBeCast(const CBa return DefaultSpellMechanics::canBeCast(cb, mode, caster); } -///LandMineMechanics bool LandMineMechanics::requiresCreatureTarget() const { return true; diff --git a/lib/spells/BattleSpellMechanics.h b/lib/spells/BattleSpellMechanics.h index b6600b364..056385d75 100644 --- a/lib/spells/BattleSpellMechanics.h +++ b/lib/spells/BattleSpellMechanics.h @@ -113,7 +113,6 @@ class PatchObstacleMechanics : public ObstacleMechanics { public: PatchObstacleMechanics(CSpell * s): ObstacleMechanics(s){}; - ESpellCastProblem::ESpellCastProblem canBeCast(const CBattleInfoCallback * cb, const ECastingMode::ECastingMode mode, const ISpellCaster * caster) const override; protected: void applyBattleEffects(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override; }; @@ -122,6 +121,7 @@ class DLL_LINKAGE LandMineMechanics : public PatchObstacleMechanics { public: LandMineMechanics(CSpell * s): PatchObstacleMechanics(s){}; + ESpellCastProblem::ESpellCastProblem canBeCast(const CBattleInfoCallback * cb, const ECastingMode::ECastingMode mode, const ISpellCaster * caster) const override; bool requiresCreatureTarget() const override; protected: void setupObstacle(SpellCreatedObstacle * obstacle) const override;