ObstacleCasterProxy.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. };
  28. class DLL_LINKAGE ObstacleCasterProxy : public SilentCaster
  29. {
  30. public:
  31. ObstacleCasterProxy(PlayerColor owner_, const Caster * hero_, const SpellCreatedObstacle & obs_);
  32. int32_t getSpellSchoolLevel(const Spell * spell, int32_t * outSelectedSchool = nullptr) const override;
  33. int32_t getEffectLevel(const Spell * spell) const override;
  34. int64_t getSpellBonus(const Spell * spell, int64_t base, const battle::Unit * affectedStack) const override;
  35. int32_t getEffectPower(const Spell * spell) const override;
  36. int32_t getEnchantPower(const Spell * spell) const override;
  37. int64_t getEffectValue(const Spell * spell) const override;
  38. private:
  39. const SpellCreatedObstacle & obs;
  40. };
  41. }//
  42. VCMI_LIB_NAMESPACE_END