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. |
getAll () | 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[, p=player.pilot()]) | Gets the description of an outfit (translated). |
summary (o[, p=player.pilot()[, noname=false]]) | Gets the summary of an outfit (translated). |
unique (o) | Gets whether or not an outfit is unique |
friendlyfire (o) | Gets whether or not a weapon outfit can do friendly fire. |
pointdefense (o) | Gets whether or not a weapon outfit is point defense. |
missShips (o) | Gets whether or not a weapon outfit misses ships. |
missAsteroids (o) | Gets whether or not a weapon outfit misses asteroids. |
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. |
illegality (Outfit) | Gets the factions to which the outfit is illegal to. |
tags (o) | Gets the outfit tags. |
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
- getAll ()
-
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:
- string Human readable name (in English).
- string Human readable size (in English).
- string Human readable property (in English).
- boolean Slot is required.
- 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[, p=player.pilot()])
-
Gets the description of an outfit (translated).
Parameters:
- o String Outfit to get the description of.
- p Pilot Pilot to set description to. (default player.pilot())
Returns:
-
string
The description (with translating).
Usage:
description = o:description()
- summary (o[, p=player.pilot()[, noname=false]])
-
Gets the summary of an outfit (translated).
Parameters:
- o String Outfit to get the summary of.
- p Pilot Pilot to set summary to. (default player.pilot())
- noname string Whether or not to hide the outfit name at the top. (default false)
Returns:
-
string
The summary (with translating).
Usage:
summary = o:summary()
- 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()
- friendlyfire (o)
-
Gets whether or not a weapon outfit can do friendly fire.
Parameters:
- o String Outfit to get the property of of.
Returns:
-
boolean
Whether or not the outfit can do friendly fire damage.
- pointdefense (o)
-
Gets whether or not a weapon outfit is point defense.
Parameters:
- o String Outfit to get the property of of.
Returns:
-
boolean
Whether or not the outfit is point defense.
- missShips (o)
-
Gets whether or not a weapon outfit misses ships.
Parameters:
- o String Outfit to get the property of of.
Returns:
-
boolean
Whether or not the outfit misses ships.
- missAsteroids (o)
-
Gets whether or not a weapon outfit misses asteroids.
Parameters:
- o String Outfit to get the property of of.
Returns:
-
boolean
Whether or not the outfit misses asteroids.
- 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:
- number Damage per secondof the outfit.
- number Disable per second of the outfit.
- number Energy per second of the outfit.
- number Range of the outfit.
- number trackmin Minimum tracking value of the outfit.
- number trackmax Maximum tracking value of the outfit.
- number lockon Time to lockon.
- specificstats ()
-
Returns raw data specific to each outfit type.
Returns:
-
A
table containing the raw values.
- illegality (Outfit)
-
Gets the factions to which the outfit is illegal to.
Parameters:
- Outfit o to get illegality status of.
Returns:
-
table
Table of all the factions the outfit is illegal to.
- tags (o)
-
Gets the outfit tags.
Parameters:
- o Outfit Outfit to get tags of.
Returns:
-
table
Table of tags where the name is the key and true is the value.
Usage:
if o:tags["fancy"] then -- Has "fancy" tag