naev 0.12.5
outfit.c File Reference

Handles all the ship outfit specifics. More...

#include "outfit.h"
#include "array.h"
#include "conf.h"
#include "damagetype.h"
#include "log.h"
#include "mapData.h"
#include "ndata.h"
#include "nlua.h"
#include "nlua_camera.h"
#include "nlua_gfx.h"
#include "nlua_munition.h"
#include "nlua_outfit.h"
#include "nlua_pilotoutfit.h"
#include "nstring.h"
#include "nxml.h"
#include "pilot.h"
#include "pilot_heat.h"
#include "pilot_outfit.h"
#include "ship.h"
#include "slots.h"
#include "sound.h"
#include "space.h"
#include "spfx.h"
#include "start.h"
#include "threadpool.h"
Include dependency graph for outfit.c:

Go to the source code of this file.

Data Structures

struct  OutfitThreadData
 For threaded loading of outfits. More...
struct  t_os_stat

Macros

#define XML_OUTFIT_TAG   "outfit"
#define OUTFIT_SHORTDESC_MAX    STRMAX_SHORT
#define SDESC_ADD(l, temp, txt, ...)
#define O_CMP(s, t)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)
#define MELEMENT(o, s)

Typedefs

typedef const t_os_stat os_opts

Functions

static OutfitType outfit_strToOutfitType (char *buf)
 Gets the outfit type from a human readable string.
static int outfit_loadDir (const char *dir)
 Loads all the files in a directory.
static int outfit_parseDamage (Damage *dmg, xmlNodePtr node)
 Parses a damage node.
static int outfit_parseThread (void *ptr)
static int outfit_parse (Outfit *temp, const char *file)
 Parses and returns Outfit from parent node.
static void outfit_parseSBolt (Outfit *temp, const xmlNodePtr parent)
 Parses the specific area for a bolt weapon and loads it into Outfit.
static void outfit_parseSBeam (Outfit *temp, const xmlNodePtr parent)
 Parses the beam weapon specifics of an outfit.
static void outfit_parseSLauncher (Outfit *temp, const xmlNodePtr parent)
 Parses the specific area for a launcher and loads it into Outfit.
static void outfit_parseSMod (Outfit *temp, const xmlNodePtr parent)
 Parses the modification tidbits of the outfit.
static void outfit_parseSAfterburner (Outfit *temp, const xmlNodePtr parent)
 Parses the afterburner tidbits of the outfit.
static void outfit_parseSFighterBay (Outfit *temp, const xmlNodePtr parent)
 Parses the fighter bay tidbits of the outfit.
static void outfit_parseSMap (Outfit *temp, const xmlNodePtr parent)
 Parses the map tidbits of the outfit.
static void outfit_parseSLocalMap (Outfit *temp, const xmlNodePtr parent)
 Parses the map tidbits of the outfit.
static void outfit_parseSGUI (Outfit *temp, const xmlNodePtr parent)
 Parses the GUI tidbits of the outfit.
static void outfit_parseSLicense (Outfit *temp, const xmlNodePtr parent)
 Parses the license tidbits of the outfit.
static int outfit_loadPLG (Outfit *temp, const char *buf)
 Loads the collision polygon for a bolt outfit.
static int outfit_loadGFX (Outfit *temp, const xmlNodePtr node)
 Loads the graphics for an outfit.
static void sdesc_miningRarity (int *l, Outfit *temp, int rarity)
 Adds a small blurb about rarity mining.
static int os_printD (char *buffer, int i, double value, const t_os_stat *opts)
 Writes an outfit statistic to a buffer.
static int os_printD_range (char *buffer, int i, double minValue, double maxValue, const t_os_stat *opts)
 Writes an outfit statistic representing a range between two values to a buffer.
static int os_printD_rate (char *buffer, int i, double val, const t_os_stat *val_opts, int multiplier, double rate, const t_os_stat *rate_opts)
 Writes an outfit statistic representing a "per unit" value and rate of change value.
static int outfit_cmp (const void *p1, const void *p2)
int outfit_gfxStoreLoaded (const Outfit *o)
int outfit_gfxStoreLoadNeeded (void)
int outfit_gfxStoreLoad (Outfit *o)
 Loads the store graphics for the outfit.
const Outfitoutfit_get (const char *name)
 Gets an outfit by name.
const Outfitoutfit_getW (const char *name)
 Gets an outfit by name without warning on no-find.
const Outfitoutfit_getAll (void)
 Gets the array (array.h) of all outfits.
const char * outfit_existsCase (const char *name)
 Checks to see if an outfit exists matching name (case insensitive).
char ** outfit_searchFuzzyCase (const char *name, int *n)
 Does a fuzzy search of all the outfits. Searches translated names but returns internal names.
int outfit_compareTech (const void *outfit1, const void *outfit2)
 Function meant for use with C89, C99 algorithm qsort().
int outfit_filterWeapon (const Outfit *o)
int outfit_filterUtility (const Outfit *o)
int outfit_filterStructure (const Outfit *o)
int outfit_filterCore (const Outfit *o)
int outfit_filterOther (const Outfit *o)
const char * outfit_slotName (const Outfit *o)
 Gets the name of the slot type of an outfit.
const char * slotName (const OutfitSlotType type)
const char * slotSize (const OutfitSlotSize o)
 Gets the slot size as a string.
const char * outfit_slotSize (const Outfit *o)
 Gets the name of the slot size of an outfit.
const glColour * outfit_slotSizeColour (const OutfitSlot *os)
 Gets the slot size colour for an outfit slot.
char outfit_slotSizeColourFont (const OutfitSlot *os)
 Gets a font colour character that roughly matches an outfit slot size colour.
char outfit_slotTypeColourFont (const OutfitSlot *os)
 Gets a font colour character that roughly matches an outfit slot type colour.
