2015-02-02 10:40:06 +02:00
|
|
|
/*
|
|
|
|
* BattleSpellMechanics.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
2015-02-02 11:22:19 +02:00
|
|
|
|
2015-02-26 19:59:18 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CDefaultSpellMechanics.h"
|
2015-02-02 11:22:19 +02:00
|
|
|
|
|
|
|
class ChainLightningMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
2015-02-26 19:59:18 +02:00
|
|
|
ChainLightningMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
2015-02-02 11:22:19 +02:00
|
|
|
std::set<const CStack *> getAffectedStacks(SpellTargetingContext & ctx) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CloneMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CloneMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
|
|
|
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override;
|
|
|
|
protected:
|
2015-02-26 19:59:18 +02:00
|
|
|
void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CureMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
2015-02-26 19:59:18 +02:00
|
|
|
CureMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
2015-02-02 11:22:19 +02:00
|
|
|
|
2015-02-26 19:59:18 +02:00
|
|
|
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override;
|
|
|
|
};
|
2015-02-02 11:22:19 +02:00
|
|
|
|
|
|
|
class DispellMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DispellMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
2015-02-26 19:59:18 +02:00
|
|
|
|
|
|
|
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class HypnotizeMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
2015-02-26 19:59:18 +02:00
|
|
|
HypnotizeMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
|
|
|
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override;
|
|
|
|
};
|
2015-02-02 11:22:19 +02:00
|
|
|
|
|
|
|
class ObstacleMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
2015-02-26 19:59:18 +02:00
|
|
|
ObstacleMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
2015-02-02 11:22:19 +02:00
|
|
|
|
|
|
|
protected:
|
2015-02-26 19:59:18 +02:00
|
|
|
void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class WallMechanics: public ObstacleMechanics
|
|
|
|
{
|
|
|
|
public:
|
2015-02-26 19:59:18 +02:00
|
|
|
WallMechanics(CSpell * s): ObstacleMechanics(s){};
|
|
|
|
std::vector<BattleHex> rangeInHexes(BattleHex centralHex, ui8 schoolLvl, ui8 side, bool *outDroppedHexes = nullptr) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class RemoveObstacleMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RemoveObstacleMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
|
|
|
protected:
|
2015-02-26 19:59:18 +02:00
|
|
|
void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
///all rising spells
|
|
|
|
class RisingSpellMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
2015-02-26 19:59:18 +02:00
|
|
|
RisingSpellMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
|
|
|
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SacrificeMechanics: public RisingSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
2015-02-26 19:59:18 +02:00
|
|
|
SacrificeMechanics(CSpell * s): RisingSpellMechanics(s){};
|
2015-02-02 11:22:19 +02:00
|
|
|
protected:
|
2015-02-26 19:59:18 +02:00
|
|
|
void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
///all rising spells but SACRIFICE
|
|
|
|
class SpecialRisingSpellMechanics: public RisingSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SpecialRisingSpellMechanics(CSpell * s): RisingSpellMechanics(s){};
|
2015-02-26 19:59:18 +02:00
|
|
|
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SummonMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SummonMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
|
|
|
protected:
|
2015-02-26 19:59:18 +02:00
|
|
|
void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class TeleportMechanics: public DefaultSpellMechanics
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TeleportMechanics(CSpell * s): DefaultSpellMechanics(s){};
|
|
|
|
protected:
|
2015-02-26 19:59:18 +02:00
|
|
|
void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
2015-02-02 11:22:19 +02:00
|
|
|
};
|