2025-07-07 17:28:16 +03:00
|
|
|
/*
|
2025-07-08 19:20:13 +03:00
|
|
|
* RemoveObjectEffect.h, part of VCMI engine
|
2025-07-07 17:28:16 +03:00
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
|
2025-07-08 19:20:13 +03:00
|
|
|
#include "AdventureSpellEffect.h"
|
2025-07-07 17:28:16 +03:00
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
2025-07-08 19:20:13 +03:00
|
|
|
class RemoveObjectEffect final : public AdventureSpellRangedEffect
|
2025-07-07 17:28:16 +03:00
|
|
|
{
|
2025-07-08 19:20:13 +03:00
|
|
|
const CSpell * owner;
|
|
|
|
|
std::vector<MapObjectID> removedObjects;
|
|
|
|
|
MetaString failMessage;
|
2025-07-11 15:33:48 +03:00
|
|
|
std::string cursor;
|
2025-07-08 19:20:13 +03:00
|
|
|
|
2025-07-07 17:28:16 +03:00
|
|
|
public:
|
2025-07-08 19:20:13 +03:00
|
|
|
RemoveObjectEffect(const CSpell * s, const JsonNode & config);
|
2025-07-07 17:28:16 +03:00
|
|
|
|
2025-07-13 17:25:26 +03:00
|
|
|
private:
|
2025-07-11 15:33:48 +03:00
|
|
|
bool canBeCastAtImpl(spells::Problem & problem, const IGameInfoCallback * cb, const spells::Caster * caster, const int3 & pos) const final;
|
|
|
|
|
ESpellCastResult applyAdventureEffects(SpellCastEnvironment * env, const AdventureSpellCastParameters & parameters) const final;
|
|
|
|
|
std::string getCursorForTarget(const IGameInfoCallback * cb, const spells::Caster * caster, const int3 & pos) const final;
|
2025-07-07 17:28:16 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|