![]() |
naev 0.11.5
|
Handles the Lua pilot outfit (equipped) bindings. More...
#include "nlua_pilotoutfit.h"#include "array.h"#include "log.h"#include "nlua_asteroid.h"#include "nlua_outfit.h"#include "nlua_pilot.h"#include "nlua_munition.h"#include "nlua_vec2.h"#include "nluadef.h"#include "slots.h"#include "weapon.h"Go to the source code of this file.
Functions | |
| static int | poL_slot (lua_State *L) |
| Gets the properties of the outfit slot. | |
| static int | poL_outfit (lua_State *L) |
| Gets the outfit of the PilotOutfit. | |
| static int | poL_state (lua_State *L) |
| Sets the state of the PilotOutfit. | |
| static int | poL_progress (lua_State *L) |
| Sets the state progress of the PilotOutfit. | |
| static int | poL_set (lua_State *L) |
| Sets a temporary ship stat modifier of the pilot outfit. | |
| static int | poL_clear (lua_State *L) |
| Clears all the temporary ship stat modifiers of the pilot outfit. | |
| static int | poL_munition (lua_State *L) |
| Creates a munition. | |
| static int | poL_shoot (lua_State *L) |
| Shoots at an object. | |
| static int | poL_heat (lua_State *L) |
| Gets the heat status of the pilot outfit. | |
| static int | poL_heatup (lua_State *L) |
| Heats up a pilot outfit. | |
| int | nlua_loadPilotOutfit (nlua_env env) |
| Loads the pilot outfit library. | |
| PilotOutfitSlot * | lua_topilotoutfit (lua_State *L, int ind) |
| Lua bindings to interact with pilot outfits. | |
| PilotOutfitSlot * | luaL_checkpilotoutfit (lua_State *L, int ind) |
| Gets outfit at index or raises error if there is no outfit at index. | |
| PilotOutfitSlot * | luaL_validpilotoutfit (lua_State *L, int ind) |
| Makes sure the outfit is valid or raises a Lua error. | |
| PilotOutfitSlot ** | lua_pushpilotoutfit (lua_State *L, PilotOutfitSlot *po) |
| Pushes a pilot outfit on the stack. | |
| int | lua_ispilotoutfit (lua_State *L, int ind) |
| Checks to see if ind is a pilot outfit. | |
| static Target | lua_totarget (lua_State *L, int idx) |
Variables | |
| int | pilotoutfit_modified = 0 |
| static const luaL_Reg | poL_methods [] |
Handles the Lua pilot outfit (equipped) bindings.
Definition in file nlua_pilotoutfit.c.
| int lua_ispilotoutfit | ( | lua_State * | L, |
| int | ind ) |
Checks to see if ind is a pilot outfit.
| L | Lua state to check. |
| ind | Index position to check. |
Definition at line 142 of file nlua_pilotoutfit.c.
| PilotOutfitSlot ** lua_pushpilotoutfit | ( | lua_State * | L, |
| PilotOutfitSlot * | po ) |
Pushes a pilot outfit on the stack.
| L | Lua state to push outfit into. |
| po | Pilot outfit to push. |
Definition at line 127 of file nlua_pilotoutfit.c.
| PilotOutfitSlot * lua_topilotoutfit | ( | lua_State * | L, |
| int | ind ) |
Lua bindings to interact with pilot outfits.
Lua module: pilotoutfit
Gets outfit at index.
| L | Lua state to get outfit from. |
| ind | Index position to find the outfit. |
Definition at line 79 of file nlua_pilotoutfit.c.
|
static |
Definition at line 301 of file nlua_pilotoutfit.c.
| PilotOutfitSlot * luaL_checkpilotoutfit | ( | lua_State * | L, |
| int | ind ) |
Gets outfit at index or raises error if there is no outfit at index.
| L | Lua state to get outfit from. |
| ind | Index position to find outfit. |
Definition at line 90 of file nlua_pilotoutfit.c.
| PilotOutfitSlot * luaL_validpilotoutfit | ( | lua_State * | L, |
| int | ind ) |
Makes sure the outfit is valid or raises a Lua error.
| L | State currently running. |
| ind | Index of the outfit to validate. |
Definition at line 104 of file nlua_pilotoutfit.c.
| int nlua_loadPilotOutfit | ( | nlua_env | env | ) |
Loads the pilot outfit library.
| env | Environment to load pilot outfit library into. |
Definition at line 61 of file nlua_pilotoutfit.c.
|
static |
Clears all the temporary ship stat modifiers of the pilot outfit.
Lua function parameter: PilotOutfit po Pilot outfit to clear temporary modifiers from.
| L | Lua State |
Lua function: clear
Definition at line 292 of file nlua_pilotoutfit.c.
|
static |
Gets the heat status of the pilot outfit.
Lua function parameter: PilotOutfit po Pilot outfit to get heat of. Lua function parameter: Boolean absolute If true returns the value in kelvin, otherwise it returns how overheated it is with 1. being normal and 0. being overheated. Lua return parameter: Number heat of the pilot outfit in kelvin or closeness to 800 kelvin.
| L | Lua State |
Lua function: heat
Definition at line 453 of file nlua_pilotoutfit.c.
|
static |
Heats up a pilot outfit.
Lua function parameter: PilotOutfit po Pilot outfit to heat up.
| L | Lua State |
Lua function: heatup
Definition at line 476 of file nlua_pilotoutfit.c.
|
static |
Creates a munition.
Lua function parameter: PilotOutfit po Pilot outfit originating the munition. Lua function parameter: Pilot p Pilot generating the munition, used for faction and damaging purposes. Lua function parameter:[opt=po:outfit()] Outfit o Outfit to be used as a reference for the munition. Lua function parameter:[opt=nil] Pilot|Munition|Asteroid|nil t Target pilot to shoot at. Lua function parameter:[opt=p:dir()] number dir Direction the munition should face. Lua function parameter:[opt=p:pos()] Vec2 pos Position to create the munition at. Lua function parameter:[opt=p:vel()] Vec2 vel Initial velocity of the munition. The munition's base velocity gets added to this. Lua function parameter:[opt=false] boolean noaim Whether or not to disable the tracking and aiming framework when shooting. Lua return parameter: Munition The newly created munition.
| L | Lua State |
Lua function: munition
Definition at line 343 of file nlua_pilotoutfit.c.
|
static |
Gets the outfit of the PilotOutfit.
Lua function parameter: PilotOutfit po Pilot outfit to get the outfit of. Lua function parameter: Outfit Outfit corresponding to the Pilot outfit.
| L | Lua State |
Lua function: outfit
Definition at line 209 of file nlua_pilotoutfit.c.
|
static |
Sets the state progress of the PilotOutfit.
Lua function parameter: PilotOutfit po Pilot outfit to set the state of. Lua function parameter: number progress Progress of the current state with 1 being started and 0 being done.
| L | Lua State |
Lua function: progress
Definition at line 257 of file nlua_pilotoutfit.c.
|
static |
Sets a temporary ship stat modifier of the pilot outfit.
Lua function parameter: PilotOutfit po Pilot outfit to set the modifier of. Lua function parameter: string mod Modifier name to set to. Same as in the XML definition. Lua function parameter: number val Value to set the modifier to. In the case of booleans, 0 indicates false, while 1 indicates true.
| L | Lua State |
Lua function: set
Definition at line 276 of file nlua_pilotoutfit.c.
|
static |
Shoots at an object.
Lua function parameter: PilotOutfit po Pilot outfit originating the munition. Lua function parameter: Pilot p Pilot shooting, used for faction and damaging purposes. Lua function parameter:[opt=nil] Pilot|Munition|Asteroid|nil t Target pilot to shoot at. Lua function parameter:[opt=false] boolean stagger Whether or not to stagger similar outfits. Lua return parameter: boolean true if was able to shoot, false otherwise.
| L | Lua State |
Lua function: shoot
Definition at line 368 of file nlua_pilotoutfit.c.
|
static |
Gets the properties of the outfit slot.
Lua function parameter: PilotOutfit po Pilot outfit to get the outfit of. Lua return parameter: A table with slot properties string "size", string "type", string "property", boolean "required", boolean "exclusive", and boolean "locked". (Strings are English.)
| L | Lua State |
Lua function: slot
Definition at line 166 of file nlua_pilotoutfit.c.
|
static |
Sets the state of the PilotOutfit.
Lua function parameter: PilotOutfit po Pilot outfit to set the state of. Lua function parameter: string state State to set the pilot outfit to. Can be either "off", "warmup", "on", or "cooldown".
| L | Lua State |
Lua function: state
Definition at line 223 of file nlua_pilotoutfit.c.
| int pilotoutfit_modified = 0 |
Definition at line 28 of file nlua_pilotoutfit.c.
|
static |
Pilot outfit metatable methods.
Definition at line 41 of file nlua_pilotoutfit.c.