Summon.h 1.2 KB

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