Spell.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * spells/Spell.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 "../Entity.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class SpellID;
  14. class SpellSchool;
  15. namespace spells
  16. {
  17. class Caster;
  18. class DLL_LINKAGE Spell: public EntityT<SpellID>
  19. {
  20. public:
  21. using SchoolCallback = std::function<void(const SpellSchool &, bool &)>;
  22. ///calculate spell damage on stack taking caster`s secondary skills into account
  23. virtual int64_t calculateDamage(const Caster * caster) const = 0;
  24. virtual int32_t getLevel() const = 0;
  25. virtual boost::logic::tribool getPositiveness() const = 0;
  26. virtual bool isAdventure() const = 0;
  27. virtual bool isCombat() const = 0;
  28. virtual bool isCreatureAbility() const = 0;
  29. virtual bool isPositive() const = 0;
  30. virtual bool isNegative() const = 0;
  31. virtual bool isNeutral() const = 0;
  32. virtual bool isDamage() const = 0;
  33. virtual bool isOffensive() const = 0;
  34. virtual bool isSpecial() const = 0;
  35. virtual bool isMagical() const = 0; //Should this spell considered as magical effect or as ability (like dendroid's bind)
  36. virtual bool hasSchool(SpellSchool school) const = 0;
  37. virtual bool canCastOnSelf() const = 0;
  38. virtual bool canCastWithoutSkip() const = 0;
  39. virtual void forEachSchool(const SchoolCallback & cb) const = 0;
  40. virtual int32_t getCost(const int32_t skillLevel) const = 0;
  41. virtual int32_t getBasePower() const = 0;
  42. /**
  43. * Returns spell level power, base power ignored
  44. */
  45. virtual int32_t getLevelPower(const int32_t skillLevel) const = 0;
  46. virtual std::string getDescriptionTextID(int32_t level) const = 0;
  47. virtual std::string getDescriptionTranslated(int32_t level) const = 0;
  48. };
  49. }
  50. VCMI_LIB_NAMESPACE_END