Naev

Module pilotoutfit

Lua bindings to interact with pilot outfits.

Functions

slot (po) Gets the properties of the outfit slot.
outfit (po, Outfit) Gets the outfit of the PilotOutfit.
state (po, state) Sets the state of the PilotOutfit.
progress (po, progress) Sets the state progress of the PilotOutfit.
set (po, mod, val) Sets a temporary ship stat modifier of the pilot outfit.
clear (po) Clears all the temporary ship stat modifiers of the pilot outfit.
munition (po, p[, o=po:outfit()[, t=nil[, dir=p:dir()[, pos=p:pos()[, vel=p:vel()[, noaim=false]]]]]]) Creates a munition.
shoot (po, p[, t=nil[, stagger=false]]) Shoots at an object.
heat (po, absolute) Gets the heat status of the pilot outfit.
heatup (po) Heats up a pilot outfit.


Functions

slot (po)
Gets the properties of the outfit slot. string "property", boolean "required", boolean "exclusive", and boolean "locked". (Strings are English.)

Parameters:

  • po PilotOutfit Pilot outfit to get the outfit of.

Returns:

    A table with slot properties string "size", string "type",
outfit (po, Outfit)
Gets the outfit of the PilotOutfit.

Parameters:

  • po PilotOutfit Pilot outfit to get the outfit of.
  • Outfit Outfit corresponding to the Pilot outfit.
state (po, state)
Sets the state of the PilotOutfit.

Parameters:

  • po PilotOutfit Pilot outfit to set the state of.
  • state string State to set the pilot outfit to. Can be either "off", "warmup", "on", or "cooldown".
progress (po, progress)
Sets the state progress of the PilotOutfit.

Parameters:

  • po PilotOutfit Pilot outfit to set the state of.
  • progress number Progress of the current state with 1 being started and 0 being done.
set (po, mod, val)
Sets a temporary ship stat modifier of the pilot outfit.

Parameters:

  • po PilotOutfit Pilot outfit to set the modifier of.
  • mod string Modifier name to set to. Same as in the XML definition.
  • val number Value to set the modifier to. In the case of booleans, 0 indicates false, while 1 indicates true.
clear (po)
Clears all the temporary ship stat modifiers of the pilot outfit.

Parameters:

  • po PilotOutfit Pilot outfit to clear temporary modifiers from.
munition (po, p[, o=po:outfit()[, t=nil[, dir=p:dir()[, pos=p:pos()[, vel=p:vel()[, noaim=false]]]]]])
Creates a munition.

Parameters:

  • po PilotOutfit Pilot outfit originating the munition.
  • p Pilot Pilot generating the munition, used for faction and damaging purposes.
  • o Outfit Outfit to be used as a reference for the munition. (default po:outfit())
  • t Pilot, Munition, Asteroid or nil Target pilot to shoot at. (default nil)
  • dir number Direction the munition should face. (default p:dir())
  • pos Vec2 Position to create the munition at. (default p:pos())
  • vel Vec2 Initial velocity of the munition. The munition's base velocity gets added to this. (default p:vel())
  • noaim boolean Whether or not to disable the tracking and aiming framework when shooting. (default false)

Returns:

    Munition The newly created munition.
shoot (po, p[, t=nil[, stagger=false]])
Shoots at an object.

Parameters:

  • po PilotOutfit Pilot outfit originating the munition.
  • p Pilot Pilot shooting, used for faction and damaging purposes.
  • t Pilot, Munition, Asteroid or nil Target pilot to shoot at. (default nil)
  • stagger boolean Whether or not to stagger similar outfits. (default false)

Returns:

    boolean true if was able to shoot, false otherwise.
heat (po, absolute)
Gets the heat status of the pilot outfit.

Parameters:

  • po PilotOutfit Pilot outfit to get heat of.
  • absolute Boolean If true returns the value in kelvin, otherwise it returns how overheated it is with 1. being normal and 0. being overheated.

Returns:

    Number heat of the pilot outfit in kelvin or closeness to 800 kelvin.
heatup (po)
Heats up a pilot outfit.

 local heat = po:outfit():heatFor( 5 ) -- 5 pulses should heat up fully
 ...
 po:heatup( heat ) -- one pulse
 

Parameters:

  • po PilotOutfit Pilot outfit to heat up.
generated by LDoc 1.5.0 Last updated 2024-04-06 11:10:42