mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
3d1a84875e
* Moved SUMMON_BOAT special case to mechanics * Partially moved Town portal logic to mechanics class * Added generic query reply to CCallback * Redesigned Queries so that base API do not depends on CGameHandler * Got rid of CGameHandler::castSpellRequest * Removed CGameHandler::castSpell * Added new Query type for town portal dialog (not used yet)
42 lines
1.4 KiB
C++
42 lines
1.4 KiB
C++
/*
|
|
* CreatureSpellMechanics.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
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "ISpellMechanics.h"
|
|
#include "CDefaultSpellMechanics.h"
|
|
|
|
class DLL_LINKAGE AcidBreathDamageMechanics : public DefaultSpellMechanics
|
|
{
|
|
public:
|
|
AcidBreathDamageMechanics(const CSpell * s);
|
|
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const ISpellCaster * caster, const CStack * obj) const override;
|
|
protected:
|
|
void applyBattleEffects(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
|
};
|
|
|
|
class DLL_LINKAGE DeathStareMechanics : public DefaultSpellMechanics
|
|
{
|
|
public:
|
|
DeathStareMechanics(const CSpell * s);
|
|
protected:
|
|
void applyBattleEffects(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters, SpellCastContext & ctx) const override;
|
|
};
|
|
|
|
class DLL_LINKAGE DispellHelpfulMechanics : public DefaultSpellMechanics
|
|
{
|
|
public:
|
|
DispellHelpfulMechanics(const CSpell * s);
|
|
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override final;
|
|
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const ISpellCaster * caster, const CStack * obj) const override;
|
|
private:
|
|
static bool positiveSpellEffects(const Bonus * b);
|
|
};
|