![]() |
naev 0.12.5
|
Handles the Lua munition bindings. More...
#include "nlua_munition.h"#include "array.h"#include "nlua.h"#include "nlua_faction.h"#include "nlua_outfit.h"#include "nlua_pilot.h"#include "nlua_vec2.h"#include "nluadef.h"
Go to the source code of this file.
Functions | |
| static Weapon * | munition_get (LuaMunition *lm) |
| static int | munitionL_eq (lua_State *L) |
| Checks to see if munition and p are the same. | |
| static int | munitionL_tostring (lua_State *L) |
| Gets the munition's current (translated) name or notes it is inexistent. | |
| static int | munitionL_exists (lua_State *L) |
| Checks to see if a munition still exists. | |
| static int | munitionL_clear (lua_State *L) |
| Clears all the munitions in the system. | |
| static int | munitionL_getAll (lua_State *L) |
| Gets all the munitions in the system. | |
| static int | munitionL_getInrange (lua_State *L) |
| Get munitions in range. Note that this can only get hittable munitions. | |
| static int | munitionL_pos (lua_State *L) |
| Gets the position of the munition. | |
| static int | munitionL_vel (lua_State *L) |
| Gets the velocity of the munition. | |
| static int | munitionL_faction (lua_State *L) |
| Gets the faction of the munition. | |
| static int | munitionL_parent (lua_State *L) |
| Gets the parent of the munition. | |
| static int | munitionL_target (lua_State *L) |
| Gets the target of the munition. | |
| static int | munitionL_outfit (lua_State *L) |
| Gets the outfit corresponding to the munition. | |
| static int | munitionL_strength (lua_State *L) |
| Gets the strength of a munition. | |
| static int | munitionL_strengthSet (lua_State *L) |
| Sets the strength of a munition. | |
| int | nlua_loadMunition (nlua_env env) |
| Loads the munition library. | |
| LuaMunition * | lua_tomunition (lua_State *L, int ind) |
| Lua bindings to interact with munitions. | |
| LuaMunition * | luaL_checkmunition (lua_State *L, int ind) |
| Gets munition at index or raises error if there is no munition at index. | |
| Weapon * | luaL_validmunition (lua_State *L, int ind) |
| Makes sure the munition is valid or raises a Lua error. | |
| LuaMunition * | lua_pushmunition (lua_State *L, const Weapon *w) |
| Pushes a weapon as a munition on the stack. | |
| int | lua_ismunition (lua_State *L, int ind) |
| Checks to see if ind is a munition. | |
| static int | weapon_isHostile (const Weapon *w, const Pilot *p) |
| Sees if a weapon is hostile to a pilot or not. | |
Variables | |
| static const luaL_Reg | munitionL_methods [] |
Handles the Lua munition bindings.
These bindings control the spobs and systems.
Definition in file nlua_munition.c.
| int lua_ismunition | ( | lua_State * | L, |
| int | ind ) |
Checks to see if ind is a munition.
| L | Lua state to check. |
| ind | Index position to check. |
Definition at line 156 of file nlua_munition.c.
| LuaMunition * lua_pushmunition | ( | lua_State * | L, |
| const Weapon * | w ) |
Pushes a weapon as a munition on the stack.
| L | Lua state to push munition into. |
| w | Weapon to push as munition. |
Definition at line 139 of file nlua_munition.c.
| LuaMunition * lua_tomunition | ( | lua_State * | L, |
| int | ind ) |
Lua bindings to interact with munitions.
This will allow you to create and manipulate munitions in-game.
Lua module: munition
Gets munition at index.
| L | Lua state to get munition from. |
| ind | Index position to find the munition. |
Definition at line 96 of file nlua_munition.c.
| LuaMunition * luaL_checkmunition | ( | lua_State * | L, |
| int | ind ) |
Gets munition at index or raises error if there is no munition at index.
| L | Lua state to get munition from. |
| ind | Index position to find munition. |
Definition at line 108 of file nlua_munition.c.
| Weapon * luaL_validmunition | ( | lua_State * | L, |
| int | ind ) |
Makes sure the munition is valid or raises a Lua error.
| L | State currently running. |
| ind | Index of the munition to validate. |
Definition at line 123 of file nlua_munition.c.
|
static |
Definition at line 190 of file nlua_munition.c.
|
static |
Clears all the munitions in the system.
| L | Lua State |
Lua function: clear
Definition at line 247 of file nlua_munition.c.
|
static |
Checks to see if munition and p are the same.
Lua usage parameter: if p == p2 then – Munition 'p' and 'p2' match.
Lua function parameter: Munition p Munition to compare. Lua function parameter: Munition comp Munition to compare against. Lua return parameter: boolean true if they are the same.
| L | Lua State |
Lua function: __eq
Definition at line 182 of file nlua_munition.c.
|
static |
Checks to see if a munition still exists.
Lua function parameter: Munition m Munition to see if still exists. Lua return parameter: boolean true if the munition still exists.
| L | Lua State |
Lua function: exists
Definition at line 235 of file nlua_munition.c.
|
static |
Gets the faction of the munition.
Lua function parameter: Munition m Munition to get property of. Lua return parameter: Faction Faction of the munition.
| L | Lua State |
Lua function: faction
Definition at line 386 of file nlua_munition.c.
|
static |
Gets all the munitions in the system.
Lua function parameter: boolean onlyhittable Whether or not to only get hittable munitions, or all of them. Lua return parameter: table A table containing all the munitions in the system.
| L | Lua State |
Lua function: getAll
Definition at line 262 of file nlua_munition.c.
|
static |
Get munitions in range. Note that this can only get hittable munitions.
Lua function parameter: Vec2 pos Position from which to get munitions. Lua function parameter: number range Range to get munitions from. Lua function parameter:[opt=nil] Pilot|nil Pilot to check hostility to. Lua return parameter: table A table containing all the munitions found in range.
| L | Lua State |
Lua function: getInrange
Definition at line 320 of file nlua_munition.c.
|
static |
Gets the outfit corresponding to the munition.
Lua function parameter: Munition m Munition to get corresponding outfit of. Lua return parameter: Outfit The outfit corresponding to the munition.
| L | Lua State |
Lua function: outfit
Definition at line 428 of file nlua_munition.c.
|
static |
Gets the parent of the munition.
Lua function parameter: Munition m Munition to get property of. Lua return parameter: Pilot Parent of the munition.
| L | Lua State |
Lua function: parent
Definition at line 400 of file nlua_munition.c.
|
static |
Gets the position of the munition.
Lua function parameter: Munition m Munition to get property of. Lua return parameter: Vec2 Position of the munition.
| L | Lua State |
Lua function: pos
Definition at line 358 of file nlua_munition.c.
|
static |
Gets the strength of a munition.
Defaults to 1. and only changed when past falloff range or modified by a Lua script.
Lua function parameter: Munition m Munition to get strength of. Lua return parameter: number The corresponding strength value where 1 indicates normal strength.
| L | Lua State |
Lua function: strength
Definition at line 447 of file nlua_munition.c.
|
static |
Sets the strength of a munition.
Lua function parameter: Munition m Munition to get strength of. Lua function parameter: number str Strength to set to. A value of 1 indicates normal strength.
| L | Lua State |
Lua function: strengthSet
Definition at line 463 of file nlua_munition.c.
|
static |
Gets the target of the munition.
Lua function parameter: Munition m Munition to get property of. Lua return parameter: Pilot Target of the munition.
| L | Lua State |
Lua function: target
Definition at line 414 of file nlua_munition.c.
|
static |
Gets the munition's current (translated) name or notes it is inexistent.
Lua usage parameter: tostring(p)
Lua function parameter: Munition p Munition to convert to string. Lua return parameter: string The current name of the munition or "(inexistent munition)" if not existent.
| L | Lua State |
Lua function: __tostring
Definition at line 217 of file nlua_munition.c.
|
static |
Gets the velocity of the munition.
Lua function parameter: Munition m Munition to get property of. Lua return parameter: Vec2 Velocity of the munition.
| L | Lua State |
Lua function: vel
Definition at line 372 of file nlua_munition.c.
| int nlua_loadMunition | ( | nlua_env | env | ) |
Loads the munition library.
| env | Environment to load library into. |
Definition at line 72 of file nlua_munition.c.
Sees if a weapon is hostile to a pilot or not.
Definition at line 286 of file nlua_munition.c.
|
static |
Munition metatable methods.
Definition at line 44 of file nlua_munition.c.