#include "scripting/lua_unit.hpp"
#include "formatter.hpp"
#include "game_board.hpp"
#include "log.hpp"
#include "map/location.hpp"
#include "map/map.hpp"
#include "resources.hpp"
#include "scripting/lua_attributes.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_unit_attacks.hpp"
#include "scripting/push_check.hpp"
#include "units/unit.hpp"
#include "units/map.hpp"
#include "units/animation_component.hpp"
#include "utils/optional_fwd.hpp"
#include "game_version.hpp"
#include "deprecation.hpp"
#include <vector>
Go to the source code of this file.
Classes | |
struct | lua_object_traits< lua_unit * > |
struct | lua_object_traits< unit > |
Namespaces | |
lua_units | |
Macros | |
#define | LOG_LUA LOG_STREAM(info, log_scripting_lua) |
#define | ERR_LUA LOG_STREAM(err, log_scripting_lua) |
#define | UNIT_GETTER(name, type) LATTR_GETTER(name, type, unit, u) |
#define | UNIT_SETTER(name, type) LATTR_SETTER(name, type, unit, u) |
Enumerations | |
enum | { LU_OK , LU_NOT_UNIT , LU_NOT_ON_MAP , LU_NOT_VALID } |
Functions | |
bool | luaW_isunit (lua_State *L, int index) |
Test if a Lua value is a unit. More... | |
static lua_unit * | internal_get_unit (lua_State *L, int index, bool only_on_map, int &error) |
unit * | luaW_tounit (lua_State *L, int index, bool only_on_map) |
Converts a Lua value to a unit pointer. More... | |
unit_ptr | luaW_tounit_ptr (lua_State *L, int index, bool only_on_map) |
Similar to luaW_tounit but returns a unit_ptr; use this instead of luaW_tounit when using an api that needs unit_ptr. More... | |
lua_unit * | luaW_tounit_ref (lua_State *L, int index) |
Similar to luaW_tounit but returns a lua_unit; use this if you need to handle map and recall units differently, for example. More... | |
static void | unit_show_error (lua_State *L, int index, int error) |
unit_ptr | luaW_checkunit_ptr (lua_State *L, int index, bool only_on_map) |
Similar to luaW_checkunit but returns a unit_ptr; use this instead of luaW_checkunit when using an api that needs unit_ptr. More... | |
unit & | luaW_checkunit (lua_State *L, int index, bool only_on_map) |
Converts a Lua value to a unit pointer. More... | |
lua_unit * | luaW_checkunit_ref (lua_State *L, int index) |
Similar to luaW_checkunit but returns a lua_unit; use this if you need to handle map and recall units differently, for example. More... | |
lua_unit * | luaW_pushlocalunit (lua_State *L, unit &u) |
Pushes a private unit on the stack. More... | |
static int | impl_unit_collect (lua_State *L) |
Destroys a unit object before it is collected (__gc metamethod). More... | |
static int | impl_unit_equality (lua_State *L) |
Checks two lua proxy units for equality. More... | |
static int | impl_unit_tostring (lua_State *L) |
Turns a lua proxy unit to string. More... | |
static void | handle_unit_move (lua_State *L, lua_unit *lu, map_location dst) |
LATTR_GETTER ("valid", utils::optional< std::string >, lua_unit *, lu) | |
UNIT_GETTER ("x", int) | |
LATTR_SETTER ("x", int, lua_unit *, lu) | |
UNIT_GETTER ("y", int) | |
LATTR_SETTER ("y", int, lua_unit *, lu) | |
UNIT_GETTER ("loc", map_location) | |
LATTR_SETTER ("loc", map_location, lua_unit *, lu) | |
UNIT_GETTER ("goto", map_location) | |
UNIT_SETTER ("goto", map_location) | |
UNIT_GETTER ("side", int) | |
UNIT_SETTER ("side", int) | |
UNIT_GETTER ("id", std::string) | |
LATTR_SETTER ("id", std::string, lua_unit *, lu) | |
UNIT_GETTER ("type", std::string) | |
UNIT_GETTER ("image_mods", std::string) | |
UNIT_GETTER ("usage", std::string) | |
UNIT_SETTER ("usage", std::string) | |
UNIT_GETTER ("ellipse", std::string) | |
UNIT_SETTER ("ellipse", std::string) | |
UNIT_GETTER ("halo", std::string) | |
UNIT_SETTER ("halo", std::string) | |
UNIT_GETTER ("hitpoints", int) | |
UNIT_SETTER ("hitpoints", int) | |
UNIT_GETTER ("max_hitpoints", int) | |
UNIT_SETTER ("max_hitpoints", int) | |
UNIT_GETTER ("experience", int) | |
UNIT_SETTER ("experience", int) | |
UNIT_GETTER ("max_experience", int) | |
UNIT_SETTER ("max_experience", int) | |
UNIT_GETTER ("recall_cost", int) | |
UNIT_SETTER ("recall_cost", int) | |
UNIT_GETTER ("moves", int) | |
UNIT_SETTER ("moves", int) | |
UNIT_GETTER ("max_moves", int) | |
UNIT_SETTER ("max_moves", int) | |
UNIT_GETTER ("max_attacks", int) | |
UNIT_SETTER ("max_attacks", int) | |
UNIT_GETTER ("attacks_left", int) | |
UNIT_SETTER ("attacks_left", int) | |
UNIT_GETTER ("vision", int) | |
UNIT_GETTER ("jamming", int) | |
UNIT_GETTER ("name", t_string) | |
UNIT_SETTER ("name", t_string) | |
UNIT_GETTER ("description", t_string) | |
UNIT_SETTER ("description", t_string) | |
UNIT_GETTER ("canrecruit", bool) | |
UNIT_SETTER ("canrecruit", bool) | |
UNIT_GETTER ("renamable", bool) | |
UNIT_SETTER ("renamable", bool) | |
UNIT_GETTER ("level", int) | |
UNIT_SETTER ("level", int) | |
UNIT_GETTER ("cost", int) | |
UNIT_GETTER ("extra_recruit", std::vector< std::string >) | |
UNIT_SETTER ("extra_recruit", std::vector< std::string >) | |
UNIT_GETTER ("advances_to", std::vector< std::string >) | |
UNIT_SETTER ("advances_to", std::vector< std::string >) | |
UNIT_GETTER ("alignment", std::string) | |
UNIT_SETTER ("alignment", lua_index_raw) | |
UNIT_GETTER ("upkeep", lua_index_raw) | |
UNIT_SETTER ("upkeep", lua_index_raw) | |
UNIT_GETTER ("advancements", std::vector< config >) | |
UNIT_SETTER ("advancements", std::vector< config >) | |
UNIT_GETTER ("overlays", std::vector< std::string >) | |
UNIT_GETTER ("traits", std::vector< std::string >) | |
UNIT_GETTER ("abilities", std::vector< std::string >) | |
UNIT_GETTER ("status", lua_index_raw) | |
UNIT_GETTER ("variables", lua_index_raw) | |
UNIT_GETTER ("attacks", lua_index_raw) | |
UNIT_GETTER ("petrified", bool) | |
UNIT_GETTER ("animations", std::vector< std::string >) | |
UNIT_GETTER ("recall_filter", config) | |
UNIT_SETTER ("recall_filter", config) | |
UNIT_GETTER ("hidden", bool) | |
UNIT_SETTER ("hidden", bool) | |
UNIT_GETTER ("resting", bool) | |
UNIT_SETTER ("resting", bool) | |
UNIT_GETTER ("flying", bool) | |
UNIT_GETTER ("fearless", bool) | |
UNIT_GETTER ("healthy", bool) | |
UNIT_GETTER ("zoc", bool) | |
UNIT_SETTER ("zoc", bool) | |
UNIT_GETTER ("role", std::string) | |
UNIT_SETTER ("role", std::string) | |
UNIT_GETTER ("race", std::string) | |
UNIT_GETTER ("gender", std::string) | |
UNIT_GETTER ("variation", std::string) | |
UNIT_GETTER ("undead_variation", std::string) | |
UNIT_SETTER ("undead_variation", std::string) | |
UNIT_GETTER ("facing", std::string) | |
UNIT_SETTER ("facing", std::string) | |
UNIT_GETTER ("portrait", std::string) | |
UNIT_SETTER ("portrait", std::string) | |
UNIT_GETTER ("__cfg", config) | |
static int | impl_unit_get (lua_State *L) |
Gets some data on a unit (__index metamethod). More... | |
static int | impl_unit_set (lua_State *L) |
Sets some data on a unit (__newindex metamethod). More... | |
static int | impl_unit_dir (lua_State *L) |
Prints valid attributes on a unit (__dir metamethod). More... | |
static int | impl_unit_status_get (lua_State *L) |
Gets the status of a unit (__index metamethod). More... | |
static int | impl_unit_status_set (lua_State *L) |
Sets the status of a unit (__newindex metamethod). More... | |
static int | impl_unit_status_dir (lua_State *L) |
List statuses on a unit (__dir metamethod) This returns all known statuses (regardless of state) plus any currently set to true. More... | |
static int | impl_unit_variables_get (lua_State *L) |
Gets the variable of a unit (__index metamethod). More... | |
static int | impl_unit_variables_set (lua_State *L) |
Sets the variable of a unit (__newindex metamethod). More... | |
static int | impl_unit_variables_dir (lua_State *L) |
List variables on a unit (__dir metamethod) More... | |
std::string | lua_units::register_metatables (lua_State *L) |
Variables | |
static lg::log_domain | log_scripting_lua ("scripting/lua") |
static const char | getunitKey [] = "unit" |
static const char | ustatusKey [] = "unit status" |
static const char | unitvarKey [] = "unit variables" |
luaW_Registry | unitReg {"wesnoth", "units", getunitKey} |
#define ERR_LUA LOG_STREAM(err, log_scripting_lua) |
Definition at line 38 of file lua_unit.cpp.
#define LOG_LUA LOG_STREAM(info, log_scripting_lua) |
Definition at line 37 of file lua_unit.cpp.
#define UNIT_GETTER | ( | name, | |
type | |||
) | LATTR_GETTER(name, type, unit, u) |
Definition at line 274 of file lua_unit.cpp.
#define UNIT_SETTER | ( | name, | |
type | |||
) | LATTR_SETTER(name, type, unit, u) |
Definition at line 275 of file lua_unit.cpp.
anonymous enum |
Enumerator | |
---|---|
LU_OK | |
LU_NOT_UNIT | |
LU_NOT_ON_MAP | |
LU_NOT_VALID |
Definition at line 118 of file lua_unit.cpp.
|
static |
|
static |
Destroys a unit object before it is collected (__gc metamethod).
Definition at line 222 of file lua_unit.cpp.
Referenced by lua_units::register_metatables().
|
static |
Prints valid attributes on a unit (__dir metamethod).
Definition at line 788 of file lua_unit.cpp.
References luaW_Registry::dir(), and unitReg.
Referenced by lua_units::register_metatables().
|
static |
Checks two lua proxy units for equality.
(__eq metamethod)
Definition at line 232 of file lua_unit.cpp.
References luaW_checkunit(), and unit::underlying_id().
Referenced by lua_units::register_metatables().
|
static |
Gets some data on a unit (__index metamethod).
Definition at line 766 of file lua_unit.cpp.
References luaW_Registry::get(), and unitReg.
Referenced by lua_units::register_metatables().
|
static |
Sets some data on a unit (__newindex metamethod).
Definition at line 777 of file lua_unit.cpp.
References luaW_Registry::set(), and unitReg.
Referenced by lua_units::register_metatables().
|
static |
List statuses on a unit (__dir metamethod) This returns all known statuses (regardless of state) plus any currently set to true.
Definition at line 839 of file lua_unit.cpp.
References unit::get_known_boolean_state_name(), unit::get_states(), lua_push(), luaW_tounit(), luaW_type_error(), unit::NUMBER_OF_STATES, s, and unit::STATE_SLOWED.
Referenced by lua_units::register_metatables().
|
static |
Gets the status of a unit (__index metamethod).
Definition at line 799 of file lua_unit.cpp.
References unit::get_state(), luaW_tounit(), and luaW_type_error().
Referenced by lua_units::register_metatables().
|
static |
Sets the status of a unit (__newindex metamethod).
Definition at line 820 of file lua_unit.cpp.
References luaW_toboolean(), luaW_tounit(), luaW_type_error(), and unit::set_state().
Referenced by lua_units::register_metatables().
|
static |
Turns a lua proxy unit to string.
(__tostring metamethod)
Definition at line 244 of file lua_unit.cpp.
References unit::get_location(), unit::id(), luaW_tounit_ref(), and unit::type_id().
Referenced by lua_units::register_metatables().
|
static |
List variables on a unit (__dir metamethod)
Definition at line 918 of file lua_unit.cpp.
References config::all_children_count(), config::all_children_view(), config::attribute_count(), config::attribute_range(), lua_push(), luaW_tounit(), luaW_type_error(), and unit::variables().
Referenced by lua_units::register_metatables().
|
static |
Gets the variable of a unit (__index metamethod).
Definition at line 867 of file lua_unit.cpp.
References luaW_pushvariable(), luaW_tounit(), luaW_type_error(), return_cfgref_attrib, and unit::variables().
Referenced by lua_units::register_metatables().
|
static |
Sets the variable of a unit (__newindex metamethod).
Definition at line 890 of file lua_unit.cpp.
References luaW_checkvariable(), luaW_tounit(), luaW_type_error(), modify_cfg_attrib, and unit::variables().
Referenced by lua_units::register_metatables().
|
static |
Definition at line 125 of file lua_unit.cpp.
References utf8::index(), LU_NOT_ON_MAP, LU_NOT_UNIT, LU_NOT_VALID, LU_OK, and luaW_isunit().
Referenced by luaW_checkunit(), luaW_checkunit_ptr(), luaW_checkunit_ref(), luaW_tounit(), luaW_tounit_ptr(), and luaW_tounit_ref().
LATTR_GETTER | ( | "valid" | , |
utils::optional< std::string > | , | ||
lua_unit * | , | ||
lu | |||
) |
Definition at line 326 of file lua_unit.cpp.
References s.
LATTR_SETTER | ( | "id" | , |
std::string | , | ||
lua_unit * | , | ||
lu | |||
) |
Definition at line 391 of file lua_unit.cpp.
LATTR_SETTER | ( | "loc" | , |
map_location | , | ||
lua_unit * | , | ||
lu | |||
) |
Definition at line 366 of file lua_unit.cpp.
References handle_unit_move().
LATTR_SETTER | ( | "x" | , |
int | , | ||
lua_unit * | , | ||
lu | |||
) |
Definition at line 344 of file lua_unit.cpp.
References handle_unit_move(), loc, and map_location::set_wml_x().
LATTR_SETTER | ( | "y" | , |
int | , | ||
lua_unit * | , | ||
lu | |||
) |
Definition at line 355 of file lua_unit.cpp.
References handle_unit_move(), loc, and map_location::set_wml_y().
unit& luaW_checkunit | ( | lua_State * | L, |
int | index, | ||
bool | only_on_map | ||
) |
Converts a Lua value to a unit pointer.
Definition at line 191 of file lua_unit.cpp.
References utf8::index(), internal_get_unit(), and unit_show_error().
Referenced by game_lua_kernel::cfun_builtin_effect(), impl_unit_attacks_set(), impl_unit_equality(), intf_add_modification(), intf_advance_unit(), intf_copy_unit(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_find_vision_range(), intf_remove_modifications(), game_lua_kernel::intf_simulate_combat(), intf_transform_unit(), game_lua_kernel::intf_unit_ability(), intf_unit_defense(), intf_unit_jamming_cost(), intf_unit_movement_cost(), intf_unit_resistance(), and intf_unit_vision_cost().
unit_ptr luaW_checkunit_ptr | ( | lua_State * | L, |
int | index, | ||
bool | only_on_map | ||
) |
Similar to luaW_checkunit but returns a unit_ptr; use this instead of luaW_checkunit when using an api that needs unit_ptr.
Definition at line 183 of file lua_unit.cpp.
References utf8::index(), internal_get_unit(), and unit_show_error().
Referenced by impl_add_animation(), game_lua_kernel::intf_find_vacant_tile(), and game_lua_kernel::intf_teleport().
lua_unit* luaW_checkunit_ref | ( | lua_State * | L, |
int | index | ||
) |
Similar to luaW_checkunit but returns a lua_unit; use this if you need to handle map and recall units differently, for example.
Definition at line 199 of file lua_unit.cpp.
References utf8::index(), internal_get_unit(), and unit_show_error().
Referenced by game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_extract_unit(), game_lua_kernel::intf_match_unit(), game_lua_kernel::intf_put_recall_unit(), and game_lua_kernel::intf_put_unit().
bool luaW_isunit | ( | lua_State * | L, |
int | index | ||
) |
Test if a Lua value is a unit.
Definition at line 113 of file lua_unit.cpp.
References getunitKey, and utf8::index().
Referenced by internal_get_unit(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_find_vacant_tile(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_match_location(), game_lua_kernel::intf_put_recall_unit(), and game_lua_kernel::intf_put_unit().
Pushes a private unit on the stack.
Definition at line 212 of file lua_unit.cpp.
Referenced by game_lua_kernel::apply_effect(), and game_lua_kernel::run_filter().
unit* luaW_tounit | ( | lua_State * | L, |
int | index, | ||
bool | only_on_map | ||
) |
Converts a Lua value to a unit pointer.
Definition at line 142 of file lua_unit.cpp.
References utf8::index(), internal_get_unit(), and LU_OK.
Referenced by ai::cfun_ai_get_suitable_keep(), impl_unit_attacks_len(), impl_unit_status_dir(), impl_unit_status_get(), impl_unit_status_set(), impl_unit_variables_dir(), impl_unit_variables_get(), impl_unit_variables_set(), lua_formula_bridge::intf_eval_formula(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_get_units(), game_lua_kernel::intf_match_location(), game_lua_kernel::intf_match_unit(), luaW_tofaivariant(), and WIDGET_SETTER().
unit_ptr luaW_tounit_ptr | ( | lua_State * | L, |
int | index, | ||
bool | only_on_map | ||
) |
Similar to luaW_tounit but returns a unit_ptr; use this instead of luaW_tounit when using an api that needs unit_ptr.
Definition at line 152 of file lua_unit.cpp.
References utf8::index(), internal_get_unit(), and LU_OK.
lua_unit* luaW_tounit_ref | ( | lua_State * | L, |
int | index | ||
) |
Similar to luaW_tounit but returns a lua_unit; use this if you need to handle map and recall units differently, for example.
Note that this only returns null if the element on the stack was not a unit, so it may be an invalid unit.
Definition at line 162 of file lua_unit.cpp.
References utf8::index(), and internal_get_unit().
Referenced by impl_unit_attacks_get(), and impl_unit_tostring().
UNIT_GETTER | ( | "__cfg" | , |
config | |||
) |
Definition at line 753 of file lua_unit.cpp.
References unit::get_location(), map_location::write(), and unit::write().
UNIT_GETTER | ( | "abilities" | , |
std::vector< std::string > | |||
) |
Definition at line 626 of file lua_unit.cpp.
References unit::get_ability_list().
UNIT_GETTER | ( | "advancements" | , |
std::vector< config > | |||
) |
Definition at line 610 of file lua_unit.cpp.
References unit::modification_advancements().
UNIT_GETTER | ( | "advances_to" | , |
std::vector< std::string > | |||
) |
Definition at line 561 of file lua_unit.cpp.
References unit::advances_to().
UNIT_GETTER | ( | "alignment" | , |
std::string | |||
) |
Definition at line 569 of file lua_unit.cpp.
References unit::alignment(), and string_enums::enum_base< Definition >::get_string().
UNIT_GETTER | ( | "animations" | , |
std::vector< std::string > | |||
) |
Definition at line 659 of file lua_unit.cpp.
References unit::anim_comp(), and unit_animation_component::get_flags().
UNIT_GETTER | ( | "attacks" | , |
lua_index_raw | |||
) |
Definition at line 648 of file lua_unit.cpp.
References push_unit_attacks_table().
UNIT_GETTER | ( | "attacks_left" | , |
int | |||
) |
Definition at line 493 of file lua_unit.cpp.
References unit::attacks_left().
UNIT_GETTER | ( | "canrecruit" | , |
bool | |||
) |
Definition at line 525 of file lua_unit.cpp.
References unit::can_recruit().
UNIT_GETTER | ( | "cost" | , |
int | |||
) |
Definition at line 549 of file lua_unit.cpp.
References unit::cost().
UNIT_GETTER | ( | "description" | , |
t_string | |||
) |
Definition at line 517 of file lua_unit.cpp.
References unit::unit_description().
UNIT_GETTER | ( | "ellipse" | , |
std::string | |||
) |
Definition at line 413 of file lua_unit.cpp.
References unit::image_ellipse().
UNIT_GETTER | ( | "experience" | , |
int | |||
) |
Definition at line 445 of file lua_unit.cpp.
References unit::experience().
UNIT_GETTER | ( | "extra_recruit" | , |
std::vector< std::string > | |||
) |
Definition at line 553 of file lua_unit.cpp.
References unit::recruits().
UNIT_GETTER | ( | "facing" | , |
std::string | |||
) |
Definition at line 735 of file lua_unit.cpp.
References unit::facing(), and map_location::write_direction().
UNIT_GETTER | ( | "fearless" | , |
bool | |||
) |
Definition at line 691 of file lua_unit.cpp.
References unit::is_fearless().
UNIT_GETTER | ( | "flying" | , |
bool | |||
) |
Definition at line 687 of file lua_unit.cpp.
References unit::is_flying().
UNIT_GETTER | ( | "gender" | , |
std::string | |||
) |
Definition at line 719 of file lua_unit.cpp.
References unit::gender(), and gender_string().
UNIT_GETTER | ( | "goto" | , |
map_location | |||
) |
Definition at line 371 of file lua_unit.cpp.
References unit::get_goto().
UNIT_GETTER | ( | "halo" | , |
std::string | |||
) |
Definition at line 421 of file lua_unit.cpp.
References unit::image_halo().
UNIT_GETTER | ( | "healthy" | , |
bool | |||
) |
Definition at line 695 of file lua_unit.cpp.
References unit::is_healthy().
UNIT_GETTER | ( | "hidden" | , |
bool | |||
) |
Definition at line 671 of file lua_unit.cpp.
References unit::get_hidden().
UNIT_GETTER | ( | "hitpoints" | , |
int | |||
) |
Definition at line 429 of file lua_unit.cpp.
References unit::hitpoints().
UNIT_GETTER | ( | "id" | , |
std::string | |||
) |
Definition at line 387 of file lua_unit.cpp.
References unit::id().
UNIT_GETTER | ( | "image_mods" | , |
std::string | |||
) |
Definition at line 401 of file lua_unit.cpp.
References unit::effect_image_mods().
UNIT_GETTER | ( | "jamming" | , |
int | |||
) |
Definition at line 505 of file lua_unit.cpp.
References unit::jamming().
UNIT_GETTER | ( | "level" | , |
int | |||
) |
Definition at line 541 of file lua_unit.cpp.
References unit::level().
UNIT_GETTER | ( | "loc" | , |
map_location | |||
) |
Definition at line 362 of file lua_unit.cpp.
References unit::get_location().
UNIT_GETTER | ( | "max_attacks" | , |
int | |||
) |
Definition at line 485 of file lua_unit.cpp.
References unit::max_attacks().
UNIT_GETTER | ( | "max_experience" | , |
int | |||
) |
Definition at line 453 of file lua_unit.cpp.
References unit::max_experience().
UNIT_GETTER | ( | "max_hitpoints" | , |
int | |||
) |
Definition at line 437 of file lua_unit.cpp.
References unit::max_hitpoints().
UNIT_GETTER | ( | "max_moves" | , |
int | |||
) |
Definition at line 477 of file lua_unit.cpp.
References unit::total_movement().
UNIT_GETTER | ( | "moves" | , |
int | |||
) |
Definition at line 469 of file lua_unit.cpp.
References unit::movement_left().
UNIT_GETTER | ( | "name" | , |
t_string | |||
) |
Definition at line 509 of file lua_unit.cpp.
References unit::name().
UNIT_GETTER | ( | "overlays" | , |
std::vector< std::string > | |||
) |
Definition at line 618 of file lua_unit.cpp.
References unit::overlays().
UNIT_GETTER | ( | "petrified" | , |
bool | |||
) |
Definition at line 654 of file lua_unit.cpp.
References deprecated_message(), unit::incapacitated(), and INDEFINITE.
UNIT_GETTER | ( | "portrait" | , |
std::string | |||
) |
Definition at line 743 of file lua_unit.cpp.
References unit::absolute_image(), unit::big_profile(), and unit::image_mods().
UNIT_GETTER | ( | "race" | , |
std::string | |||
) |
Definition at line 715 of file lua_unit.cpp.
References unit_race::id(), and unit::race().
UNIT_GETTER | ( | "recall_cost" | , |
int | |||
) |
Definition at line 461 of file lua_unit.cpp.
References unit::recall_cost().
UNIT_GETTER | ( | "recall_filter" | , |
config | |||
) |
Definition at line 663 of file lua_unit.cpp.
References unit::recall_filter().
UNIT_GETTER | ( | "renamable" | , |
bool | |||
) |
Definition at line 533 of file lua_unit.cpp.
References unit::unrenamable().
UNIT_GETTER | ( | "resting" | , |
bool | |||
) |
Definition at line 679 of file lua_unit.cpp.
References unit::resting().
UNIT_GETTER | ( | "role" | , |
std::string | |||
) |
Definition at line 707 of file lua_unit.cpp.
References unit::get_role().
UNIT_GETTER | ( | "side" | , |
int | |||
) |
Definition at line 379 of file lua_unit.cpp.
References unit::side().
UNIT_GETTER | ( | "status" | , |
lua_index_raw | |||
) |
Definition at line 630 of file lua_unit.cpp.
References ustatusKey.
UNIT_GETTER | ( | "traits" | , |
std::vector< std::string > | |||
) |
Definition at line 622 of file lua_unit.cpp.
References unit::get_traits_list().
UNIT_GETTER | ( | "type" | , |
std::string | |||
) |
Definition at line 397 of file lua_unit.cpp.
References unit::type_id().
UNIT_GETTER | ( | "undead_variation" | , |
std::string | |||
) |
Definition at line 727 of file lua_unit.cpp.
References unit::undead_variation().
UNIT_GETTER | ( | "upkeep" | , |
lua_index_raw | |||
) |
Definition at line 579 of file lua_unit.cpp.
References lua_push(), and unit::upkeep_raw().
UNIT_GETTER | ( | "usage" | , |
std::string | |||
) |
Definition at line 405 of file lua_unit.cpp.
References unit::usage().
UNIT_GETTER | ( | "variables" | , |
lua_index_raw | |||
) |
Definition at line 639 of file lua_unit.cpp.
References unitvarKey.
UNIT_GETTER | ( | "variation" | , |
std::string | |||
) |
Definition at line 723 of file lua_unit.cpp.
References unit::variation().
UNIT_GETTER | ( | "vision" | , |
int | |||
) |
Definition at line 501 of file lua_unit.cpp.
References unit::vision().
UNIT_GETTER | ( | "x" | , |
int | |||
) |
Definition at line 340 of file lua_unit.cpp.
References unit::get_location(), and map_location::wml_x().
UNIT_GETTER | ( | "y" | , |
int | |||
) |
Definition at line 351 of file lua_unit.cpp.
References unit::get_location(), and map_location::wml_y().
UNIT_GETTER | ( | "zoc" | , |
bool | |||
) |
Definition at line 699 of file lua_unit.cpp.
References unit::get_emit_zoc().
UNIT_SETTER | ( | "advancements" | , |
std::vector< config > | |||
) |
Definition at line 614 of file lua_unit.cpp.
References unit::set_advancements().
UNIT_SETTER | ( | "advances_to" | , |
std::vector< std::string > | |||
) |
Definition at line 565 of file lua_unit.cpp.
References unit::set_advances_to().
UNIT_SETTER | ( | "alignment" | , |
lua_index_raw | |||
) |
Definition at line 573 of file lua_unit.cpp.
References string_enums::enum_base< Definition >::get_enum(), and unit::set_alignment().
UNIT_SETTER | ( | "attacks_left" | , |
int | |||
) |
Definition at line 497 of file lua_unit.cpp.
References unit::set_attacks().
UNIT_SETTER | ( | "canrecruit" | , |
bool | |||
) |
Definition at line 529 of file lua_unit.cpp.
References unit::set_can_recruit().
UNIT_SETTER | ( | "description" | , |
t_string | |||
) |
Definition at line 521 of file lua_unit.cpp.
References unit::set_unit_description().
UNIT_SETTER | ( | "ellipse" | , |
std::string | |||
) |
Definition at line 417 of file lua_unit.cpp.
References unit::set_image_ellipse().
UNIT_SETTER | ( | "experience" | , |
int | |||
) |
Definition at line 449 of file lua_unit.cpp.
References unit::set_experience().
UNIT_SETTER | ( | "extra_recruit" | , |
std::vector< std::string > | |||
) |
Definition at line 557 of file lua_unit.cpp.
References unit::set_recruits().
UNIT_SETTER | ( | "facing" | , |
std::string | |||
) |
Definition at line 739 of file lua_unit.cpp.
References map_location::parse_direction(), and unit::set_facing().
UNIT_SETTER | ( | "goto" | , |
map_location | |||
) |
Definition at line 375 of file lua_unit.cpp.
References unit::set_goto().
UNIT_SETTER | ( | "halo" | , |
std::string | |||
) |
Definition at line 425 of file lua_unit.cpp.
References unit::set_image_halo().
UNIT_SETTER | ( | "hidden" | , |
bool | |||
) |
Definition at line 675 of file lua_unit.cpp.
References unit::set_hidden().
UNIT_SETTER | ( | "hitpoints" | , |
int | |||
) |
Definition at line 433 of file lua_unit.cpp.
References unit::set_hitpoints().
UNIT_SETTER | ( | "level" | , |
int | |||
) |
Definition at line 545 of file lua_unit.cpp.
References unit::set_level().
UNIT_SETTER | ( | "max_attacks" | , |
int | |||
) |
Definition at line 489 of file lua_unit.cpp.
References unit::set_max_attacks().
UNIT_SETTER | ( | "max_experience" | , |
int | |||
) |
Definition at line 457 of file lua_unit.cpp.
References unit::set_max_experience().
UNIT_SETTER | ( | "max_hitpoints" | , |
int | |||
) |
Definition at line 441 of file lua_unit.cpp.
References unit::set_max_hitpoints().
UNIT_SETTER | ( | "max_moves" | , |
int | |||
) |
Definition at line 481 of file lua_unit.cpp.
References unit::set_total_movement().
UNIT_SETTER | ( | "moves" | , |
int | |||
) |
Definition at line 473 of file lua_unit.cpp.
References unit::set_movement().
UNIT_SETTER | ( | "name" | , |
t_string | |||
) |
Definition at line 513 of file lua_unit.cpp.
References unit::set_name().
UNIT_SETTER | ( | "portrait" | , |
std::string | |||
) |
Definition at line 749 of file lua_unit.cpp.
References unit::set_big_profile().
UNIT_SETTER | ( | "recall_cost" | , |
int | |||
) |
Definition at line 465 of file lua_unit.cpp.
References unit::set_recall_cost().
UNIT_SETTER | ( | "recall_filter" | , |
config | |||
) |
Definition at line 667 of file lua_unit.cpp.
References unit::set_recall_filter().
UNIT_SETTER | ( | "renamable" | , |
bool | |||
) |
Definition at line 537 of file lua_unit.cpp.
References unit::set_unrenamable().
UNIT_SETTER | ( | "resting" | , |
bool | |||
) |
Definition at line 683 of file lua_unit.cpp.
References unit::set_resting().
UNIT_SETTER | ( | "role" | , |
std::string | |||
) |
Definition at line 711 of file lua_unit.cpp.
References unit::set_role().
UNIT_SETTER | ( | "side" | , |
int | |||
) |
Definition at line 383 of file lua_unit.cpp.
References unit::set_side().
UNIT_SETTER | ( | "undead_variation" | , |
std::string | |||
) |
Definition at line 731 of file lua_unit.cpp.
References unit::set_undead_variation().
UNIT_SETTER | ( | "upkeep" | , |
lua_index_raw | |||
) |
Definition at line 592 of file lua_unit.cpp.
References unit::set_upkeep().
UNIT_SETTER | ( | "usage" | , |
std::string | |||
) |
Definition at line 409 of file lua_unit.cpp.
References unit::set_usage().
UNIT_SETTER | ( | "zoc" | , |
bool | |||
) |
Definition at line 703 of file lua_unit.cpp.
References unit::set_emit_zoc().
|
static |
Definition at line 168 of file lua_unit.cpp.
References utf8::index(), LU_NOT_ON_MAP, LU_NOT_UNIT, LU_NOT_VALID, and luaW_type_error().
Referenced by luaW_checkunit(), luaW_checkunit_ptr(), and luaW_checkunit_ref().
|
static |
Definition at line 40 of file lua_unit.cpp.
Referenced by luaW_isunit(), lua_units::register_metatables(), and lua_unit::setmetatable().
|
static |
luaW_Registry unitReg {"wesnoth", "units", getunitKey} |
Definition at line 276 of file lua_unit.cpp.
Referenced by impl_unit_dir(), impl_unit_get(), and impl_unit_set().
|
static |
Definition at line 42 of file lua_unit.cpp.
Referenced by lua_units::register_metatables(), and UNIT_GETTER().
|
static |
Definition at line 41 of file lua_unit.cpp.
Referenced by lua_units::register_metatables(), and UNIT_GETTER().