Magic.h 1.4 KB

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