size_t outfit_getNameWithClass (const Outfit *outfit, char *buf, size_t size)
 Gets a brief name/class description suitable for the title section of an outfitter screen.
OutfitSlotSize outfit_toSlotSize (const char *s)
 Gets the outfit slot size from a human readable string.
int outfit_isActive (const Outfit *o)
 Checks if outfit is an active outfit.
int outfit_isToggleable (const Outfit *o)
 Checks if outfit can be toggled.
int outfit_isWeapon (const Outfit *o)
 Checks to see if an outfit is a weapon.
int outfit_isForward (const Outfit *o)
 Checks if outfit is a fixed mounted weapon.
int outfit_isBolt (const Outfit *o)
 Checks if outfit is bolt type weapon.
int outfit_isBeam (const Outfit *o)
 Checks if outfit is a beam type weapon.
int outfit_isLauncher (const Outfit *o)
 Checks if outfit is a weapon launcher.
int outfit_isSeeker (const Outfit *o)
 Checks if outfit is a seeking weapon.
int outfit_isTurret (const Outfit *o)
 Checks if outfit is a turret class weapon.
int outfit_isMod (const Outfit *o)
 Checks if outfit is a ship modification.
int outfit_isAfterburner (const Outfit *o)
 Checks if outfit is an afterburner.
int outfit_isFighterBay (const Outfit *o)
 Checks if outfit is a fighter bay.
int outfit_isMap (const Outfit *o)
 Checks if outfit is a space map.
int outfit_isLocalMap (const Outfit *o)
 Checks if outfit is a local space map.
int outfit_isLicense (const Outfit *o)
 Checks if outfit is a license.
int outfit_isGUI (const Outfit *o)
 Checks if outfit is a GUI.
int outfit_isSecondary (const Outfit *o)
 Checks if outfit has the secondary flag set.
const OutfitGFXoutfit_gfx (const Outfit *o)
 Gets the outfit's graphic effect.
const CollPolyoutfit_plg (const Outfit *o)
 Gets the outfit's collision polygon.
int outfit_spfxArmour (const Outfit *o)
 Gets the outfit's sound effect.
int outfit_spfxShield (const Outfit *o)
 Gets the outfit's sound effect.
const Damageoutfit_damage (const Outfit *o)
 Gets the outfit's damage.
double outfit_radius (const Outfit *o)
 Gets the outfit's explosion radius.
double outfit_delay (const Outfit *o)
 Gets the outfit's delay.
int outfit_amount (const Outfit *o)
 Gets the amount an outfit can hold.
double outfit_energy (const Outfit *o)
 Gets the outfit's energy usage.
double outfit_heat (const Outfit *o)
 Gets the outfit's heat generation.
double outfit_cpu (const Outfit *o)
 Gets the outfit's cpu usage.
double outfit_range (const Outfit *o)
 Gets the outfit's range.
double outfit_speed (const Outfit *o)
 Gets the outfit's speed.
double outfit_swivel (const Outfit *o)
 Gets the swivel of an outfit.
double outfit_spin (const Outfit *o)
 Gets the outfit's animation spin.
double outfit_trackmin (const Outfit *o)
 Gets the outfit's minimal tracking.
double outfit_trackmax (const Outfit *o)
 Gets the outfit's minimal tracking.
int outfit_miningRarity (const Outfit *o)
 Gets the maximum rarity the outfit can mine up to.
int outfit_sound (const Outfit *o)
 Gets the outfit's sound.
int outfit_soundHit (const Outfit *o)
 Gets the outfit's hit sound.
double outfit_ammoMass (const Outfit *o)
 Gets the outfit's ammunition mass.
double outfit_duration (const Outfit *o)
 Gets the outfit's duration.
double outfit_cooldown (const Outfit *o)
 Gets the outfit's cooldown.
const char * outfit_getType (const Outfit *o)
 Gets the outfit's specific type.
const char * outfit_getTypeBroad (const Outfit *o)
 Gets the outfit's broad type.
const char * outfit_getAmmoAI (const Outfit *o)
 Gets a human-readable string describing an ammo outfit's AI.
const char * outfit_description (const Outfit *o)
 Gets the description of an outfit.
const char * outfit_summary (const Outfit *o, int withname)
 Gets the summary of an outfit.
const char * outfit_shortname (const Outfit *o)
 Gets the short name (translated) of an outfit.
int outfit_fitsSlot (const Outfit *o, const OutfitSlot *s)
 Checks to see if an outfit fits a slot.
int outfit_fitsSlotType (const Outfit *o, const OutfitSlot *s)
 Checks to see if an outfit fits a slot type (ignoring size).
void outfit_freeSlot (OutfitSlot *s)
 Frees an outfit slot.
int outfit_load (void)
 Loads all the outfits.
int outfit_loadPost (void)
 Loads all the outfits legality.
int outfit_mapParse (void)
 Parses all the maps.
glTexturerarity_texture (int rarity)
int outfit_checkIllegal (const Outfit *o, int fct)
 Checks illegality of an outfit to a faction.
int outfit_licenseExists (const char *name)
 Checks to see if a license exists.
void outfit_free (void)
 Frees the outfit stack.

Variables

