Provides a Lua interpreter, to be embedded in WML. More...
#include "scripting/game_lua_kernel.hpp"
#include "global.hpp"
#include "actions/attack.hpp"
#include "actions/move.hpp"
#include "actions/vision.hpp"
#include "ai/composite/ai.hpp"
#include "ai/composite/component.hpp"
#include "ai/composite/contexts.hpp"
#include "ai/lua/engine_lua.hpp"
#include "ai/composite/rca.hpp"
#include "ai/composite/stage.hpp"
#include "ai/configuration.hpp"
#include "ai/lua/core.hpp"
#include "ai/manager.hpp"
#include "attack_prediction.hpp"
#include "chat_events.hpp"
#include "config.hpp"
#include "display_chat_manager.hpp"
#include "formatter.hpp"
#include "game_board.hpp"
#include "game_classification.hpp"
#include "game_config.hpp"
#include "game_config_manager.hpp"
#include "game_data.hpp"
#include "game_display.hpp"
#include "game_errors.hpp"
#include "game_events/conditional_wml.hpp"
#include "game_events/entity_location.hpp"
#include "game_events/manager.hpp"
#include "game_events/pump.hpp"
#include "game_preferences.hpp"
#include "help/help.hpp"
#include "image.hpp"
#include "log.hpp"
#include "utils/make_enum.hpp"
#include "map/map.hpp"
#include "map/label.hpp"
#include "map/location.hpp"
#include "mouse_events.hpp"
#include "mp_game_settings.hpp"
#include "pathfind/pathfind.hpp"
#include "pathfind/teleport.hpp"
#include "play_controller.hpp"
#include "recall_list_manager.hpp"
#include "replay.hpp"
#include "reports.hpp"
#include "scripting/lua_api.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_cpp_function.hpp"
#include "scripting/lua_gui2.hpp"
#include "scripting/lua_pathfind_cost_calculator.hpp"
#include "scripting/lua_race.hpp"
#include "scripting/lua_team.hpp"
#include "scripting/lua_types.hpp"
#include "scripting/lua_unit_type.hpp"
#include "scripting/push_check.hpp"
#include "sdl/utils.hpp"
#include "side_filter.hpp"
#include "sound.hpp"
#include "soundsource.hpp"
#include "synced_context.hpp"
#include "synced_user_choice.hpp"
#include "team.hpp"
#include "terrain/terrain.hpp"
#include "terrain/filter.hpp"
#include "terrain/translation.hpp"
#include "terrain/type_data.hpp"
#include "time_of_day.hpp"
#include "tod_manager.hpp"
#include "tstring.hpp"
#include "units/unit.hpp"
#include "units/animation_component.hpp"
#include "units/udisplay.hpp"
#include "units/filter.hpp"
#include "units/map.hpp"
#include "units/ptr.hpp"
#include "units/types.hpp"
#include "util.hpp"
#include "variable.hpp"
#include "variable_info.hpp"
#include "wml_exception.hpp"
#include "utils/functional.hpp"
#include <boost/intrusive_ptr.hpp>
#include <boost/optional.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/tuple/tuple.hpp>
#include <cassert>
#include <cstring>
#include <iterator>
#include <map>
#include <new>
#include <set>
#include <sstream>
#include <utility>
#include <algorithm>
#include <vector>
#include <SDL_timer.h>
#include <SDL_video.h>
#include "lua/lauxlib.h"
#include "lua/lua.h"
Go to the source code of this file.
Classes | |
struct | map_locker |
Macros | |
#define | LOG_LUA LOG_STREAM(info, log_scripting_lua) |
#define | WRN_LUA LOG_STREAM(warn, log_scripting_lua) |
#define | ERR_LUA LOG_STREAM(err, log_scripting_lua) |
Typedefs | |
typedef int(game_lua_kernel::* | member_callback )(lua_State *) |
typedef int(game_lua_kernel::* | member_callback2 )(lua_State *, bool) |
Functions | |
static int | special_locations_len (lua_State *L) |
static int | special_locations_next (lua_State *L) |
static int | special_locations_pairs (lua_State *L) |
static int | special_locations_index (lua_State *L) |
static int | special_locations_newindex (lua_State *L) |
static void | push_locations_talbe (lua_State *L) |
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_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_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_variables_get (lua_State *L) |
Gets the variable of a unit (__index metamethod). More... | |
static int | impl_unit_attacks_get (lua_State *L) |
Gets the attacks of a unit or unit type (__index metamethod). More... | |
static int | impl_unit_attacks_len (lua_State *L) |
Counts the attacks of a unit (__len metamethod). More... | |
static int | impl_unit_attack_get (lua_State *L) |
Gets a propoerty of a units attack (__index metamethod). More... | |
static int | impl_unit_attack_set (lua_State *L) |
Gets a propoerty of a units attack (__index metamethod). More... | |
static int | impl_unit_variables_set (lua_State *L) |
Sets the variable of a unit (__newindex metamethod). More... | |
static int | intf_get_viewing_side (lua_State *L) |
Gets currently viewing side. More... | |
static int | intf_get_era (lua_State *L) |
Gets a table for an era tag. More... | |
static int | intf_debug (lua_State *L) |
Dumps a wml table or userdata wml object into a pretty string. More... | |
static int | intf_eval_conditional (lua_State *L) |
Evaluates a boolean WML conditional. More... | |
static bool | intf_find_cost_map_helper (const unit *ptr) |
template<typename T > | |
static int | load_fake_units (lua_State *L, int arg, T &fake_units) |
static int | intf_create_unit (lua_State *L) |
Creates a unit from its WML description. More... | |
static int | intf_copy_unit (lua_State *L) |
Copies a unit. More... | |
static int | intf_unit_resistance (lua_State *L) |
Returns unit resistance against a given attack type. More... | |
static int | intf_unit_movement_cost (lua_State *L) |
Returns unit movement cost on a given terrain. More... | |
static int | intf_unit_vision_cost (lua_State *L) |
Returns unit vision cost on a given terrain. More... | |
static int | intf_unit_jamming_cost (lua_State *L) |
Returns unit jamming cost on a given terrain. More... | |
static int | intf_unit_defense (lua_State *L) |
Returns unit defense on a given terrain. More... | |
static int | intf_unit_ability (lua_State *L) |
Returns true if the unit has the given ability enabled. More... | |
static int | intf_transform_unit (lua_State *L) |
Changes a unit to the given unit type. More... | |
static void | luaW_pushsimdata (lua_State *L, const combatant &cmb) |
Puts a table at the top of the stack with some combat result. More... | |
static void | luaW_pushsimweapon (lua_State *L, const battle_context_unit_stats &bcustats) |
Puts a table at the top of the stack with information about the combatants' weapons. More... | |
static int | intf_set_music (lua_State *L) |
Modifies the music playlist. More... | |
static int | intf_synchronize_choice (lua_State *L) |
Ensures a value is synchronized among all the clients. More... | |
static int | intf_synchronize_choices (lua_State *L) |
Ensures a value is synchronized among all the clients. More... | |
static int | intf_do_unsynced (lua_State *L) |
Calls a function in an unsynced context (this specially means that all random calls used by that function will be unsynced). More... | |
static int | intf_get_traits (lua_State *L) |
.Returns information about the global traits known to the engine. More... | |
static int | intf_add_modification (lua_State *L) |
Adds a modification to a unit. More... | |
static int | intf_advance_unit (lua_State *L) |
Advances a unit if the unit has enough xp. More... | |
static int | intf_add_known_unit (lua_State *L) |
Adds a new known unit type to the help system. More... | |
static int | intf_get_image_size (lua_State *L) |
Gets the dimension of an image. More... | |
static int | intf_get_time_stamp (lua_State *L) |
Returns the time stamp, exactly as [set_variable] time=stamp does. More... | |
static int | intf_modify_ai (lua_State *L) |
Lua frontend to the modify_ai functionality. More... | |
static int | cfun_exec_candidate_action (lua_State *L) |
static int | cfun_exec_stage (lua_State *L) |
static void | push_component (lua_State *L, ai::component *c, const std::string &ct="") |
static int | intf_debug_ai (lua_State *L) |
Debug access to the ai tables. More... | |
template<member_callback method> | |
int | dispatch (lua_State *L) |
template<member_callback2 method, bool b> | |
int | dispatch2 (lua_State *L) |
static bool | is_handled_file_tag (const std::string &s) |
Variables | |
static lg::log_domain | log_scripting_lua ("scripting/lua") |
static char const * | handled_file_tags [] |
These are the child tags of [scenario] (and the like) that are handled elsewhere (in the C++ code). More... | |
Provides a Lua interpreter, to be embedded in WML.
Definition in file game_lua_kernel.cpp.
#define ERR_LUA LOG_STREAM(err, log_scripting_lua) |
Definition at line 147 of file game_lua_kernel.cpp.
Referenced by game_lua_kernel::apply_effect(), game_lua_kernel::intf_add_sound_source(), game_lua_kernel::intf_kill(), game_lua_kernel::intf_replace_schedule(), and game_lua_kernel::intf_select_hex().
#define LOG_LUA LOG_STREAM(info, log_scripting_lua) |
Definition at line 145 of file game_lua_kernel.cpp.
Referenced by game_lua_kernel::impl_game_config_get(), game_lua_kernel::impl_game_config_set(), game_lua_kernel::intf_add_time_area(), intf_debug_ai(), game_lua_kernel::intf_get_sides(), game_lua_kernel::intf_message(), game_lua_kernel::intf_modify_side(), game_lua_kernel::intf_remove_time_area(), and game_lua_kernel::intf_replace_schedule().
#define WRN_LUA LOG_STREAM(warn, log_scripting_lua) |
Definition at line 146 of file game_lua_kernel.cpp.
Referenced by game_lua_kernel::get_sides_vector(), game_lua_kernel::intf_clear_menu_item(), game_lua_kernel::intf_kill(), game_lua_kernel::intf_match_unit(), and game_lua_kernel::intf_put_unit().
Definition at line 4485 of file game_lua_kernel.cpp.
Definition at line 4493 of file game_lua_kernel.cpp.
Definition at line 3904 of file game_lua_kernel.cpp.
References ai::candidate_action::evaluate(), ai::candidate_action::execute(), lua_getfield(), lua_pop, lua_pushinteger(), lua_touserdata(), and luaW_toboolean().
Referenced by push_component().
Definition at line 3921 of file game_lua_kernel.cpp.
References lua_getfield(), lua_pop, lua_touserdata(), and ai::stage::play_stage().
Referenced by push_component().
Definition at line 4488 of file game_lua_kernel.cpp.
Definition at line 4496 of file game_lua_kernel.cpp.
Gets a propoerty of a units attack (__index metamethod).
Definition at line 688 of file game_lua_kernel.cpp.
References unit::attacks(), lua_istable, lua_rawgeti(), luaL_argerror(), luaL_checkstring, luaL_typerror(), luaW_tounit(), return_cfgref_attrib, return_int_attrib, and return_string_attrib.
Referenced by game_lua_kernel::game_lua_kernel().
Gets a propoerty of a units attack (__index metamethod).
Definition at line 735 of file game_lua_kernel.cpp.
References unit::attacks(), lua_istable, lua_rawgeti(), luaL_argerror(), luaL_checkstring, luaL_typerror(), luaW_checkconfig(), luaW_tounit(), modify_int_attrib, modify_string_attrib, modify_tstring_attrib, and return_cfgref_attrib.
Referenced by game_lua_kernel::game_lua_kernel().
Gets the attacks of a unit or unit type (__index metamethod).
Definition at line 609 of file game_lua_kernel.cpp.
References schema_validation::at(), unit_type::attacks(), unit::attacks(), attack_type::id(), lua_createtable(), lua_isnumber(), lua_istable, lua_pushlightuserdata(), lua_pushstring(), lua_pushvalue(), lua_rawget(), lua_rawgeti(), lua_rawseti(), LUA_REGISTRYINDEX, lua_setmetatable(), luaL_argerror(), luaL_checkinteger(), luaL_checkstring, luaL_testudata(), luaL_typerror(), luaW_tounit(), and uattackKey.
Referenced by game_lua_kernel::game_lua_kernel().
Counts the attacks of a unit (__len metamethod).
Definition at line 668 of file game_lua_kernel.cpp.
References unit::attacks(), lua_istable, lua_pushinteger(), lua_rawgeti(), luaL_argerror(), luaL_typerror(), and luaW_tounit().
Referenced by game_lua_kernel::game_lua_kernel().
Destroys a unit object before it is collected (__gc metamethod).
Definition at line 318 of file game_lua_kernel.cpp.
References lua_touserdata().
Referenced by game_lua_kernel::game_lua_kernel().
Checks two lua proxy units for equality.
(__eq metamethod)
Definition at line 328 of file game_lua_kernel.cpp.
References lua_pushboolean(), luaW_checkunit(), right, and unit::underlying_id().
Referenced by game_lua_kernel::game_lua_kernel().
Gets some data on a unit (__index metamethod).
Definition at line 343 of file game_lua_kernel.cpp.
References unit::absolute_image(), unit::advances_to(), unit::alignment(), unit::attacks_left(), unit::big_profile(), unit::can_recruit(), unit::cost(), unit::effect_image_mods(), unit::experience(), unit::facing(), unit::gender(), gender_string(), lua_unit::get(), unit::get_ability_list(), unit::get_emit_zoc(), unit::get_hidden(), unit::get_location(), unit::get_role(), unit::get_traits_list(), unit::hitpoints(), unit_race::id(), unit::id(), unit::image_mods(), unit::incapacitated(), unit::level(), lua_createtable(), lua_push(), lua_pushinteger(), lua_pushlightuserdata(), lua_pushstring(), lua_pushvalue(), lua_rawget(), lua_rawseti(), LUA_REGISTRYINDEX, lua_setmetatable(), lua_touserdata(), luaL_argerror(), luaL_checkstring, unit::max_attacks(), unit::max_experience(), unit::max_hitpoints(), unit::modification_advancements(), unit::movement_left(), unit::name(), lua_unit::on_map(), lua_unit::on_recall_list(), unit::overlays(), unit::race(), unit::recall_cost(), unit::recruits(), unit::resting(), return_bool_attrib, return_cfg_attrib, return_int_attrib, return_string_attrib, return_tstring_attrib, return_vector_string_attrib, unit::side(), unit::total_movement(), unit::type_id(), uattacksKey, unitvarKey, unit::upkeep_raw(), unit::usage(), ustatusKey, unit::variation(), map_location::write(), unit::write(), map_location::write_direction(), map_location::x, and map_location::y.
Referenced by game_lua_kernel::game_lua_kernel().
Sets some data on a unit (__newindex metamethod).
Definition at line 479 of file game_lua_kernel.cpp.
References lua_unit::get(), unit::get_location(), lua_check(), lua_isnumber(), lua_touserdata(), luaL_argerror(), luaL_checkint, luaL_checkstring, modify_bool_attrib, modify_int_attrib, modify_string_attrib, modify_tstring_attrib, modify_vector_string_attrib, lua_unit::on_map(), map_location::parse_direction(), unit::set_advancements(), unit::set_advances_to(), unit::set_alignment(), unit::set_attacks(), unit::set_can_recruit(), unit::set_emit_zoc(), unit::set_experience(), unit::set_facing(), unit::set_hidden(), unit::set_hitpoints(), unit::set_level(), unit::set_location(), unit::set_movement(), unit::set_name(), unit::set_recall_cost(), unit::set_recruits(), unit::set_resting(), unit::set_role(), unit::set_side(), unit::set_upkeep(), map_location::x, and map_location::y.
Referenced by game_lua_kernel::game_lua_kernel().
Gets the status of a unit (__index metamethod).
Definition at line 554 of file game_lua_kernel.cpp.
References unit::get_state(), lua_istable, lua_pushboolean(), lua_rawgeti(), luaL_argerror(), luaL_checkstring, luaL_typerror(), and luaW_tounit().
Referenced by game_lua_kernel::game_lua_kernel().
Sets the status of a unit (__newindex metamethod).
Definition at line 572 of file game_lua_kernel.cpp.
References lua_istable, lua_rawgeti(), luaL_argerror(), luaL_checkstring, luaL_typerror(), luaW_toboolean(), luaW_tounit(), and unit::set_state().
Referenced by game_lua_kernel::game_lua_kernel().
Gets the variable of a unit (__index metamethod).
Definition at line 590 of file game_lua_kernel.cpp.
References lua_istable, lua_rawgeti(), luaL_argerror(), luaL_checkstring, luaL_typerror(), luaW_pushvariable(), luaW_tounit(), return_cfgref_attrib, and unit::variables().
Referenced by game_lua_kernel::game_lua_kernel().
Sets the variable of a unit (__newindex metamethod).
Definition at line 787 of file game_lua_kernel.cpp.
References lua_istable, lua_rawgeti(), luaL_argerror(), luaL_checkstring, luaL_typerror(), luaW_checkconfig(), luaW_checkvariable(), luaW_tounit(), and unit::variables().
Referenced by game_lua_kernel::game_lua_kernel().
Adds a new known unit type to the help system.
Definition at line 3549 of file game_lua_kernel.cpp.
References preferences::encountered_units(), unit_type_data::find(), luaL_argerror(), luaL_checkstring, and unit_types.
Referenced by game_lua_kernel::game_lua_kernel().
Adds a modification to a unit.
Definition at line 3501 of file game_lua_kernel.cpp.
References unit::add_modification(), lua_isnone, luaL_argerror(), luaL_checkstring, luaW_checkconfig(), luaW_checkunit(), luaW_toboolean(), and lg::wml_error().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Advances a unit if the unit has enough xp.
Definition at line 3529 of file game_lua_kernel.cpp.
References advance_unit_at(), advance_unit_params::animate(), advance_unit_params::fire_events(), unit::get_location(), lua_isboolean, luaW_checkunit(), and luaW_toboolean().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Copies a unit.
Definition at line 2662 of file game_lua_kernel.cpp.
References getunitKey, lua_newuserdata(), lua_pushlightuserdata(), lua_rawget(), LUA_REGISTRYINDEX, lua_setmetatable(), and luaW_checkunit().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Creates a unit from its WML description.
Definition at line 2645 of file game_lua_kernel.cpp.
References getunitKey, lua_newuserdata(), lua_pushlightuserdata(), lua_rawget(), LUA_REGISTRYINDEX, lua_setmetatable(), and luaW_checkconfig().
Referenced by game_lua_kernel::game_lua_kernel().
Dumps a wml table or userdata wml object into a pretty string.
Definition at line 1781 of file game_lua_kernel.cpp.
References config::debug(), lua_pushstring(), and luaW_checkconfig().
Referenced by game_lua_kernel::game_lua_kernel().
Debug access to the ai tables.
Definition at line 4005 of file game_lua_kernel.cpp.
References config::add_child(), ai::component_manager::add_component(), c, game_config::debug, ai::manager::get_active_ai_holder_for_side_dbg(), ai::ai_composite::get_ai_context(), ai::component::get_children(), ai::holder::get_component(), ai::configuration::get_default_ai_parameters(), i, LOG_LUA, lua_pop, lua_pushstring(), lua_rawset(), lua_tointeger, ai::engine_lua::push_ai_table(), push_component(), and ai::engine_lua::to_config().
Referenced by game_lua_kernel::game_lua_kernel().
Calls a function in an unsynced context (this specially means that all random calls used by that function will be unsynced).
This is usualy used together with an unsynced if like 'if controller != network'
Definition at line 3159 of file game_lua_kernel.cpp.
References lua_pushvalue(), and luaW_pcall().
Referenced by game_lua_kernel::game_lua_kernel().
Evaluates a boolean WML conditional.
Definition at line 1839 of file game_lua_kernel.cpp.
References cond(), game_events::conditional_passed(), lua_pushboolean(), and luaW_checkvconfig().
Referenced by game_lua_kernel::game_lua_kernel().
|
static |
Definition at line 2038 of file game_lua_kernel.cpp.
References unit::get_location(), and map_location::valid().
Referenced by game_lua_kernel::intf_find_cost_map().
Gets a table for an era tag.
Definition at line 1602 of file game_lua_kernel.cpp.
References game_config_manager::get(), luaL_checkstring, and luaW_pushconfig().
Referenced by game_lua_kernel::game_lua_kernel().
Gets the dimension of an image.
Definition at line 3870 of file game_lua_kernel.cpp.
References image::locator::file_exists(), image::get_image(), lua_pushinteger(), and luaL_checkstring.
Referenced by game_lua_kernel::game_lua_kernel().
Returns the time stamp, exactly as [set_variable] time=stamp does.
Definition at line 3885 of file game_lua_kernel.cpp.
References lua_pushinteger().
Referenced by game_lua_kernel::game_lua_kernel().
.Returns information about the global traits known to the engine.
Definition at line 3478 of file game_lua_kernel.cpp.
References lua_newtable, lua_pushstring(), lua_rawset(), luaW_pushconfig(), unit_type_data::traits(), and unit_types.
Referenced by game_lua_kernel::game_lua_kernel().
Gets currently viewing side.
Definition at line 809 of file game_lua_kernel.cpp.
References display::get_singleton(), lua_pushboolean(), and lua_pushinteger().
Referenced by game_lua_kernel::game_lua_kernel().
Lua frontend to the modify_ai functionality.
Definition at line 3895 of file game_lua_kernel.cpp.
References luaW_toconfig(), and ai::manager::modify_active_ai_for_side().
Referenced by game_lua_kernel::game_lua_kernel().
Modifies the music playlist.
Definition at line 2904 of file game_lua_kernel.cpp.
References sound::commit_music_changes(), lua_isnoneornil, luaW_checkconfig(), and sound::play_music_config().
Referenced by game_lua_kernel::game_lua_kernel().
Ensures a value is synchronized among all the clients.
Definition at line 3091 of file game_lua_kernel.cpp.
References _(), mp_sync::get_user_choice(), lua_isfunction, lua_tointeger, luaL_argerror(), luaW_pushconfig(), and luaW_totstring().
Referenced by game_lua_kernel::game_lua_kernel().
Ensures a value is synchronized among all the clients.
Definition at line 3126 of file game_lua_kernel.cpp.
References _(), mp_sync::get_user_choice_multiple_sides(), lua_isfunction, lua_push(), luaL_argerror(), and luaW_totstring().
Referenced by game_lua_kernel::game_lua_kernel().
Changes a unit to the given unit type.
Definition at line 2775 of file game_lua_kernel.cpp.
References unit::advance_to(), unit_type_data::find(), luaL_argerror(), luaL_checkstring, luaW_checkunit(), and unit_types.
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Returns true if the unit has the given ability enabled.
Definition at line 2762 of file game_lua_kernel.cpp.
References unit::get_ability_bool(), lua_pushboolean(), luaL_checkstring, and luaW_checkunit().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Returns unit defense on a given terrain.
Definition at line 2747 of file game_lua_kernel.cpp.
References unit::defense_modifier(), lua_pushinteger(), luaL_checkstring, luaW_checkunit(), and t_translation::read_terrain_code().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Returns unit jamming cost on a given terrain.
Definition at line 2732 of file game_lua_kernel.cpp.
References unit::jamming_cost(), lua_pushinteger(), luaL_checkstring, luaW_checkunit(), and t_translation::read_terrain_code().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Returns unit movement cost on a given terrain.
Definition at line 2702 of file game_lua_kernel.cpp.
References lua_pushinteger(), luaL_checkstring, luaW_checkunit(), unit::movement_cost(), and t_translation::read_terrain_code().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Returns unit resistance against a given attack type.
Definition at line 2681 of file game_lua_kernel.cpp.
References unit::get_location(), lua_isnoneornil, lua_pushinteger(), luaL_checkstring, luaW_checklocation(), luaW_checkunit(), luaW_toboolean(), and unit::resistance_against().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
Returns unit vision cost on a given terrain.
Definition at line 2717 of file game_lua_kernel.cpp.
References lua_pushinteger(), luaL_checkstring, luaW_checkunit(), t_translation::read_terrain_code(), and unit::vision_cost().
Referenced by game_lua_kernel::game_lua_kernel(), and game_lua_kernel::return_unit_method().
|
static |
Definition at line 4937 of file game_lua_kernel.cpp.
Referenced by game_lua_kernel::load_game(), and game_lua_kernel::save_game().
Definition at line 2043 of file game_lua_kernel.cpp.
References error(), i, lua_getfield(), lua_gettop(), lua_isnumber(), lua_isstring(), lua_istable, lua_rawgeti(), lua_rawlen(), lua_settop(), lua_tointeger, lua_tostring, luaL_argerror(), and luaW_tolocation().
Referenced by game_lua_kernel::intf_find_cost_map().
Puts a table at the top of the stack with some combat result.
Definition at line 2789 of file game_lua_kernel.cpp.
References combatant::average_hp(), combatant::hp_dist, i, lua_createtable(), lua_pushnumber(), lua_rawseti(), lua_setfield(), combatant::poisoned, and combatant::slowed.
Referenced by game_lua_kernel::intf_simulate_combat().
|
static |
Puts a table at the top of the stack with information about the combatants' weapons.
Definition at line 2810 of file game_lua_kernel.cpp.
References battle_context_unit_stats::attack_num, battle_context_unit_stats::backstab_pos, battle_context_unit_stats::chance_to_hit, battle_context_unit_stats::damage, battle_context_unit_stats::drain_constant, battle_context_unit_stats::drain_percent, battle_context_unit_stats::drains, battle_context_unit_stats::firststrike, attack_type::id(), lua_createtable(), lua_pushboolean(), lua_pushnumber(), lua_pushstring(), lua_setfield(), battle_context_unit_stats::num_blows, battle_context_unit_stats::petrifies, battle_context_unit_stats::plague_type, battle_context_unit_stats::plagues, battle_context_unit_stats::poisons, battle_context_unit_stats::rounds, battle_context_unit_stats::slows, and battle_context_unit_stats::weapon.
Referenced by game_lua_kernel::intf_simulate_combat().
|
static |
Definition at line 3930 of file game_lua_kernel.cpp.
References cfun_exec_candidate_action(), cfun_exec_stage(), ai::component::get_children(), ai::component::get_children_types(), ai::component::get_engine(), ai::component::get_id(), ai::component::get_name(), i, lua_createtable(), lua_pushcclosure(), lua_pushlightuserdata(), lua_pushstring(), and lua_rawset().
Referenced by intf_debug_ai().
Definition at line 274 of file game_lua_kernel.cpp.
References lua_newtable, lua_pushcfunction, lua_pushstring(), lua_rawset(), lua_setmetatable(), special_locations_index(), special_locations_len(), special_locations_newindex(), and special_locations_pairs().
Referenced by game_lua_kernel::game_lua_kernel().
Definition at line 251 of file game_lua_kernel.cpp.
References lua_createtable(), lua_pushnumber(), lua_rawseti(), and luaL_checkstring.
Referenced by push_locations_talbe().
Definition at line 210 of file game_lua_kernel.cpp.
References lua_pushnumber().
Referenced by push_locations_talbe().
Definition at line 268 of file game_lua_kernel.cpp.
References lua_error(), and lua_pushstring().
Referenced by push_locations_talbe().
Definition at line 216 of file game_lua_kernel.cpp.
References lua_createtable(), lua_isnoneornil, lua_pushnumber(), lua_pushstring(), lua_rawseti(), and luaL_checkstring.
Referenced by special_locations_pairs().
Definition at line 243 of file game_lua_kernel.cpp.
References lua_pushcfunction, lua_pushnil(), lua_pushvalue(), and special_locations_next().
Referenced by push_locations_talbe().
|
static |
These are the child tags of [scenario] (and the like) that are handled elsewhere (in the C++ code).
Any child tags not in this list will be passed to Lua's on_load event.
Definition at line 4929 of file game_lua_kernel.cpp.
|
static |