Magic.h 1.7 KB

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