Naev

Module outfit

Lua bindings to interact with outfits.

This will allow you to create and manipulate outfits in-game.

An example would be:

 o = outfit.get( "Heavy Laser" ) -- Gets the outfit by name
 cpu_usage = o:cpu() -- Gets the cpu usage of the outfit
 slot_name, slot_size = o:slot() -- Gets slot information about the outfit
 

Functions

__eq (o1, o2) Checks to see if two outfits are the same.
get (s) Gets a outfit.
get () Gets all the outfits.
name (s) Gets the translated name of the outfit.
nameRaw (s) Gets the raw (untranslated) name of the outfit.
type (o) Gets the type of an outfit.
typeBroad (o) Gets the broad type of an outfit.
cpu (o) Gets the cpu usage of an outfit.
mass (o) Gets the mass of an outfit.
slot (o) Gets the slot name, size and property of an outfit.
limit (o) Gets the limit string of the outfit.
icon (o) Gets the store icon for an outfit.
price (o) Gets the price of an outfit.
description (o) Gets the description of an outfit.
unique (o) Gets whether or not an outfit is unique
shipstat (o[, name=nil[, internal=false]]) Gets a shipstat from an Outfit by name, or a table containing all the ship stats if not specified.
weapstats (o[, p=nil]) Computes statistics for weapons.
specificstats () Returns raw data specific to each outfit type.


Functions

__eq (o1, o2)
Checks to see if two outfits are the same.

Parameters:

  • o1 Outfit First outfit to compare.
  • o2 Outfit Second outfit to compare.

Returns:

    boolean true if both outfits are the same.

Usage:

    if o1 == o2 then -- Checks to see if outfit o1 and o2 are the same
get (s)
Gets a outfit.

Parameters:

  • s string Raw (untranslated) name of the outfit to get.

Returns:

    Outfit or nil The outfit matching name or nil if error.

Usage:

    s = outfit.get( "Heavy Laser" ) -- Gets the heavy laser
get ()
Gets all the outfits.

Returns:

    Table Table containing all the outfits.
name (s)
Gets the translated name of the outfit.

This translated name should be used for display purposes (e.g. messages). It cannot be used as an identifier for the outfit; for that, use outfit.nameRaw() instead.

Parameters:

  • s Outfit Outfit to get the translated name of.

Returns:

    string The translated name of the outfit.

Usage:

    outfitname = s:name() -- Equivalent to `_(s:nameRaw())`
nameRaw (s)
Gets the raw (untranslated) name of the outfit.

This untranslated name should be used for identification purposes (e.g. can be passed to outfit.get()). It should not be used directly for display purposes without manually translating it with _().

Parameters:

  • s Outfit Outfit to get the raw name of.

Returns:

    string The raw name of the outfit.

Usage:

    outfitrawname = s:nameRaw()
type (o)
Gets the type of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The name of the outfit type (in English).

Usage:

    print( o:type() ) -- Prints the type of the outfit
typeBroad (o)
Gets the broad type of an outfit.

This name is more generic and vague than type().

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The name of the outfit broad type (in English).

Usage:

    print( o:typeBroad() ) -- Prints the broad type of the outfit
cpu (o)
Gets the cpu usage of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The amount of cpu the outfit uses.

Usage:

    print( o:cpu() ) -- Prints the cpu usage of an outfit
mass (o)
Gets the mass of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The amount of mass the outfit uses.

Usage:

    print( o:mass() ) -- Prints the mass of an outfit
slot (o)
Gets the slot name, size and property of an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

  1. string Human readable name (in English).
  2. string Human readable size (in English).
  3. string Human readable property (in English).
  4. boolean Slot is required.
  5. boolean Slot is exclusive.

Usage:

    slot_name, slot_size, slot_prop = o:slot() -- Gets an outfit's slot info
limit (o)
Gets the limit string of the outfit. Only one outfit can be equipped at the same time for each limit string.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string or nil Limit string or nil if not applicable.
icon (o)
Gets the store icon for an outfit.

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    Tex The texture containing the icon of the outfit.

Usage:

    ico = o:icon() -- Gets the shop icon for an outfit
price (o)
Gets the price of an outfit.

Parameters:

  • o String Outfit to get the price of.

Returns:

    number The price, in credits.

Usage:

    price = o:price()
description (o)
Gets the description of an outfit.

Parameters:

  • o String Outfit to get the description of.

Returns:

    string The description (without translating).

Usage:

    description = o:description()
unique (o)
Gets whether or not an outfit is unique

Parameters:

  • o String Outfit to get the uniqueness of.

Returns:

    boolean The uniqueness of the outfit.

Usage:

    isunique = o:unique()
shipstat (o[, name=nil[, internal=false]])
Gets a shipstat from an Outfit by name, or a table containing all the ship stats if not specified.

Parameters:

  • o Outfit Outfit to get ship stat of.
  • name string Name of the ship stat to get. (default nil)
  • internal boolean Whether or not to use the internal representation. (default false)

Returns:

    Value of the ship stat or a tale containing all the ship stats if name is not specified.
weapstats (o[, p=nil])
Computes statistics for weapons.

Parameters:

  • o Outfit Outfit to compute for.
  • p Pilot Pilot to use ship stats when computing. (default nil)

Returns:

  1. number Damage per secondof the outfit.
  2. number Disable per second of the outfit.
  3. number Energy per second of the outfit.
  4. number Range of the outfit.
  5. number trackmin Minimum tracking value of the outfit.
  6. number trackmax Maximum tracking value of the outfit.
  7. number lockon Time to lockon.
specificstats ()
Returns raw data specific to each outfit type.

Returns:

    A table containing the raw values.
generated by LDoc 1.4.6 Last updated 2021-09-20 09:47:54