Heal.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Heal.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. struct BattleUnitsChanged;
  14. namespace spells
  15. {
  16. namespace effects
  17. {
  18. class Heal : public UnitEffect
  19. {
  20. public:
  21. Heal();
  22. virtual ~Heal();
  23. void apply(BattleStateProxy * battleState, RNG & rng, const Mechanics * m, const EffectTarget & target) const override;
  24. protected:
  25. void apply(int64_t value, BattleStateProxy * battleState, RNG & rng, const Mechanics * m, const EffectTarget & target) const;
  26. bool isValidTarget(const Mechanics * m, const battle::Unit * unit) const override;
  27. void serializeJsonUnitEffect(JsonSerializeFormat & handler) override final;
  28. private:
  29. EHealLevel healLevel;
  30. EHealPower healPower;
  31. int32_t minFullUnits;
  32. void prepareHealEffect(int64_t value, BattleUnitsChanged & pack, RNG & rng, const Mechanics * m, const EffectTarget & target) const;
  33. };
  34. }
  35. }