naev 0.10.4
Macros | Functions | Variables
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 "nfile.h"
#include "nlua.h"
#include "nlua_gfx.h"
#include "nlua_pilotoutfit.h"
#include "nlua_outfit.h"
#include "nlua_camera.h"
#include "nlua_hook.h"
#include "nstring.h"
#include "nxml.h"
#include "pilot.h"
#include "pilot_heat.h"
#include "ship.h"
#include "slots.h"
#include "spfx.h"
#include "unistd.h"

Go to the source code of this file.

Macros

#define outfit_setProp(o, p)   ((o)->properties |= p)
 
#define XML_OUTFIT_TAG   "outfit"
 
#define OUTFIT_SHORTDESC_MAX   STRMAX_SHORT
 
#define SDESC_ADD(l, temp, txt, args...)   (l) += scnprintf( &(temp)->summary_raw[l], OUTFIT_SHORTDESC_MAX-(l), (txt), ## args )
 
#define SDESC_COLOUR(l, temp, txt, val, args...)
 
#define SDESC_COLOURT(l, temp, txt, threshold, val, args...)
 
#define SDESC_COND(l, temp, txt, val, args...)
 
#define SDESC_COND_COLOUR(l, temp, txt, val, args...)
 
#define O_CMP(s, t)   if (strcasecmp(buf,(s))==0) return t
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN( _("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN(_("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 
#define MELEMENT(o, s)   if (o) WARN( _("Outfit '%s' missing/invalid '%s' element"), temp->name, s)
 

Functions

static OutfitType outfit_strToOutfitType (char *buf)
 Gets the outfit type from a human readable string. More...
 
static int outfit_loadDir (char *dir)
 Loads all the files in a directory. More...
 
static int outfit_parseDamage (Damage *dmg, xmlNodePtr node)
 Parses a damage node. More...
 
static int outfit_parse (Outfit *temp, const char *file)
 Parses and returns Outfit from parent node. More...
 
static void outfit_parseSBolt (Outfit *temp, const xmlNodePtr parent)
 Parses the specific area for a bolt weapon and loads it into Outfit. More...
 
static void outfit_parseSBeam (Outfit *temp, const xmlNodePtr parent)
 Parses the beam weapon specifics of an outfit. More...
 
static void outfit_parseSLauncher (Outfit *temp, const xmlNodePtr parent)
 Parses the specific area for a launcher and loads it into Outfit. More...
 
static void outfit_parseSMod (Outfit *temp, const xmlNodePtr parent)
 Parses the modification tidbits of the outfit. More...
 
static void outfit_parseSAfterburner (Outfit *temp, const xmlNodePtr parent)
 Parses the afterburner tidbits of the outfit. More...
 
static void outfit_parseSFighterBay (Outfit *temp, const xmlNodePtr parent)
 Parses the fighter bay tidbits of the outfit. More...
 
static void outfit_parseSMap (Outfit *temp, const xmlNodePtr parent)
 Parses the map tidbits of the outfit. More...
 
static void outfit_parseSLocalMap (Outfit *temp, const xmlNodePtr parent)
 Parses the map tidbits of the outfit. More...
 
static void outfit_parseSGUI (Outfit *temp, const xmlNodePtr parent)
 Parses the GUI tidbits of the outfit. More...
 
static void outfit_parseSLicense (Outfit *temp, const xmlNodePtr parent)
 Parses the license tidbits of the outfit. More...
 
static int outfit_loadPLG (Outfit *temp, const char *buf, unsigned int bolt)
 Loads the collision polygon for a bolt outfit. More...
 
static void sdesc_miningRarity (int *l, Outfit *temp, int rarity)
 Adds a small blurb about rarity mining. More...
 
static int outfit_cmp (const void *p1, const void *p2)
 
const Outfitoutfit_get (const char *name)
 Gets an outfit by name. More...
 
const Outfitoutfit_getW (const char *name)
 Gets an outfit by name without warning on no-find. More...
 
const Outfitoutfit_getAll (void)
 Gets the array (array.h) of all outfits. More...
 
const char * outfit_existsCase (const char *name)
 Checks to see if an outfit exists matching name (case insensitive). More...
 
char ** outfit_searchFuzzyCase (const char *name, int *n)
 Does a fuzzy search of all the outfits. Searches translated names but returns internal names. More...
 
int outfit_compareTech (const void *outfit1, const void *outfit2)
 Function meant for use with C89, C99 algorithm qsort(). More...
 
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. More...
 
const char * slotName (const OutfitSlotType type)
 
const char * slotSize (const OutfitSlotSize o)
 Gets the slot size as a string. More...
 
const char * outfit_slotSize (const Outfit *o)
 Gets the name of the slot size of an outfit. More...
 
const glColour * outfit_slotSizeColour (const OutfitSlot *os)
 Gets the slot size colour for an outfit slot. More...
 
char outfit_slotSizeColourFont (const OutfitSlot *os)
 Gets a font colour character that roughly matches an outfit slot size colour. More...
 
char outfit_slotTypeColourFont (const OutfitSlot *os)
 Gets a font colour character that roughly matches an outfit slot type colour. More...
 
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. More...
 
OutfitSlotSize outfit_toSlotSize (const char *s)
 Gets the outfit slot size from a human readable string. More...
 
int outfit_isActive (const Outfit *o)
 Checks if outfit is an active outfit. More...
 
int outfit_isToggleable (const Outfit *o)
 Checks if outfit can be toggled. More...
 
int outfit_isForward (const Outfit *o)
 Checks if outfit is a fixed mounted weapon. More...
 
int outfit_isBolt (const Outfit *o)
 Checks if outfit is bolt type weapon. More...
 
int outfit_isBeam (const Outfit *o)
 Checks if outfit is a beam type weapon. More...
 
int outfit_isLauncher (const Outfit *o)
 Checks if outfit is a weapon launcher. More...
 
int outfit_isSeeker (const Outfit *o)
 Checks if outfit is a seeking weapon. More...
 
int outfit_isTurret (const Outfit *o)
 Checks if outfit is a turret class weapon. More...
 
int outfit_isMod (const Outfit *o)
 Checks if outfit is a ship modification. More...
 
int outfit_isAfterburner (const Outfit *o)
 Checks if outfit is an afterburner. More...
 
int outfit_isFighterBay (const Outfit *o)
 Checks if outfit is a fighter bay. More...
 
int outfit_isMap (const Outfit *o)
 Checks if outfit is a space map. More...
 
int outfit_isLocalMap (const Outfit *o)
 Checks if outfit is a local space map. More...
 
int outfit_isLicense (const Outfit *o)
 Checks if outfit is a license. More...
 
int outfit_isGUI (const Outfit *o)
 Checks if outfit is a GUI. More...
 
int outfit_isSecondary (const Outfit *o)
 Checks if outfit has the secondary flag set. More...
 
const glTextureoutfit_gfx (const Outfit *o)
 Gets the outfit's graphic effect. More...
 
const CollPolyoutfit_plg (const Outfit *o)
 Gets the outfit's collision polygon. More...
 
int outfit_spfxArmour (const Outfit *o)
 Gets the outfit's sound effect. More...
 
int outfit_spfxShield (const Outfit *o)
 Gets the outfit's sound effect. More...
 
const Damageoutfit_damage (const Outfit *o)
 Gets the outfit's damage. More...
 
double outfit_delay (const Outfit *o)
 Gets the outfit's delay. More...
 
int outfit_amount (const Outfit *o)
 Gets the amount an outfit can hold. More...
 
double outfit_energy (const Outfit *o)
 Gets the outfit's energy usage. More...
 
double outfit_heat (const Outfit *o)
 Gets the outfit's heat generation. More...
 
double outfit_cpu (const Outfit *o)
 Gets the outfit's cpu usage. More...
 
double outfit_range (const Outfit *o)
 Gets the outfit's range. More...
 
double outfit_speed (const Outfit *o)
 Gets the outfit's speed. More...
 
double outfit_spin (const Outfit *o)
 Gets the outfit's animation spin. More...
 
double outfit_trackmin (const Outfit *o)
 Gets the outfit's minimal tracking. More...
 
double outfit_trackmax (const Outfit *o)
 Gets the outfit's minimal tracking. More...
 
int outfit_miningRarity (const Outfit *o)
 Gets the maximum rarity the outfit can mine up to. More...
 
int outfit_sound (const Outfit *o)
 Gets the outfit's sound. More...
 
int outfit_soundHit (const Outfit *o)
 Gets the outfit's hit sound. More...
 
double outfit_ammoMass (const Outfit *o)
 Gets the outfit's ammunition mass. More...
 
double outfit_duration (const Outfit *o)
 Gets the outfit's duration. More...
 
double outfit_cooldown (const Outfit *o)
 Gets the outfit's cooldown. More...
 
const char * outfit_getType (const Outfit *o)
 Gets the outfit's specific type. More...
 
const char * outfit_getTypeBroad (const Outfit *o)
 Gets the outfit's broad type. More...
 
const char * outfit_getAmmoAI (const Outfit *o)
 Gets a human-readable string describing an ammo outfit's AI. More...
 
const char * outfit_description (const Outfit *o)
 Gets the description of an outfit. More...
 
const char * outfit_summary (const Outfit *o, int withname)
 Gets the summary of an outfit. More...
 
int outfit_fitsSlot (const Outfit *o, const OutfitSlot *s)
 Checks to see if an outfit fits a slot. More...
 
int outfit_fitsSlotType (const Outfit *o, const OutfitSlot *s)
 Checks to see if an outfit fits a slot type (ignoring size). More...
 
void outfit_freeSlot (OutfitSlot *s)
 Frees an outfit slot. More...
 
int outfit_load (void)
 Loads all the outfits. More...
 
int outfit_loadPost (void)
 Loads all the outfits legality. More...
 
int outfit_mapParse (void)
 Parses all the maps. More...
 
glTexturerarity_texture (int rarity)
 
int outfit_checkIllegal (const Outfit *o, int fct)
 Checks illegality of an outfit to a faction. More...
 
int outfit_licenseExists (const char *name)
 Checks to see if a license exists. More...
 
void outfit_free (void)
 Frees the outfit stack. More...
 

Variables

static Outfitoutfit_stack = NULL
 
static char ** license_stack = NULL
 

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

◆ O_CMP

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

Define to help with outfit_strToOutfitType.

Definition at line 1054 of file outfit.c.

◆ outfit_setProp

#define outfit_setProp (   o,
 
)    ((o)->properties |= p)

Checks outfit property.

Definition at line 46 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 50 of file outfit.c.

◆ SDESC_ADD

#define SDESC_ADD (   l,
  temp,
  txt,
  args... 
)    (l) += scnprintf( &(temp)->summary_raw[l], OUTFIT_SHORTDESC_MAX-(l), (txt), ## args )

Definition at line 61 of file outfit.c.

◆ SDESC_COLOUR

#define SDESC_COLOUR (   l,
  temp,
  txt,
  val,
  args... 
)
Value:
SDESC_ADD( l, temp, "#%c", ((val)>0)?'g':(((val)<0)?'r':'0') ); \
SDESC_ADD( l, temp, txt, (val), ## args ); \
SDESC_ADD( l, temp, "#0" )

Definition at line 63 of file outfit.c.

◆ SDESC_COLOURT

#define SDESC_COLOURT (   l,
  temp,
  txt,
  threshold,
  val,
  args... 
)
Value:
SDESC_ADD( l, temp, "#%c", ((val)>threshold)?'g':(((val)<threshold)?'r':'0') ); \
SDESC_ADD( l, temp, txt, (val), ## args ); \
SDESC_ADD( l, temp, "#0" )

Definition at line 68 of file outfit.c.

◆ SDESC_COND

#define SDESC_COND (   l,
  temp,
  txt,
  val,
  args... 
)
Value:
if (fabs(val) > 1e-5) { \
SDESC_ADD( l, temp, txt, (val), ## args ); \
}

Definition at line 73 of file outfit.c.

◆ SDESC_COND_COLOUR

#define SDESC_COND_COLOUR (   l,
  temp,
  txt,
  val,
  args... 
)
Value:
if (fabs(val) > 1e-5) { \
SDESC_COLOUR( l, temp, txt, (val), ## args ); \
}

Definition at line 77 of file outfit.c.

◆ XML_OUTFIT_TAG

#define XML_OUTFIT_TAG   "outfit"

XML section identifier.

Definition at line 48 of file outfit.c.

Function Documentation

◆ 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 840 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 670 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 2736 of file outfit.c.

◆ outfit_cmp()

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

Definition at line 104 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 195 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 866 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 703 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 647 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 658 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 955 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 851 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 681 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 149 of file outfit.c.

◆ outfit_filterCore()

int outfit_filterCore ( const Outfit o)

Definition at line 264 of file outfit.c.

◆ outfit_filterOther()

int outfit_filterOther ( const Outfit o)

Definition at line 267 of file outfit.c.

◆ outfit_filterStructure()

int outfit_filterStructure ( const Outfit o)

Definition at line 261 of file outfit.c.

◆ outfit_filterUtility()

int outfit_filterUtility ( const Outfit o)

Definition at line 258 of file outfit.c.

◆ outfit_filterWeapon()

int outfit_filterWeapon ( const Outfit o)

Definition at line 255 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 981 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 1025 of file outfit.c.

◆ outfit_free()

void outfit_free ( void  )

Frees the outfit stack.

Definition at line 2759 of file outfit.c.

◆ outfit_freeSlot()

void outfit_freeSlot ( OutfitSlot s)

Frees an outfit slot.

Parameters
sSlot to free.

Definition at line 1047 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 118 of file outfit.c.

◆ outfit_getAll()

const Outfit * outfit_getAll ( void  )

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

Definition at line 141 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 931 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 394 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 879 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 910 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 132 of file outfit.c.

◆ outfit_gfx()

const glTexture * outfit_gfx ( const Outfit o)

Gets the outfit's graphic effect.

Parameters
oOutfit to get information from.

Definition at line 605 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 692 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 434 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 541 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 488 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 478 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 550 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 468 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 586 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 498 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 577 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 568 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 559 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 532 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 596 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 508 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 450 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 521 of file outfit.c.

◆ outfit_licenseExists()

int outfit_licenseExists ( const char *  name)

Checks to see if a license exists.

Definition at line 2748 of file outfit.c.

◆ outfit_load()

int outfit_load ( void  )

Loads all the outfits.

Returns
0 on success.

Definition at line 2511 of file outfit.c.

◆ outfit_loadDir()

static int outfit_loadDir ( char *  dir)
static

Loads all the files in a directory.

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

Definition at line 2486 of file outfit.c.

◆ outfit_loadPLG()

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

Loads the collision polygon for a bolt outfit.

Parameters
tempOutfit to load into.
bufName of the file.
bolt1 if outfit is a Bolt, 0 if it is an Ammo

Definition at line 1152 of file outfit.c.

◆ outfit_loadPost()

int outfit_loadPost ( void  )

Loads all the outfits legality.

Returns
0 on success.

Definition at line 2634 of file outfit.c.

◆ outfit_mapParse()

int outfit_mapParse ( void  )

Parses all the maps.

Definition at line 2685 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 806 of file outfit.c.

◆ outfit_parse()

static 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

< Define to help check for data errors.

Definition at line 2207 of file outfit.c.

◆ outfit_parseDamage()

static 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 1107 of file outfit.c.

◆ outfit_parseSAfterburner()

static 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.

< Define to help check for data errors.

Definition at line 1854 of file outfit.c.

◆ outfit_parseSBeam()

static 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.

< Define to help check for data errors.

Definition at line 1417 of file outfit.c.

◆ outfit_parseSBolt()

static 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.

< Define to help check for data errors.

Definition at line 1227 of file outfit.c.

◆ outfit_parseSFighterBay()

static 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.

< Define to help check for data errors.

Definition at line 1945 of file outfit.c.

◆ outfit_parseSGUI()

static 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 2133 of file outfit.c.

◆ outfit_parseSLauncher()

static 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.

< Define to help check for data errors.

Definition at line 1567 of file outfit.c.

◆ outfit_parseSLicense()

static 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 2166 of file outfit.c.

◆ outfit_parseSLocalMap()

static 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 2096 of file outfit.c.

◆ outfit_parseSMap()

static 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 1998 of file outfit.c.

◆ outfit_parseSMod()

static 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 1802 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 615 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 711 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 160 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 279 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 330 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 341 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 358 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 375 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 818 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 829 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 742 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 625 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 636 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 771 of file outfit.c.

◆ outfit_strToOutfitType()

static 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 1061 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 969 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 411 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 794 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 782 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 2726 of file outfit.c.

◆ sdesc_miningRarity()

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

Adds a small blurb about rarity mining.

Definition at line 1085 of file outfit.c.

◆ slotName()

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

Definition at line 287 of file outfit.c.

◆ slotSize()

const char * slotSize ( const OutfitSlotSize  o)

Gets the slot size as a string.

Definition at line 308 of file outfit.c.

Variable Documentation

◆ license_stack

char** license_stack = NULL
static

Stack of available licenses.

Definition at line 56 of file outfit.c.

◆ outfit_stack

Outfit* outfit_stack = NULL
static

Stack of outfits.

Definition at line 55 of file outfit.c.