static Outfitoutfit_stack = NULL
static char ** license_stack = NULL
static os_opts darmour_opts
static os_opts dshield_opts
static os_opts dknockback_opts
static os_opts cpu_opts = { N_( "CPU" ), _UNIT_CPU, 1, 0, 1, 0 }
static os_opts mass_opts = { N_( "Mass" ), _UNIT_MASS, 0, 0, 1, 0 }
static os_opts penetration_opts
static os_opts damage_opts = { N_( "Damage" ), _UNIT_ENERGY, 0, 1, 1, 1 }
static os_opts dps_opts = { N_( "Damage Rate" ), _UNIT_POWER, 0, 0, 1, 1 }
static os_opts disable_opts = { N_( "Disable" ), _UNIT_ENERGY, 0, 1, 1, 1 }
static os_opts disable_rate_opts
static os_opts fire_rate_opts
static os_opts energy_opts = { N_( "Energy" ), _UNIT_ENERGY, 0, 1, 1, 1 }
static os_opts power_opts = { N_( "Power" ), _UNIT_POWER, 0, 0, 1, 1 }
static os_opts range_opts = { N_( "Range" ), _UNIT_DISTANCE, 0, 0, 1, 0 }
static os_opts speed_opts = { N_( "Speed" ), _UNIT_SPEED, 0, 0, 1, 0 }
static os_opts heatup_opts = { N_( "Overheat" ), _UNIT_TIME, 0, 0, 1, 1 }
static os_opts dispersion_opts
static os_opts swivel_opts = { N_( "Swivel" ), _UNIT_ANGLE, 0, 0, 1, 0 }
static os_opts tracking_opts = { N_( "Tracking" ), _UNIT_DISTANCE, 0, 0, 1, 0 }
static os_opts duration_opts = { N_( "Duration" ), _UNIT_TIME, 0, 0, 1, 1 }
static os_opts cooldown_opts = { N_( "Cooldown" ), _UNIT_TIME, 0, 0, 1, 1 }
static os_opts lockon_opts = { N_( "Lock-On" ), _UNIT_TIME, 0, 0, 1, 0 }
static os_opts inflight_calib_opts
static os_opts initial_speed_opts
static os_opts accel_opts = { N_( "Accel" ), _UNIT_ACCEL, 0, 0, 1, 0 }
static os_opts max_speed_opts = { N_( "Max Speed" ), _UNIT_SPEED, 0, 0, 1, 0 }
static os_opts reload_opts = { N_( "Reload Time" ), _UNIT_TIME, 0, 0, 1, 1 }
static os_opts armour_opts = { N_( "Armour" ), _UNIT_ENERGY, 0, 0, 1, 1 }
static os_opts absorp_opts = { N_( "Absorption" ), _UNIT_PERCENT, 0, 0, 1, 1 }
static os_opts jam_res_opts
static os_opts max_mass_opts
static os_opts rumble_opts = { N_( "Rumble" ), NULL, 0, 0, 1, 1 }
static os_opts shots_delay_opts

Detailed Description

Handles all the ship outfit specifics.

These outfits allow you to modify ships or make them more powerful and are a fundamental part of the game.

Definition in file outfit.c.

Macro Definition Documentation

◆ MELEMENT [1/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, \
s )

◆ MELEMENT [2/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, \
s )

◆ MELEMENT [3/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing '%s' element" ), temp->name, \
s )

◆ MELEMENT [4/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, \
s )

◆ MELEMENT [5/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, \
s )

◆ MELEMENT [6/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, s )

◆ MELEMENT [7/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, s )

◆ MELEMENT [8/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, s )

◆ MELEMENT [9/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, s )

◆ MELEMENT [10/10]

#define MELEMENT ( o,
s )
Value:
if ( o ) \
WARN( _( "Outfit '%s' missing/invalid '%s' element" ), temp->name, \
s )

◆ O_CMP

#define O_CMP ( s,
t )
Value:
if ( strcasecmp( buf, ( s ) ) == 0 ) \
return t

Define to help with outfit_strToOutfitType.

Definition at line 1251 of file outfit.c.

◆ OUTFIT_SHORTDESC_MAX

#define OUTFIT_SHORTDESC_MAX    STRMAX_SHORT

Max length of the short description of the outfit.

Definition at line 51 of file outfit.c.

◆ SDESC_ADD

