DemonSummon.h 863 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * DemonSummon.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 "UnitEffect.h"
  12. #include "../../GameConstants.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. namespace spells
  15. {
  16. namespace effects
  17. {
  18. class DemonSummon : public UnitEffect
  19. {
  20. public:
  21. void apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const override;
  22. protected:
  23. bool isValidTarget(const Mechanics * m, const battle::Unit * s) const override;
  24. void serializeJsonUnitEffect(JsonSerializeFormat & handler) override final;
  25. private:
  26. int32_t raisedCreatureAmount(const Mechanics * m, const battle::Unit * unit) const;
  27. CreatureID creature;
  28. bool permanent = false;
  29. };
  30. }
  31. }
  32. VCMI_LIB_NAMESPACE_END