SummonBoatEffect.h 916 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * SummonBoatEffect.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "AdventureSpellEffect.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class DLL_LINKAGE SummonBoatEffect final : public IAdventureSpellEffect
  14. {
  15. const CSpell * owner;
  16. BoatId createdBoat = BoatId::NONE;
  17. bool useExistingBoat;
  18. public:
  19. SummonBoatEffect(const CSpell * s, const JsonNode & config);
  20. bool canCreateNewBoat() const;
  21. int getSuccessChance(const spells::Caster * caster) const;
  22. private:
  23. bool canBeCastImpl(spells::Problem & problem, const IGameInfoCallback * cb, const spells::Caster * caster) const final;
  24. ESpellCastResult applyAdventureEffects(SpellCastEnvironment * env, const AdventureSpellCastParameters & parameters) const final;
  25. };
  26. VCMI_LIB_NAMESPACE_END