Summon.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. void adjustAffectedHexes(std::set<BattleHex> & hexes, const Mechanics * m, const Target & spellTarget) const override;
  22. void adjustTargetTypes(std::vector<TargetType> & types) const override;
  23. bool applicable(Problem & problem, const Mechanics * m) const override;
  24. void apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const override;
  25. EffectTarget filterTarget(const Mechanics * m, const EffectTarget & target) const override;
  26. EffectTarget transformTarget(const Mechanics * m, const Target & aimPoint, const Target & spellTarget) const override;
  27. protected:
  28. void serializeJsonEffect(JsonSerializeFormat & handler) override final;
  29. private:
  30. CreatureID creature;
  31. bool permanent = false;
  32. bool exclusive = true;
  33. bool summonByHealth = false;
  34. bool summonSameUnit = false;
  35. };
  36. }
  37. }
  38. VCMI_LIB_NAMESPACE_END