![]() |
naev 0.12.5
|
Lua jump module. More...
#include "nlua_jump.h"#include "land_outfits.h"#include "map_overlay.h"#include "nlua_pilot.h"#include "nlua_system.h"#include "nlua_vec2.h"#include "nluadef.h"
Go to the source code of this file.
Functions | |
| static RETURNS_NONNULL JumpPoint * | luaL_validjumpSystem (lua_State *L, int ind, int *offset) |
| Back-end for luaL_validjump. | |
| static int | jumpL_get (lua_State *L) |
| Gets a jump. | |
| static int | jumpL_eq (lua_State *L) |
| You can use the '==' operator within Lua to compare jumps with this. | |
| static int | jumpL_tostring (lua_State *L) |
| Converts a jump to readable form. Mainly meant to be used for printing. | |
| static int | jumpL_reverse (lua_State *L) |
| Gets the opposite jump. | |
| static int | jumpL_radius (lua_State *L) |
| Gets the jump's radius. | |
| static int | jumpL_position (lua_State *L) |
| Gets the position of the jump in the system. | |
| static int | jumpL_angle (lua_State *L) |
| Gets the angle of a jump in radians. | |
| static int | jumpL_hide (lua_State *L) |
| Gets the hide value of a jump in radians. | |
| static int | jumpL_hidden (lua_State *L) |
| Checks whether a jump is hidden. | |
| static int | jumpL_exitonly (lua_State *L) |
| Checks whether a jump is exit-only. | |
| static int | jumpL_system (lua_State *L) |
| Gets the system that a jump point exists in. | |
| static int | jumpL_dest (lua_State *L) |
| Gets the system that a jump point exits into. | |
| static int | jumpL_jumpDist (lua_State *L) |
| Gets the distance from the jump point at which the pilot can jump. | |
| static int | jumpL_isKnown (lua_State *L) |
| Checks to see if a jump is known by the player. | |
| static int | jumpL_setKnown (lua_State *L) |
| Sets a jump's known state. | |
| int | nlua_loadJump (nlua_env env) |
| Loads the jump library. | |
| LuaJump * | lua_tojump (lua_State *L, int ind) |
| This module allows you to handle the jumps from Lua. | |
| LuaJump * | luaL_checkjump (lua_State *L, int ind) |
| Gets jump at index raising an error if isn't a jump. | |
| JumpPoint * | luaL_validjump (lua_State *L, int ind) |
| Gets a jump directly. | |
| LuaJump * | lua_pushjump (lua_State *L, LuaJump jump) |
| Pushes a jump on the stack. | |
| int | lua_isjump (lua_State *L, int ind) |
| Checks to see if ind is a jump. | |
Variables | |
| static const luaL_Reg | jump_methods [] |
Lua jump module.
Definition in file nlua_jump.c.
|
static |
Gets the angle of a jump in radians.
Lua usage parameter: v = j:angle() Lua function parameter: Jump j Jump to get the angle of. Lua return parameter: number The angle.
| L | Lua State |
Lua function: angle
Definition at line 364 of file nlua_jump.c.
|
static |
Gets the system that a jump point exits into.
Lua usage parameter: v = j:dest() Lua function parameter: Jump j Jump to get the destination of. Lua return parameter: System The jump's destination system.
| L | Lua State |
Lua function: dest
Definition at line 425 of file nlua_jump.c.
|
static |
You can use the '==' operator within Lua to compare jumps with this.
Lua usage parameter: if j:__eq( jump.get( "Rhu", "Ruttwi" ) ) then – Do something Lua function parameter: Jump j Jump comparing. Lua function parameter: Jump comp jump to compare against. Lua return parameter: boolean true if both jumps are the same.
| L | Lua State |
Lua function: __eq
Definition at line 266 of file nlua_jump.c.
|
static |
Checks whether a jump is exit-only.
Lua usage parameter: if jump.exitonly("Eneguoz", "Zied") then – The jump point in Eneguoz cannot be entered. Lua function parameter: Jump j Jump to get the exit-only status of. Lua return parameter: boolean Whether the jump is exit-only.
| L | Lua State |
Lua function: exitonly
Definition at line 395 of file nlua_jump.c.
|
static |
Gets a jump.
Possible values of params:
Lua usage parameter: j,r = jump.get( "Ogat", "Goddard" ) – Returns the Ogat to Goddard and Goddard to Ogat jumps. Lua function parameter: string|System src See description. Lua function parameter: string|System dest See description. Lua return parameter: Jump Returns the jump. Lua return parameter: Jump Returns the inverse.
| L | Lua State |
Lua function: get
Definition at line 233 of file nlua_jump.c.
|
static |
Checks whether a jump is hidden.
Lua usage parameter: if not j:hidden() then – Exclude hidden jumps. Lua function parameter: Jump j Jump to get the hidden status of. Lua return parameter: boolean Whether the jump is hidden.
| L | Lua State |
Lua function: hidden
Definition at line 379 of file nlua_jump.c.
|
static |
Gets the hide value of a jump in radians.
Lua usage parameter: v = j:hide() Lua function parameter: Jump j Jump to get the hide value of. Lua return parameter: number The hide value.
| L | Lua State |
Lua function: hide
Definition at line 349 of file nlua_jump.c.
|
static |
Checks to see if a jump is known by the player.
Lua usage parameter: b = j:known()
Lua function parameter: Jump j Jump to check if the player knows. Lua return parameter: boolean true if the player knows the jump.
| L | Lua State |
Lua function: known
Definition at line 458 of file nlua_jump.c.
|
static |
Gets the distance from the jump point at which the pilot can jump.
Lua usage parameter: d = j:jumpDist( player.pilot() ) Lua function parameter: Jump j Jump to get the jump distance of. Lua function parameter: Pilot p Pilot to get information for. Lua return parameter: number The distance from the jump at which the pilot can jump.
| L | Lua State |
Lua function: dest
Definition at line 441 of file nlua_jump.c.
|
static |
Gets the position of the jump in the system.
Lua usage parameter: v = j:pos() Lua function parameter: Jump j Jump to get the position of. Lua return parameter: Vec2 The position of the jump in the system.
| L | Lua State |
Lua function: pos
Definition at line 334 of file nlua_jump.c.
|
static |
Gets the jump's radius.
Lua usage parameter: radius = j:radius() Lua function parameter: Jump j Jump to get the radius of. Lua return parameter: number The jump's radius.
| L | Lua State |
Lua function: radius
Definition at line 319 of file nlua_jump.c.
|
static |
Gets the opposite jump.
Lua function parameter: Jump j Jump to get the reverse jump of. Lua return parameter: Jump The jump in the opposite direction.
| L | Lua State |
Lua function: reverse
Definition at line 301 of file nlua_jump.c.
|
static |
Sets a jump's known state.
Note that this affects both sides of the jump connection to avoid getting the player locked away.
Lua usage parameter: j:setKnown( false ) – Makes jump unknown. Lua function parameter: Jump j Jump to set known. Lua function parameter:[opt=true] boolean value Whether or not to set as known.
| L | Lua State |
Lua function: setKnown
Definition at line 476 of file nlua_jump.c.
|
static |
Gets the system that a jump point exists in.
Lua usage parameter: s = j:system() Lua function parameter: Jump j Jump to get the system of. Lua return parameter: System The jump's system.
| L | Lua State |
Lua function: system
Definition at line 410 of file nlua_jump.c.
|
static |
Converts a jump to readable form. Mainly meant to be used for printing.
Lua function parameter: Jump j Jump to print.
| L | Lua State |
Lua function: __tostring
Definition at line 282 of file nlua_jump.c.
| int lua_isjump | ( | lua_State * | L, |
| int | ind ) |
Checks to see if ind is a jump.
| L | Lua state to check. |
| ind | Index to check. |
Definition at line 202 of file nlua_jump.c.
Pushes a jump on the stack.
| L | Lua state to push jump into. |
| jump | Jump to push. |
Definition at line 186 of file nlua_jump.c.
| LuaJump * lua_tojump | ( | lua_State * | L, |
| int | ind ) |
This module allows you to handle the jumps from Lua.
Generally you do something like:
Lua module: jump
Gets jump at index.
| L | Lua state to get jump from. |
| ind | Index position to find the jump. |
Definition at line 95 of file nlua_jump.c.
| LuaJump * luaL_checkjump | ( | lua_State * | L, |
| int | ind ) |
Gets jump at index raising an error if isn't a jump.
| L | Lua state to get jump from. |
| ind | Index to check. |
Definition at line 106 of file nlua_jump.c.
| JumpPoint * luaL_validjump | ( | lua_State * | L, |
| int | ind ) |
Gets a jump directly.
| L | Lua state to get jump from. |
| ind | Index to check. |
Definition at line 174 of file nlua_jump.c.
|
static |
Back-end for luaL_validjump.
| L | Lua state to get jump from. | |
| ind | Index to check. | |
| [out] | offset | How many Lua arguments were passed. |
Definition at line 124 of file nlua_jump.c.
| int nlua_loadJump | ( | nlua_env | env | ) |
Loads the jump library.
| env | Environment to load jump library into. |
Definition at line 68 of file nlua_jump.c.
|
static |
Jump metatable methods.
Definition at line 44 of file nlua_jump.c.