Spell.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * api/Spell.cpp, 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 "StdInc.h"
  11. #include "Spell.h"
  12. #include "Registry.h"
  13. #include "../LuaStack.h"
  14. #include "../LuaCallWrapper.h"
  15. VCMI_LIB_NAMESPACE_BEGIN
  16. namespace scripting
  17. {
  18. namespace api
  19. {
  20. using ::spells::Spell;
  21. VCMI_REGISTER_CORE_SCRIPT_API(SpellProxy, "Spell");
  22. //TODO:calculateDamage,forEachSchool
  23. const std::vector<SpellProxy::CustomRegType> SpellProxy::REGISTER_CUSTOM =
  24. {
  25. {"getIconIndex", LuaMethodWrapper<Spell, decltype(&Entity::getIconIndex), &Entity::getIconIndex>::invoke, false},
  26. {"getIndex", LuaMethodWrapper<Spell, decltype(&Entity::getIndex), &Entity::getIndex>::invoke, false},
  27. {"getJsonKey", LuaMethodWrapper<Spell, decltype(&Entity::getJsonKey), &Entity::getJsonKey>::invoke, false},
  28. {"getName", LuaMethodWrapper<Spell, decltype(&Entity::getNameTranslated), &Entity::getNameTranslated>::invoke, false},
  29. {"isAdventure", LuaMethodWrapper<Spell, decltype(&Spell::isAdventure), &Spell::isAdventure>::invoke, false},
  30. {"isCombat", LuaMethodWrapper<Spell, decltype(&Spell::isCombat), &Spell::isCombat>::invoke, false},
  31. {"isCreatureAbility", LuaMethodWrapper<Spell, decltype(&Spell::isCreatureAbility), &Spell::isCreatureAbility>::invoke, false},
  32. {"isPositive", LuaMethodWrapper<Spell, decltype(&Spell::isPositive), &Spell::isPositive>::invoke, false},
  33. {"isNegative", LuaMethodWrapper<Spell, decltype(&Spell::isNegative), &Spell::isNegative>::invoke, false},
  34. {"isNeutral", LuaMethodWrapper<Spell, decltype(&Spell::isNeutral), &Spell::isNeutral>::invoke, false},
  35. {"isDamage", LuaMethodWrapper<Spell, decltype(&Spell::isDamage), &Spell::isDamage>::invoke, false},
  36. {"isOffensive", LuaMethodWrapper<Spell, decltype(&Spell::isOffensive), &Spell::isOffensive>::invoke, false},
  37. {"isSpecial", LuaMethodWrapper<Spell, decltype(&Spell::isSpecial), &Spell::isSpecial>::invoke, false},
  38. {"getCost", LuaMethodWrapper<Spell, decltype(&Spell::getCost), &Spell::getCost>::invoke, false},
  39. {"getBasePower", LuaMethodWrapper<Spell, decltype(&Spell::getBasePower), &Spell::getBasePower>::invoke, false},
  40. {"getLevelPower", LuaMethodWrapper<Spell, decltype(&Spell::getLevelPower), &Spell::getLevelPower>::invoke, false},
  41. {"getLevelDescription", LuaMethodWrapper<Spell, decltype(&Spell::getDescriptionTranslated), &Spell::getDescriptionTranslated>::invoke, false},
  42. };
  43. }
  44. }
  45. VCMI_LIB_NAMESPACE_END