Teleport.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Teleport.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. struct BattleStackMoved;
  13. namespace spells
  14. {
  15. namespace effects
  16. {
  17. class Teleport : public UnitEffect
  18. {
  19. public:
  20. Teleport();
  21. virtual ~Teleport();
  22. void adjustTargetTypes(std::vector<TargetType> & types) const override;
  23. bool applicable(Problem & problem, const Mechanics * m) const override;
  24. void apply(BattleStateProxy * battleState, RNG & rng, const Mechanics * m, const EffectTarget & target) const override;
  25. EffectTarget transformTarget(const Mechanics * m, const Target & aimPoint, const Target & spellTarget) const override;
  26. protected:
  27. void serializeJsonUnitEffect(JsonSerializeFormat & handler) override;
  28. private:
  29. bool prepareEffects(std::string & errorMessage, BattleStackMoved & pack, const Mechanics * m, const EffectTarget & target) const;
  30. };
  31. }
  32. }