2
0

Spell.cpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. namespace scripting
  16. {
  17. namespace api
  18. {
  19. using ::spells::Spell;
  20. VCMI_REGISTER_CORE_SCRIPT_API(SpellProxy, "Spell");
  21. //TODO:calculateDamage,forEachSchool
  22. const std::vector<SpellProxy::CustomRegType> SpellProxy::REGISTER_CUSTOM =
  23. {
  24. {"getIconIndex", LuaMethodWrapper<Spell, decltype(&Entity::getIconIndex), &Entity::getIconIndex>::invoke, false},
  25. {"getIndex", LuaMethodWrapper<Spell, decltype(&Entity::getIndex), &Entity::getIndex>::invoke, false},
  26. {"getJsonKey", LuaMethodWrapper<Spell, decltype(&Entity::getJsonKey), &Entity::getJsonKey>::invoke, false},
  27. {"getName", LuaMethodWrapper<Spell, decltype(&Entity::getName), &Entity::getName>::invoke, false},
  28. {"isAdventure", LuaMethodWrapper<Spell, decltype(&Spell::isAdventure), &Spell::isAdventure>::invoke, false},
  29. {"isCombat", LuaMethodWrapper<Spell, decltype(&Spell::isCombat), &Spell::isCombat>::invoke, false},
  30. {"isCreatureAbility", LuaMethodWrapper<Spell, decltype(&Spell::isCreatureAbility), &Spell::isCreatureAbility>::invoke, false},
  31. {"isPositive", LuaMethodWrapper<Spell, decltype(&Spell::isPositive), &Spell::isPositive>::invoke, false},
  32. {"isNegative", LuaMethodWrapper<Spell, decltype(&Spell::isNegative), &Spell::isNegative>::invoke, false},
  33. {"isNeutral", LuaMethodWrapper<Spell, decltype(&Spell::isNeutral), &Spell::isNeutral>::invoke, false},
  34. {"isDamage", LuaMethodWrapper<Spell, decltype(&Spell::isDamage), &Spell::isDamage>::invoke, false},
  35. {"isOffensive", LuaMethodWrapper<Spell, decltype(&Spell::isOffensive), &Spell::isOffensive>::invoke, false},
  36. {"isSpecial", LuaMethodWrapper<Spell, decltype(&Spell::isSpecial), &Spell::isSpecial>::invoke, false},
  37. {"getCost", LuaMethodWrapper<Spell, decltype(&Spell::getCost), &Spell::getCost>::invoke, false},
  38. {"getBasePower", LuaMethodWrapper<Spell, decltype(&Spell::getBasePower), &Spell::getBasePower>::invoke, false},
  39. {"getLevelPower", LuaMethodWrapper<Spell, decltype(&Spell::getLevelPower), &Spell::getLevelPower>::invoke, false},
  40. {"getLevelDescription", LuaMethodWrapper<Spell, decltype(&Spell::getLevelDescription), &Spell::getLevelDescription>::invoke, false},
  41. };
  42. }
  43. }