2
0

AdventureSpellCastMovementActions.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * AdventureSpellCastMovementActions.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 "SpecialAction.h"
  12. #include "../../../../lib/mapObjects/MapObjects.h"
  13. namespace NKAI
  14. {
  15. namespace AIPathfinding
  16. {
  17. class AdventureCastAction : public SpecialAction
  18. {
  19. private:
  20. SpellID spellToCast;
  21. const CGHeroInstance * hero;
  22. int manaCost;
  23. DayFlags flagsToAdd;
  24. public:
  25. AdventureCastAction(SpellID spellToCast, const CGHeroInstance * hero, DayFlags flagsToAdd = DayFlags::NONE);
  26. void execute(AIGateway * ai, const CGHeroInstance * hero) const override;
  27. virtual void applyOnDestination(
  28. const CGHeroInstance * hero,
  29. CDestinationNodeInfo & destination,
  30. const PathNodeInfo & source,
  31. AIPathNode * dstMode,
  32. const AIPathNode * srcNode) const override;
  33. bool canAct(const Nullkiller * ai, const AIPathNode * source) const override;
  34. std::string toString() const override;
  35. };
  36. class WaterWalkingAction : public AdventureCastAction
  37. {
  38. SpellID spellToCast;
  39. public:
  40. WaterWalkingAction(const CGHeroInstance * hero, SpellID spellToCast);
  41. };
  42. class AirWalkingAction : public AdventureCastAction
  43. {
  44. SpellID spellToCast;
  45. public:
  46. AirWalkingAction(const CGHeroInstance * hero, SpellID spellToCast);
  47. };
  48. }
  49. }