Creature.cpp 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * api/Creature.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 "Creature.h"
  12. #include "Registry.h"
  13. #include "../LuaStack.h"
  14. #include "../LuaCallWrapper.h"
  15. #include "../../../lib/bonuses/Bonus.h"
  16. #include "../../../lib/bonuses/IBonusBearer.h"
  17. VCMI_LIB_NAMESPACE_BEGIN
  18. namespace scripting
  19. {
  20. namespace api
  21. {
  22. VCMI_REGISTER_CORE_SCRIPT_API(CreatureProxy, "Creature");
  23. const std::vector<CreatureProxy::CustomRegType> CreatureProxy::REGISTER_CUSTOM =
  24. {
  25. {"getIconIndex", LuaMethodWrapper<Creature, decltype(&Entity::getIconIndex), &Entity::getIconIndex>::invoke, false},
  26. {"getIndex", LuaMethodWrapper<Creature, decltype(&Entity::getIndex), &Entity::getIndex>::invoke, false},
  27. {"getJsonKey", LuaMethodWrapper<Creature, decltype(&Entity::getJsonKey), &Entity::getJsonKey>::invoke, false},
  28. {"getName", LuaMethodWrapper<Creature, decltype(&Entity::getNameTranslated), &Entity::getNameTranslated>::invoke, false},
  29. {"getBonusBearer", LuaMethodWrapper<Creature, decltype(&IConstBonusProvider::getBonusBearer), &IConstBonusProvider::getBonusBearer>::invoke, false},
  30. {"getMaxHealth", LuaMethodWrapper<Creature,decltype(&Creature::getMaxHealth), &Creature::getMaxHealth>::invoke, false},
  31. {"getPluralName", LuaMethodWrapper<Creature, decltype(&Creature::getNamePluralTranslated), &Creature::getNamePluralTranslated>::invoke, false},
  32. {"getSingularName", LuaMethodWrapper<Creature, decltype(&Creature::getNameSingularTranslated), &Creature::getNameSingularTranslated>::invoke, false},
  33. {"getAdvMapAmountMin", LuaMethodWrapper<Creature, decltype(&Creature::getAdvMapAmountMin), &Creature::getAdvMapAmountMin>::invoke, false},
  34. {"getAdvMapAmountMax", LuaMethodWrapper<Creature, decltype(&Creature::getAdvMapAmountMax), &Creature::getAdvMapAmountMax>::invoke, false},
  35. {"getAIValue", LuaMethodWrapper<Creature, decltype(&Creature::getAIValue), &Creature::getAIValue>::invoke, false},
  36. {"getFightValue", LuaMethodWrapper<Creature, decltype(&Creature::getFightValue), &Creature::getFightValue>::invoke, false},
  37. {"getLevel", LuaMethodWrapper<Creature, decltype(&Creature::getLevel), &Creature::getLevel>::invoke, false},
  38. {"getGrowth", LuaMethodWrapper<Creature, decltype(&Creature::getGrowth), &Creature::getGrowth>::invoke, false},
  39. {"getHorde", LuaMethodWrapper<Creature, decltype(&Creature::getHorde), &Creature::getHorde>::invoke, false},
  40. {"getFactionID", LuaMethodWrapper<Creature, decltype(&Creature::getFactionID), &Creature::getFactionID>::invoke, false},
  41. {"getBaseAttack", LuaMethodWrapper<Creature, decltype(&Creature::getBaseAttack), &Creature::getBaseAttack>::invoke, false},
  42. {"getBaseDefense", LuaMethodWrapper<Creature, decltype(&Creature::getBaseDefense), &Creature::getBaseDefense>::invoke, false},
  43. {"getBaseDamageMin", LuaMethodWrapper<Creature, decltype(&Creature::getBaseDamageMin), &Creature::getBaseDamageMin>::invoke, false},
  44. {"getBaseDamageMax", LuaMethodWrapper<Creature, decltype(&Creature::getBaseDamageMax), &Creature::getBaseDamageMax>::invoke, false},
  45. {"getBaseHitPoints", LuaMethodWrapper<Creature, decltype(&Creature::getBaseHitPoints), &Creature::getBaseHitPoints>::invoke, false},
  46. {"getBaseSpellPoints", LuaMethodWrapper<Creature, decltype(&Creature::getBaseSpellPoints), &Creature::getBaseSpellPoints>::invoke, false},
  47. {"getBaseSpeed", LuaMethodWrapper<Creature, decltype(&Creature::getBaseSpeed), &Creature::getBaseSpeed>::invoke, false},
  48. {"getBaseShots", LuaMethodWrapper<Creature, decltype(&Creature::getBaseShots), &Creature::getBaseShots>::invoke, false},
  49. {"getRecruitCost", LuaMethodWrapper<Creature, decltype(&Creature::getRecruitCost), &Creature::getRecruitCost>::invoke, false},
  50. {"isDoubleWide", LuaMethodWrapper<Creature, decltype(&Creature::isDoubleWide), &Creature::isDoubleWide>::invoke, false},
  51. };
  52. }
  53. }
  54. VCMI_LIB_NAMESPACE_END