Magic.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Magic.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. /**
  12. * High-level interface for spells subsystem
  13. */
  14. class CSpell;
  15. class CStack;
  16. class PlayerColor;
  17. class DLL_LINKAGE ISpellCaster
  18. {
  19. public:
  20. virtual ~ISpellCaster(){};
  21. /// returns level on which given spell would be cast by this(0 - none, 1 - basic etc);
  22. /// caster may not know this spell at all
  23. /// optionally returns number of selected school by arg - 0 - air magic, 1 - fire magic, 2 - water magic, 3 - earth magic
  24. virtual ui8 getSpellSchoolLevel(const CSpell * spell, int *outSelectedSchool = nullptr) const = 0;
  25. ///applying sorcery secondary skill etc
  26. virtual ui32 getSpellBonus(const CSpell * spell, ui32 base, const CStack * affectedStack) const = 0;
  27. ///default spell school level for effect calculation
  28. virtual int getEffectLevel(const CSpell * spell) const = 0;
  29. ///default spell-power for damage/heal calculation
  30. virtual int getEffectPower(const CSpell * spell) const = 0;
  31. ///default spell-power for timed effects duration
  32. virtual int getEnchantPower(const CSpell * spell) const = 0;
  33. ///damage/heal override(ignores spell configuration, effect level and effect power)
  34. virtual int getEffectValue(const CSpell * spell) const = 0;
  35. virtual const PlayerColor getOwner() const = 0;
  36. };