mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Relaxed cast requirements for Quicksand
This commit is contained in:
parent
8d40a4aa95
commit
dad0569bc7
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user