ObstacleCasterProxy.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * ObstacleCasterProxy.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. #include "ProxyCaster.h"
  11. #include "../lib/NetPacksBase.h"
  12. #include "../battle/BattleHex.h"
  13. #include "../battle/CObstacleInstance.h"
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. namespace spells
  16. {
  17. class DLL_LINKAGE SilentCaster : public ProxyCaster
  18. {
  19. protected:
  20. const PlayerColor owner;
  21. public:
  22. SilentCaster(PlayerColor owner_, const Caster * caster);
  23. void getCasterName(MetaString & text) const override;
  24. void getCastDescription(const Spell * spell, const std::vector<const battle::Unit *> & attacked, MetaString & text) const override;
  25. void spendMana(ServerCallback * server, const int spellCost) const override;
  26. PlayerColor getCasterOwner() const override;
  27. int32_t manaLimit() const override;
  28. };
  29. class DLL_LINKAGE ObstacleCasterProxy : public SilentCaster
  30. {
  31. public:
  32. ObstacleCasterProxy(PlayerColor owner_, const Caster * hero_, const SpellCreatedObstacle & obs_);
  33. int32_t getSpellSchoolLevel(const Spell * spell, int32_t * outSelectedSchool = nullptr) const override;
  34. int32_t getEffectLevel(const Spell * spell) const override;
  35. int64_t getSpellBonus(const Spell * spell, int64_t base, const battle::Unit * affectedStack) const override;
  36. int32_t getEffectPower(const Spell * spell) const override;
  37. int32_t getEnchantPower(const Spell * spell) const override;
  38. int64_t getEffectValue(const Spell * spell) const override;
  39. private:
  40. const SpellCreatedObstacle & obs;
  41. };
  42. }//
  43. VCMI_LIB_NAMESPACE_END