1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/lib/spells/AdventureSpellMechanics.h

91 lines
2.8 KiB
C
Raw Normal View History

2015-02-02 10:40:06 +02:00
/*
* AdventureSpellMechanics.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
2015-02-02 11:22:19 +02:00
#include "ISpellMechanics.h"
2015-02-26 19:59:18 +02:00
enum class ESpellCastResult
{
OK,
CANCEL,//cast failed but it is not an error
ERROR//internal error occurred
};
class DLL_LINKAGE AdventureSpellMechanics: public IAdventureSpellMechanics
{
public:
AdventureSpellMechanics(CSpell * s): IAdventureSpellMechanics(s){};
bool adventureCast(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const override final;
protected:
///actual adventure cast implementation
virtual ESpellCastResult applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const;
};
class DLL_LINKAGE SummonBoatMechanics : public AdventureSpellMechanics
2015-02-02 11:22:19 +02:00
{
public:
SummonBoatMechanics(CSpell * s): AdventureSpellMechanics(s){};
2015-02-02 11:22:19 +02:00
protected:
2015-04-13 05:12:23 +02:00
ESpellCastResult applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const override;
2015-02-02 11:22:19 +02:00
};
class DLL_LINKAGE ScuttleBoatMechanics : public AdventureSpellMechanics
2015-02-02 11:22:19 +02:00
{
public:
ScuttleBoatMechanics(CSpell * s): AdventureSpellMechanics(s){};
2015-02-02 11:22:19 +02:00
protected:
2015-04-13 05:12:23 +02:00
ESpellCastResult applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const override;
2015-02-02 11:22:19 +02:00
};
class DLL_LINKAGE DimensionDoorMechanics : public AdventureSpellMechanics
2015-02-02 11:22:19 +02:00
{
2015-02-26 19:59:18 +02:00
public:
DimensionDoorMechanics(CSpell * s): AdventureSpellMechanics(s){};
2015-02-02 11:22:19 +02:00
protected:
2015-04-13 05:12:23 +02:00
ESpellCastResult applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const override;
2015-02-02 11:22:19 +02:00
};
class DLL_LINKAGE TownPortalMechanics : public AdventureSpellMechanics
2015-02-02 11:22:19 +02:00
{
2015-02-26 19:59:18 +02:00
public:
TownPortalMechanics(CSpell * s): AdventureSpellMechanics(s){};
2015-02-02 11:22:19 +02:00
protected:
2015-04-13 05:12:23 +02:00
ESpellCastResult applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const override;
2015-02-02 11:22:19 +02:00
};
class DLL_LINKAGE ViewMechanics : public AdventureSpellMechanics
{
2015-02-26 19:59:18 +02:00
public:
ViewMechanics(CSpell * s): AdventureSpellMechanics(s){};
protected:
2015-04-13 05:12:23 +02:00
ESpellCastResult applyAdventureEffects(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const override;
virtual bool filterObject(const CGObjectInstance * obj, const int spellLevel) const = 0;
};
class DLL_LINKAGE ViewAirMechanics : public ViewMechanics
{
2015-02-26 19:59:18 +02:00
public:
ViewAirMechanics(CSpell * s): ViewMechanics(s){};
protected:
bool filterObject(const CGObjectInstance * obj, const int spellLevel) const override;
};
class DLL_LINKAGE ViewEarthMechanics : public ViewMechanics
{
2015-02-26 19:59:18 +02:00
public:
ViewEarthMechanics(CSpell * s): ViewMechanics(s){};
protected:
2015-02-26 19:59:18 +02:00
bool filterObject(const CGObjectInstance * obj, const int spellLevel) const override;
};