diff --git a/cmake_modules/VCMI_lib.cmake b/cmake_modules/VCMI_lib.cmake index d5d415fdc..bb0654071 100644 --- a/cmake_modules/VCMI_lib.cmake +++ b/cmake_modules/VCMI_lib.cmake @@ -136,6 +136,7 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE) ${MAIN_LIB_DIR}/spells/CSpellHandler.cpp ${MAIN_LIB_DIR}/spells/ISpellMechanics.cpp ${MAIN_LIB_DIR}/spells/ObstacleCasterProxy.cpp + ${MAIN_LIB_DIR}/spells/OuterCaster.cpp ${MAIN_LIB_DIR}/spells/Problem.cpp ${MAIN_LIB_DIR}/spells/ProxyCaster.cpp ${MAIN_LIB_DIR}/spells/TargetCondition.cpp @@ -398,6 +399,7 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE) ${MAIN_LIB_DIR}/spells/BonusCaster.h ${MAIN_LIB_DIR}/spells/CSpellHandler.h ${MAIN_LIB_DIR}/spells/ISpellMechanics.h + ${MAIN_LIB_DIR}/spells/OuterCaster.h ${MAIN_LIB_DIR}/spells/Problem.h ${MAIN_LIB_DIR}/spells/ProxyCaster.h ${MAIN_LIB_DIR}/spells/TargetCondition.h diff --git a/lib/spells/OuterCaster.cpp b/lib/spells/OuterCaster.cpp new file mode 100644 index 000000000..8ed5f1d81 --- /dev/null +++ b/lib/spells/OuterCaster.cpp @@ -0,0 +1,36 @@ +/* + * OuterCaster.cpp, part of VCMI engine + * + * Authors: listed in file AUTHORS in main folder + * + * License: GNU General Public License v2.0 or later + * Full text of license available in license.txt file, in main folder + * + */ + +#include "OuterCaster.h" + +VCMI_LIB_NAMESPACE_BEGIN + +namespace spells +{ + +OuterCaster::OuterCaster(const Caster * actualCaster_, int schoolLevel_) + : ProxyCaster(actualCaster_), schoolLevel(schoolLevel_) +{ + +} + +void OuterCaster::spendMana(ServerCallback * server, const int32_t spellCost) const +{ + //do nothing +} + +int32_t OuterCaster::getSpellSchoolLevel(const Spell * spell, int32_t * outSelectedSchool) const +{ + return schoolLevel; +} + +} + +VCMI_LIB_NAMESPACE_END diff --git a/lib/spells/OuterCaster.h b/lib/spells/OuterCaster.h new file mode 100644 index 000000000..44be1d8b9 --- /dev/null +++ b/lib/spells/OuterCaster.h @@ -0,0 +1,32 @@ +/* + * OuterCaster.h, part of VCMI engine + * + * Authors: listed in file AUTHORS in main folder + * + * License: GNU General Public License v2.0 or later + * Full text of license available in license.txt file, in main folder + * + */ + +#pragma once + +#include "ProxyCaster.h" + +VCMI_LIB_NAMESPACE_BEGIN + +namespace spells +{ + +class DLL_LINKAGE OuterCaster : public ProxyCaster +{ + int schoolLevel; +public: + OuterCaster(const Caster * actualCaster_, int schoolLevel_); + + int32_t getSpellSchoolLevel(const Spell * spell, int32_t * outSelectedSchool = nullptr) const override; + void spendMana(ServerCallback * server, const int32_t spellCost) const override; +}; + +} // namespace spells + +VCMI_LIB_NAMESPACE_END