#define SDESC_ADD ( l,
temp,
txt,
... )
Value:
( l ) += scnprintf( &( temp )->summary_raw[l], \
OUTFIT_SHORTDESC_MAX - ( l ), ( txt ), ##__VA_ARGS__ )
int scnprintf(char *text, size_t maxlen, const char *fmt,...)
Like snprintf(), but returns the number of characters ACTUALLY "printed" into the buffer....
Definition nstring.c:102
#define OUTFIT_SHORTDESC_MAX
Definition outfit.c:51

Definition at line 72 of file outfit.c.

◆ XML_OUTFIT_TAG

#define XML_OUTFIT_TAG   "outfit"

XML section identifier.

Definition at line 49 of file outfit.c.

Typedef Documentation

◆ os_opts

typedef const t_os_stat os_opts

Definition at line 109 of file outfit.c.

Function Documentation

◆ os_printD()

int os_printD ( char * buffer,
int i,
double value,
const t_os_stat * opts )
static

Writes an outfit statistic to a buffer.

Parameters
bufferBuffer to write to.
iPosition to write at.
valueValue to write.
optsFormat to use to write value.
Returns
Up until where was written in the buffer.

Definition at line 3416 of file outfit.c.

◆ os_printD_range()

int os_printD_range ( char * buffer,
int i,
double minValue,
double maxValue,
const t_os_stat * opts )
static

Writes an outfit statistic representing a range between two values to a buffer.

Parameters
bufferBuffer to write to.
iPosition to write at.
minValueLower value bound.
maxValueUpper value bound.
optsFormat to use to write value.
Returns
Up until where was written in the buffer.

Definition at line 3459 of file outfit.c.

◆ os_printD_rate()

int os_printD_rate ( char * buffer,
int i,
double val,
const t_os_stat * val_opts,
int multiplier,
double rate,
const t_os_stat * rate_opts )
static

Writes an outfit statistic representing a "per unit" value and rate of change value.

Parameters
bufferBuffer to write to.
iPosition to write at.
valMain "per unit value".
val_optsFormat used to write val.
multiplierMultiplication value for val, or <=1 to disable.
rateRate of change value.
rate_optsFormat to use to write rate.
Returns
Up until where was written in the buffer.

Definition at line 3498 of file outfit.c.

◆ outfit_ammoMass()

double outfit_ammoMass ( const Outfit * o)

Gets the outfit's ammunition mass.

Parameters
oOutfit to get ammunition mass from.
Returns
Outfit's ammunition's mass.

Definition at line 1017 of file outfit.c.

◆ outfit_amount()

int outfit_amount ( const Outfit * o)

Gets the amount an outfit can hold.

Parameters
oOutfit to get information from.

Definition at line 850 of file outfit.c.

◆ outfit_checkIllegal()

int outfit_checkIllegal ( const Outfit * o,
int fct )

Checks illegality of an outfit to a faction.

Definition at line 3309 of file outfit.c.

◆ outfit_cmp()

int outfit_cmp ( const void * p1,
const void * p2 )
static

Definition at line 166 of file outfit.c.

◆ outfit_compareTech()

int outfit_compareTech ( const void * outfit1,
const void * outfit2 )

Function meant for use with C89, C99 algorithm qsort().

Parameters
outfit1First argument to compare.
outfit2Second argument to compare.
Returns
-1 if first argument is inferior, +1 if it's superior, 0 if ties.

Definition at line 302 of file outfit.c.

◆ outfit_cooldown()

double outfit_cooldown ( const Outfit * o)

Gets the outfit's cooldown.

Parameters
oOutfit to get the cooldown of.
Returns
Outfit's cooldown.

Definition at line 1044 of file outfit.c.

◆ outfit_cpu()

double outfit_cpu ( const Outfit * o)

Gets the outfit's cpu usage.

Parameters
oOutfit to get information from.

Definition at line 891 of file outfit.c.

◆ outfit_damage()

const Damage * outfit_damage ( const Outfit * o)

Gets the outfit's damage.

Parameters
oOutfit to get information from.

Definition at line 808 of file outfit.c.

◆ outfit_delay()

double outfit_delay ( const Outfit * o)

Gets the outfit's delay.

Parameters
oOutfit to get information from.

Definition at line 834 of file outfit.c.

◆ outfit_description()

const char * outfit_description ( const Outfit * o)

Gets the description of an outfit.

Subsequent calls will change the memory, strdup if necessary.

Parameters
oOutfit to get description of.
Returns
Description of the outfit.

Definition at line 1143 of file outfit.c.

◆ outfit_duration()

double outfit_duration ( const Outfit * o)

Gets the outfit's duration.

Parameters
oOutfit to get the duration of.
Returns
Outfit's duration.

Definition at line 1030 of file outfit.c.

◆ outfit_energy()

double outfit_energy ( const Outfit * o)

Gets the outfit's energy usage.

Parameters
oOutfit to get information from.

Definition at line 863 of file outfit.c.

◆ outfit_existsCase()

const char * outfit_existsCase ( const char * name)

Checks to see if an outfit exists matching name (case insensitive).

Definition at line 255 of file outfit.c.

◆ outfit_filterCore()

int outfit_filterCore ( const Outfit * o)

Definition at line 386 of file outfit.c.

◆ outfit_filterOther()

int outfit_filterOther ( const Outfit * o)

Definition at line 391 of file outfit.c.

◆ outfit_filterStructure()

int outfit_filterStructure ( const Outfit * o)

Definition at line 380 of file outfit.c.

◆ outfit_filterUtility()

int outfit_filterUtility ( const Outfit * o)

Definition at line 374 of file outfit.c.

◆ outfit_filterWeapon()

int outfit_filterWeapon ( const Outfit * o)

Definition at line 368 of file outfit.c.

◆ outfit_fitsSlot()

int outfit_fitsSlot ( const Outfit * o,
const OutfitSlot * s )

Checks to see if an outfit fits a slot.

Parameters
oOutfit to see if fits in a slot.
sSlot to see if outfit fits in.
Returns
1 if outfit fits the slot, 0 otherwise.

Definition at line 1180 of file outfit.c.

◆ outfit_fitsSlotType()

int outfit_fitsSlotType ( const Outfit * o,
const OutfitSlot * s )

Checks to see if an outfit fits a slot type (ignoring size).

Parameters
oOutfit to see if fits in a slot.
sSlot to see if outfit fits in.
Returns
1 if outfit fits the slot, 0 otherwise.

Definition at line 1224 of file outfit.c.

◆ outfit_free()

void outfit_free ( void )

Frees the outfit stack.

Definition at line 3333 of file outfit.c.

◆ outfit_freeSlot()

void outfit_freeSlot ( OutfitSlot * s)

Frees an outfit slot.

Parameters
sSlot to free.

Definition at line 1246 of file outfit.c.

◆ outfit_get()

const Outfit * outfit_get ( const char * name)

Gets an outfit by name.

Parameters
nameName to match.
Returns
Outfit matching name or NULL if not found.

Definition at line 223 of file outfit.c.

◆ outfit_getAll()

const Outfit * outfit_getAll ( void )

Gets the array (array.h) of all outfits.

Definition at line 247 of file outfit.c.

◆ outfit_getAmmoAI()

const char * outfit_getAmmoAI ( const Outfit * o)

Gets a human-readable string describing an ammo outfit's AI.

Parameters
oAmmo outfit.
Returns
Name of the outfit's AI.

Definition at line 1123 of file outfit.c.

◆ outfit_getNameWithClass()

size_t outfit_getNameWithClass ( const Outfit * outfit,
char * buf,
size_t size )

Gets a brief name/class description suitable for the title section of an outfitter screen.

Parameters
outfitOutfit to describe.
[out]bufOutput buffer.
sizeSize of output buffer.
Returns
Number of characters written.

Definition at line 525 of file outfit.c.

◆ outfit_getType()

const char * outfit_getType ( const Outfit * o)

Gets the outfit's specific type.

Parameters
oOutfit to get specific type from.
Returns
The specific type in human readable form (English).

Definition at line 1060 of file outfit.c.

◆ outfit_getTypeBroad()

const char * outfit_getTypeBroad ( const Outfit * o)

Gets the outfit's broad type.

Parameters
oOutfit to get the type of.
Returns
The outfit's broad type in human readable form.

Definition at line 1091 of file outfit.c.

◆ outfit_getW()

const Outfit * outfit_getW ( const char * name)

Gets an outfit by name without warning on no-find.

Parameters
nameName to match.
Returns
Outfit matching name or NULL if not found.

Definition at line 237 of file outfit.c.

◆ outfit_gfx()

const OutfitGFX * outfit_gfx ( const Outfit * o)

Gets the outfit's graphic effect.

Parameters
oOutfit to get information from.

Definition at line 756 of file outfit.c.

◆ outfit_gfxStoreLoad()

int outfit_gfxStoreLoad ( Outfit * o)

Loads the store graphics for the outfit.

Definition at line 198 of file outfit.c.

◆ outfit_gfxStoreLoaded()

int outfit_gfxStoreLoaded ( const Outfit * o)

Definition at line 173 of file outfit.c.

◆ outfit_gfxStoreLoadNeeded()

int outfit_gfxStoreLoadNeeded ( void )

Definition at line 178 of file outfit.c.

◆ outfit_heat()

double outfit_heat ( const Outfit * o)

Gets the outfit's heat generation.

Parameters
oOutfit to get information from.

Definition at line 877 of file outfit.c.

◆ outfit_isActive()

int outfit_isActive ( const Outfit * o)

Checks if outfit is an active outfit.

Parameters
oOutfit to check.
Returns
1 if o is active.

Definition at line 567 of file outfit.c.

◆ outfit_isAfterburner()

int outfit_isAfterburner ( const Outfit * o)

Checks if outfit is an afterburner.

Parameters
oOutfit to check.
Returns
1 if o is an afterburner.

Definition at line 692 of file outfit.c.

◆ outfit_isBeam()

int outfit_isBeam ( const Outfit * o)

Checks if outfit is a beam type weapon.

Parameters
oOutfit to check.
Returns
1 if o is a beam type weapon.

Definition at line 639 of file outfit.c.

◆ outfit_isBolt()

int outfit_isBolt ( const Outfit * o)

Checks if outfit is bolt type weapon.

Parameters
oOutfit to check.
Returns
1 if o is a bolt type weapon.

Definition at line 629 of file outfit.c.

◆ outfit_isFighterBay()

int outfit_isFighterBay ( const Outfit * o)

Checks if outfit is a fighter bay.

Parameters
oOutfit to check.
Returns
1 if o is a jammer.

Definition at line 701 of file outfit.c.

◆ outfit_isForward()

int outfit_isForward ( const Outfit * o)

Checks if outfit is a fixed mounted weapon.

Parameters
oOutfit to check.
Returns
1 if o is a weapon (beam/bolt).

Definition at line 619 of file outfit.c.

◆ outfit_isGUI()

int outfit_isGUI ( const Outfit * o)

Checks if outfit is a GUI.

Parameters
oOutfit to check.
Returns
1 if o is a GUI.

Definition at line 737 of file outfit.c.

◆ outfit_isLauncher()

int outfit_isLauncher ( const Outfit * o)

Checks if outfit is a weapon launcher.

Parameters
oOutfit to check.
Returns
1 if o is a weapon launcher.

Definition at line 649 of file outfit.c.

◆ outfit_isLicense()

int outfit_isLicense ( const Outfit * o)

Checks if outfit is a license.

Parameters
oOutfit to check.
Returns
1 if o is a license.

Definition at line 728 of file outfit.c.

◆ outfit_isLocalMap()

int outfit_isLocalMap ( const Outfit * o)

Checks if outfit is a local space map.

Parameters
oOutfit to check.
Returns
1 if o is a map.

Definition at line 719 of file outfit.c.

◆ outfit_isMap()

int outfit_isMap ( const Outfit * o)

Checks if outfit is a space map.

Parameters
oOutfit to check.
Returns
1 if o is a map.

Definition at line 710 of file outfit.c.

◆ outfit_isMod()

int outfit_isMod ( const Outfit * o)

Checks if outfit is a ship modification.

Parameters
oOutfit to check.
Returns
1 if o is a ship modification.

Definition at line 683 of file outfit.c.

◆ outfit_isSecondary()

int outfit_isSecondary ( const Outfit * o)

Checks if outfit has the secondary flag set.

Parameters
oOutfit to check.
Returns
1 if o is a secondary weapon.

Definition at line 747 of file outfit.c.

◆ outfit_isSeeker()

int outfit_isSeeker ( const Outfit * o)

Checks if outfit is a seeking weapon.

Parameters
oOutfit to check.
Returns
1 if o is a seeking weapon.

Definition at line 659 of file outfit.c.

◆ outfit_isToggleable()

int outfit_isToggleable ( const Outfit * o)

Checks if outfit can be toggled.

Parameters
oOutfit to check.
Returns
1 if o is active.

Definition at line 584 of file outfit.c.

◆ outfit_isTurret()

int outfit_isTurret ( const Outfit * o)

Checks if outfit is a turret class weapon.

Parameters
oOutfit to check.
Returns
1 if o is a turret class weapon.

Definition at line 672 of file outfit.c.

◆ outfit_isWeapon()

int outfit_isWeapon ( const Outfit * o)

Checks to see if an outfit is a weapon.

Parameters
oOutfit to check.
Returns
1 if o is a weapon.

Definition at line 603 of file outfit.c.

◆ outfit_licenseExists()

int outfit_licenseExists ( const char * name)

Checks to see if a license exists.

Definition at line 3321 of file outfit.c.

◆ outfit_load()

int outfit_load ( void )

Loads all the outfits.

Returns
0 on success.

Definition at line 3023 of file outfit.c.

◆ outfit_loadDir()

int outfit_loadDir ( const char * dir)
static

Loads all the files in a directory.

Parameters
dirDirectory to load files from.
Returns
0 on success.

Definition at line 2979 of file outfit.c.

◆ outfit_loadGFX()

int outfit_loadGFX ( Outfit * temp,
const xmlNodePtr node )
static

Loads the graphics for an outfit.

Definition at line 1407 of file outfit.c.

◆ outfit_loadPLG()

int outfit_loadPLG ( Outfit * temp,
const char * buf )
static

Loads the collision polygon for a bolt outfit.

Parameters
tempOutfit to load into.
bufName of the file.

Definition at line 1354 of file outfit.c.

◆ outfit_loadPost()

int outfit_loadPost ( void )

Loads all the outfits legality.

Returns
0 on success.

Definition at line 3203 of file outfit.c.

◆ outfit_mapParse()

int outfit_mapParse ( void )

Parses all the maps.

Definition at line 3257 of file outfit.c.

◆ outfit_miningRarity()

int outfit_miningRarity ( const Outfit * o)

Gets the maximum rarity the outfit can mine up to.

Parameters
oOutfit to get information from.
Returns
Outfit's maximum mining rarity.

Definition at line 976 of file outfit.c.

◆ outfit_parse()

int outfit_parse ( Outfit * temp,
const char * file )
static

Parses and returns Outfit from parent node.

Parameters
tempOutfit to load into.
filePath to the XML file (relative to base directory).
Returns
0 on success.

< deal with maps after the universe is loaded

Definition at line 2658 of file outfit.c.

◆ outfit_parseDamage()

int outfit_parseDamage ( Damage * dmg,
xmlNodePtr node )
static

Parses a damage node.

Example damage node would be:

<damage type="kinetic">10</damage>
Parameters
[out]dmgStores the damage here.
[in]nodeNode to parse damage from.
Returns
0 on success.

Definition at line 1307 of file outfit.c.

◆ outfit_parseSAfterburner()

void outfit_parseSAfterburner ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the afterburner tidbits of the outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

Definition at line 2284 of file outfit.c.

◆ outfit_parseSBeam()

void outfit_parseSBeam ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the beam weapon specifics of an outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

Definition at line 1742 of file outfit.c.

◆ outfit_parseSBolt()

void outfit_parseSBolt ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the specific area for a bolt weapon and loads it into Outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

Definition at line 1495 of file outfit.c.

◆ outfit_parseSFighterBay()

void outfit_parseSFighterBay ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the fighter bay tidbits of the outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

Definition at line 2381 of file outfit.c.

◆ outfit_parseSGUI()

void outfit_parseSGUI ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the GUI tidbits of the outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

< Define to help check for data errors.

Definition at line 2587 of file outfit.c.

◆ outfit_parseSLauncher()

void outfit_parseSLauncher ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the specific area for a launcher and loads it into Outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

Definition at line 1923 of file outfit.c.

◆ outfit_parseSLicense()

void outfit_parseSLicense ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the license tidbits of the outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

< Define to help check for data errors.

Definition at line 2621 of file outfit.c.

◆ outfit_parseSLocalMap()

void outfit_parseSLocalMap ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the map tidbits of the outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

< Define to help check for data errors.

Definition at line 2549 of file outfit.c.

◆ outfit_parseSMap()

void outfit_parseSMap ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the map tidbits of the outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

< Define to help check for data errors.

Definition at line 2446 of file outfit.c.

◆ outfit_parseSMod()

void outfit_parseSMod ( Outfit * temp,
const xmlNodePtr parent )
static

Parses the modification tidbits of the outfit.

Parameters
tempOutfit to finish loading.
parentOutfit's parent node.

Definition at line 2240 of file outfit.c.

◆ outfit_parseThread()

int outfit_parseThread ( void * ptr)
static

Definition at line 2960 of file outfit.c.

◆ outfit_plg()

const CollPoly * outfit_plg ( const Outfit * o)

Gets the outfit's collision polygon.

Parameters
oOutfit to get information from.

Definition at line 768 of file outfit.c.

◆ outfit_radius()

double outfit_radius ( const Outfit * o)

Gets the outfit's explosion radius.

Parameters
oOutfit to get information from.

Definition at line 822 of file outfit.c.

◆ outfit_range()

double outfit_range ( const Outfit * o)

Gets the outfit's range.

Parameters
oOutfit to get information from.

Definition at line 899 of file outfit.c.

◆ outfit_searchFuzzyCase()

char ** outfit_searchFuzzyCase ( const char * name,
int * n )

Does a fuzzy search of all the outfits. Searches translated names but returns internal names.

Definition at line 267 of file outfit.c.

◆ outfit_shortname()

const char * outfit_shortname ( const Outfit * o)

Gets the short name (translated) of an outfit.

Parameters
oOutfit to get short name of.
Returns
Outfit's short name.

Definition at line 1168 of file outfit.c.

◆ outfit_slotName()

const char * outfit_slotName ( const Outfit * o)

Gets the name of the slot type of an outfit.

Parameters
oOutfit to get slot type of.
Returns
The human readable name of the slot type.

Definition at line 405 of file outfit.c.

◆ outfit_slotSize()

const char * outfit_slotSize ( const Outfit * o)

Gets the name of the slot size of an outfit.

Parameters
oOutfit to get slot size of.
Returns
The human readable name of the slot size.

Definition at line 458 of file outfit.c.

◆ outfit_slotSizeColour()

const glColour * outfit_slotSizeColour ( const OutfitSlot * os)

Gets the slot size colour for an outfit slot.

Parameters
osOutfit slot to get the slot size colour of.
Returns
The slot size colour of the outfit slot.

Definition at line 469 of file outfit.c.

◆ outfit_slotSizeColourFont()

char outfit_slotSizeColourFont ( const OutfitSlot * os)

Gets a font colour character that roughly matches an outfit slot size colour.

Parameters
osOutfit slot to get the slot size font colour of.
Returns
The slot size font colour of the outfit slot.

Definition at line 487 of file outfit.c.

◆ outfit_slotTypeColourFont()

char outfit_slotTypeColourFont ( const OutfitSlot * os)

Gets a font colour character that roughly matches an outfit slot type colour.

Parameters
osOutfit slot to get the slot type font colour of.
Returns
The slot type font colour of the outfit slot.

Definition at line 505 of file outfit.c.

◆ outfit_sound()

int outfit_sound ( const Outfit * o)

Gets the outfit's sound.

Parameters
oOutfit to get sound from.
Returns
Outfit's sound.

Definition at line 991 of file outfit.c.

◆ outfit_soundHit()

int outfit_soundHit ( const Outfit * o)

Gets the outfit's hit sound.

Parameters
oOutfit to get hit sound from.
Returns
Outfit's hit sound.

Definition at line 1004 of file outfit.c.

◆ outfit_speed()

double outfit_speed ( const Outfit * o)

Gets the outfit's speed.

Parameters
oOutfit to get information from.
Returns
Outfit's speed.

Definition at line 908 of file outfit.c.

◆ outfit_spfxArmour()

int outfit_spfxArmour ( const Outfit * o)

Gets the outfit's sound effect.

Parameters
oOutfit to get information from.

Definition at line 780 of file outfit.c.

◆ outfit_spfxShield()

int outfit_spfxShield ( const Outfit * o)

Gets the outfit's sound effect.

Parameters
oOutfit to get information from.

Definition at line 794 of file outfit.c.

◆ outfit_spin()

double outfit_spin ( const Outfit * o)

Gets the outfit's animation spin.

Parameters
oOutfit to get information from.
Returns
Outfit's animation spin.

Definition at line 933 of file outfit.c.

◆ outfit_strToOutfitType()

OutfitType outfit_strToOutfitType ( char * buf)
static

Gets the outfit type from a human readable string.

Parameters
bufString to extract outfit type from.
Returns
Outfit type stored in buf.

Definition at line 1260 of file outfit.c.

◆ outfit_summary()

const char * outfit_summary ( const Outfit * o,
int withname )

Gets the summary of an outfit.

Subsequent calls will change the memory, strdup if necessary.

Parameters
oOutfit to get summary of.
withnameWhether or not to include the outfit name.
Returns
Summary of the outfit.

Definition at line 1157 of file outfit.c.

◆ outfit_swivel()

double outfit_swivel ( const Outfit * o)

Gets the swivel of an outfit.

Parameters
oOutfit to get swivel of.
Returns
Outfit's swivel (in radians).

Definition at line 918 of file outfit.c.

◆ outfit_toSlotSize()

OutfitSlotSize outfit_toSlotSize ( const char * s)

Gets the outfit slot size from a human readable string.

Parameters
sString representing an outfit slot size.
Returns
Outfit slot size matching string.

Definition at line 544 of file outfit.c.

◆ outfit_trackmax()

double outfit_trackmax ( const Outfit * o)

Gets the outfit's minimal tracking.

Parameters
oOutfit to get information from.
Returns
Outfit's minimal tracking.

Definition at line 961 of file outfit.c.

◆ outfit_trackmin()

double outfit_trackmin ( const Outfit * o)

Gets the outfit's minimal tracking.

Parameters
oOutfit to get information from.
Returns
Outfit's minimal tracking.

Definition at line 946 of file outfit.c.

◆ rarity_texture()

glTexture * rarity_texture ( int rarity)

Gets the texture associated to the rarity of an outfit/ship.

Definition at line 3299 of file outfit.c.

◆ sdesc_miningRarity()

void sdesc_miningRarity ( int * l,
Outfit * temp,
int rarity )
static

Adds a small blurb about rarity mining.

Definition at line 1284 of file outfit.c.

◆ slotName()

const char * slotName ( const OutfitSlotType type)
See also
outfit_slotName

Definition at line 413 of file outfit.c.

◆ slotSize()

const char * slotSize ( const OutfitSlotSize o)

Gets the slot size as a string.

Definition at line 436 of file outfit.c.

Variable Documentation

◆ absorp_opts

os_opts absorp_opts = { N_( "Absorption" ), _UNIT_PERCENT, 0, 0, 1, 1 }
static

Definition at line 157 of file outfit.c.

◆ accel_opts

os_opts accel_opts = { N_( "Accel" ), _UNIT_ACCEL, 0, 0, 1, 0 }
static

Definition at line 153 of file outfit.c.

◆ armour_opts

os_opts armour_opts = { N_( "Armour" ), _UNIT_ENERGY, 0, 0, 1, 1 }
static

Definition at line 156 of file outfit.c.

◆ cooldown_opts

os_opts cooldown_opts = { N_( "Cooldown" ), _UNIT_TIME, 0, 0, 1, 1 }
static

Definition at line 147 of file outfit.c.

◆ cpu_opts

os_opts cpu_opts = { N_( "CPU" ), _UNIT_CPU, 1, 0, 1, 0 }
static

Definition at line 126 of file outfit.c.

◆ damage_opts

os_opts damage_opts = { N_( "Damage" ), _UNIT_ENERGY, 0, 1, 1, 1 }
static

Definition at line 130 of file outfit.c.

◆ darmour_opts

os_opts darmour_opts
static
Initial value:
= {
N_( "Armour Damage" ), _UNIT_PERCENT, 1, 100, 0, 0 }

Definition at line 120 of file outfit.c.

◆ disable_opts

os_opts disable_opts = { N_( "Disable" ), _UNIT_ENERGY, 0, 1, 1, 1 }
static

Definition at line 132 of file outfit.c.

◆ disable_rate_opts

os_opts disable_rate_opts
static
Initial value:
= {
N_( "Disable Rate" ), _UNIT_POWER, 0, 0, 1, 1 }

Definition at line 133 of file outfit.c.

◆ dispersion_opts

os_opts dispersion_opts
static
Initial value:
= {
N_( "Dispersion" ), _UNIT_ANGLE, 0, 0, 1, 0 }

Definition at line 142 of file outfit.c.

◆ dknockback_opts

os_opts dknockback_opts
static
Initial value:
= {
N_( "Knockback" ), _UNIT_PERCENT, 0, 0, 1, 0 }

Definition at line 124 of file outfit.c.

◆ dps_opts

os_opts dps_opts = { N_( "Damage Rate" ), _UNIT_POWER, 0, 0, 1, 1 }
static

Definition at line 131 of file outfit.c.

◆ dshield_opts

os_opts dshield_opts
static
Initial value:
= {
N_( "Shield Damage" ), _UNIT_PERCENT, 1, 100, 0, 0 }

Definition at line 122 of file outfit.c.

◆ duration_opts

os_opts duration_opts = { N_( "Duration" ), _UNIT_TIME, 0, 0, 1, 1 }
static

Definition at line 146 of file outfit.c.

◆ energy_opts

os_opts energy_opts = { N_( "Energy" ), _UNIT_ENERGY, 0, 1, 1, 1 }
static

Definition at line 137 of file outfit.c.

◆ fire_rate_opts

os_opts fire_rate_opts
static
Initial value:
= {
N_( "Fire Rate" ), _UNIT_PER_TIME, 0, 0, 0, 1 }

Definition at line 135 of file outfit.c.

◆ heatup_opts

os_opts heatup_opts = { N_( "Overheat" ), _UNIT_TIME, 0, 0, 1, 1 }
static

Definition at line 141 of file outfit.c.

◆ inflight_calib_opts

os_opts inflight_calib_opts
static
Initial value:
= {
N_( "In-flight Calibration" ), _UNIT_TIME, 0, 0, 1, 1 }

Definition at line 149 of file outfit.c.

◆ initial_speed_opts

os_opts initial_speed_opts
static
Initial value:
= {
N_( "Launch Speed" ), _UNIT_SPEED, 0, 0, 1, 0 }

Definition at line 151 of file outfit.c.

◆ jam_res_opts

os_opts jam_res_opts
static
Initial value:
= {
N_( "Jam Resistance" ), _UNIT_PERCENT, 0, 0, 1, 0 }

Definition at line 158 of file outfit.c.

◆ license_stack

char** license_stack = NULL
static

Stack of available licenses.

Definition at line 67 of file outfit.c.

◆ lockon_opts

os_opts lockon_opts = { N_( "Lock-On" ), _UNIT_TIME, 0, 0, 1, 0 }
static

Definition at line 148 of file outfit.c.

◆ mass_opts

os_opts mass_opts = { N_( "Mass" ), _UNIT_MASS, 0, 0, 1, 0 }
static

Definition at line 127 of file outfit.c.

◆ max_mass_opts

os_opts max_mass_opts
static
Initial value:
= {
N_( "Max Effective Mass" ), _UNIT_MASS, 0, 0, 1, 0 }

Definition at line 160 of file outfit.c.

◆ max_speed_opts

os_opts max_speed_opts = { N_( "Max Speed" ), _UNIT_SPEED, 0, 0, 1, 0 }
static

Definition at line 154 of file outfit.c.

◆ outfit_stack

Outfit* outfit_stack = NULL
static

Stack of outfits.

Definition at line 66 of file outfit.c.

◆ penetration_opts

os_opts penetration_opts
static
Initial value:
= {
N_( "Penetration" ), _UNIT_PERCENT, 0, 0, 1, 0 }

Definition at line 128 of file outfit.c.

◆ power_opts

os_opts power_opts = { N_( "Power" ), _UNIT_POWER, 0, 0, 1, 1 }
static

Definition at line 138 of file outfit.c.

◆ range_opts

os_opts range_opts = { N_( "Range" ), _UNIT_DISTANCE, 0, 0, 1, 0 }
static

Definition at line 139 of file outfit.c.

◆ reload_opts

os_opts reload_opts = { N_( "Reload Time" ), _UNIT_TIME, 0, 0, 1, 1 }
static

Definition at line 155 of file outfit.c.

◆ rumble_opts

os_opts rumble_opts = { N_( "Rumble" ), NULL, 0, 0, 1, 1 }
static

Definition at line 162 of file outfit.c.

◆ shots_delay_opts

os_opts shots_delay_opts
static
Initial value:
= {
N_( "Shots Delay" ), _UNIT_TIME, 0, 0, 1, 1 }

Definition at line 163 of file outfit.c.

◆ speed_opts

os_opts speed_opts = { N_( "Speed" ), _UNIT_SPEED, 0, 0, 1, 0 }
static

Definition at line 140 of file outfit.c.

◆ swivel_opts

os_opts swivel_opts = { N_( "Swivel" ), _UNIT_ANGLE, 0, 0, 1, 0 }
static

Definition at line 144 of file outfit.c.

◆ tracking_opts

os_opts tracking_opts = { N_( "Tracking" ), _UNIT_DISTANCE, 0, 0, 1, 0 }
static

Definition at line 145 of file outfit.c.