Summon.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Summon.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 "Effect.h"
  12. #include "../../GameConstants.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. namespace spells
  15. {
  16. namespace effects
  17. {
  18. class Summon : public Effect
  19. {
  20. public:
  21. Summon();
  22. virtual ~Summon();
  23. void adjustAffectedHexes(std::set<BattleHex> & hexes, const Mechanics * m, const Target & spellTarget) const override;
  24. void adjustTargetTypes(std::vector<TargetType> & types) const override;
  25. bool applicable(Problem & problem, const Mechanics * m) const override;
  26. void apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const override;
  27. EffectTarget filterTarget(const Mechanics * m, const EffectTarget & target) const override;
  28. EffectTarget transformTarget(const Mechanics * m, const Target & aimPoint, const Target & spellTarget) const override;
  29. protected:
  30. void serializeJsonEffect(JsonSerializeFormat & handler) override final;
  31. private:
  32. CreatureID creature;
  33. bool permanent;
  34. bool exclusive;
  35. bool summonByHealth;
  36. bool summonSameUnit;
  37. };
  38. }
  39. }
  40. VCMI_LIB_NAMESPACE_END