naev 0.11.5
pilot.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "pilot_flags.h"
7
8#include "ai.h"
9#include "commodity.h"
10#include "effect.h"
11#include "faction.h"
12#include "ntime.h"
13#include "outfit.h"
14#include "physics.h"
15#include "ship.h"
16#include "sound.h"
17#include "space.h"
18#include "spfx.h"
19#include "lvar.h"
20#include "intlist.h"
21
22#define PLAYER_ID 1
24/* Hyperspace parameters. */
25#define HYPERSPACE_ENGINE_DELAY 3.
26#define HYPERSPACE_FLY_DELAY 5.
27#define HYPERSPACE_DUST_BLUR 3.
28#define HYPERSPACE_DUST_LENGTH 250
29#define HYPERSPACE_FADEOUT 1.
30#define HYPERSPACE_FADEIN 1.
31#define HYPERSPACE_ACCEL 2000.
32#define HYPERSPACE_VEL (2.*HYPERSPACE_ACCEL*HYPERSPACE_FLY_DELAY)
33#define HYPERSPACE_ENTER_MIN (HYPERSPACE_VEL*0.3)
34#define HYPERSPACE_ENTER_MAX (HYPERSPACE_VEL*0.4)
35#define HYPERSPACE_EXIT_MIN 1500.
36/* Land/takeoff. */
37#define PILOT_LANDING_DELAY 1.
38#define PILOT_TAKEOFF_DELAY 1.
39/* Refueling. */
40#define PILOT_REFUEL_TIME 3.
41/* Misc. */
42#define PILOT_SIZE_APPROX 0.8
43#define PILOT_WEAPON_SETS 10
44#define PILOT_WEAPSET_MAX_LEVELS 2
45#define PILOT_REVERSE_THRUST 0.4
46#define PILOT_PLAYER_NONTARGETABLE_TAKEOFF_DELAY 5.
47#define PILOT_PLAYER_NONTARGETABLE_JUMPIN_DELAY 5.
49/* Pilot-related hooks. */
50typedef enum PilotHookType_ {
51 PILOT_HOOK_NONE,
52 PILOT_HOOK_CREATION,
53 PILOT_HOOK_DEATH,
54 PILOT_HOOK_BOARDING,
55 PILOT_HOOK_BOARD,
56 PILOT_HOOK_BOARD_ALL,
57 PILOT_HOOK_DISABLE,
58 PILOT_HOOK_UNDISABLE,
59 PILOT_HOOK_JUMP,
60 PILOT_HOOK_HAIL,
61 PILOT_HOOK_LAND,
62 PILOT_HOOK_ATTACKED,
63 PILOT_HOOK_DISCOVERED,
64 PILOT_HOOK_SCAN,
65 PILOT_HOOK_SCANNED,
66 PILOT_HOOK_IDLE,
67 PILOT_HOOK_EXPLODED,
68 PILOT_HOOK_LOCKON,
69 PILOT_HOOK_STEALTH,
70} PilotHookType;
71
72/* Damage */
73#define PILOT_HOSTILE_THRESHOLD 0.09
74#define PILOT_HOSTILE_DECAY 0.005
76/* Makes life easier */
77#define pilot_isPlayer(p) pilot_isFlag(p,PILOT_PLAYER)
78#define pilot_isDisabled(p) pilot_isFlag(p,PILOT_DISABLED)
79#define pilot_isStopped(p) (VMOD(p->solid.vel) <= MIN_VEL_ERR)
80/* We would really have to recursively go up all the parents to check, but we're being cheap. */
81#define pilot_isWithPlayer(p) ((p)->faction == FACTION_PLAYER || ((p)->parent == PLAYER_ID))
82
88typedef enum PilotOutfitState_ {
89 PILOT_OUTFIT_OFF,
90 PILOT_OUTFIT_WARMUP,
91 PILOT_OUTFIT_ON,
92 PILOT_OUTFIT_COOLDOWN
93} PilotOutfitState;
94
98typedef struct PilotOutfitAmmo_ {
102 int in_arc;
104
108typedef struct PilotOutfitSlot_ {
109 int id;
111 /* Outfit slot properties. */
112 const Outfit* outfit;
113 int active;
116 /* Heat. */
117 double heat_T;
118 double heat_C;
119 double heat_area;
122 /* Current state. */
123 PilotOutfitState state;
124 double stimer;
125 double timer;
126 double rtimer;
127 double progress;
128 int level;
130 unsigned int inrange;
132 /* Type-specific data. */
133 union {
134 unsigned int beamid;
136 } u;
137
138 /* In the case of Lua stuff. */
142
146typedef struct PilotWeaponSetOutfit_ {
147 int level;
148 double range2;
149 int slotid;
151
152typedef enum WeaponSetType_ {
153 WEAPSET_TYPE_SWITCH=0,
154 WEAPSET_TYPE_HOLD=1,
155 WEAPSET_TYPE_TOGGLE=2,
156} WeaponSetType;
157
164typedef struct PilotWeaponSet_ {
165 WeaponSetType type;
166 int active;
168 /* Only applicable to weapon type. */
170 int manual;
171 int volley;
172 double range[PILOT_WEAPSET_MAX_LEVELS];
173 double speed[PILOT_WEAPSET_MAX_LEVELS];
175
179typedef struct PilotCommodity_ {
182 unsigned int id;
184
188typedef struct PilotHook_ {
189 int type;
190 unsigned int id;
191} PilotHook;
192
196typedef enum EscortType_e {
197 ESCORT_TYPE_NULL,
198 ESCORT_TYPE_BAY,
199 ESCORT_TYPE_MERCENARY,
200 ESCORT_TYPE_FLEET,
201} EscortType_t;
202
206typedef struct Escort_s {
207 const Ship *ship;
208 EscortType_t type;
209 unsigned int id;
210 /* TODO: something better than this */
212} Escort_t;
213
217typedef struct Pilot_ {
218 unsigned int id;
219 char* name;
221 /* Fleet/faction management. */
225 /* Object characteristics */
226 const Ship* ship;
228 double base_mass;
231 int tsx;
232 int tsy;
235 /* Properties. */
236 int cpu;
238 double crew;
239 double cap_cargo;
241 /* Movement */
242 double accel;
244 double speed;
247 double turn;
248 double turn_base;
250 /* Current health */
251 double armour;
252 double stress;
253 double shield;
259 double fuel_max;
260 double fuel;
263 /* Energy is handled a bit differently. */
264 double energy;
265 double energy_max;
267 double energy_tau;
268 double energy_loss;
270 /* Defensive Electronic Warfare. */
273 double ew_stealth;
274 /* Defensive Electronic Warfare. */
275 double ew_mass;
276 double ew_asteroid;
278 /* misc. */
281 /* Heat. */
282 double heat_T;
283 double heat_C;
284 double heat_emis;
285 double heat_cond;
286 double heat_area;
287 double cdelay;
288 double ctimer;
289 double heat_start;
291 /* Ship statistics. */
296 /* Ship effects. */
299 /* Outfit management */
306 /* Primarily for AI usage. */
309 int nbeams;
315 /* For easier usage. */
318 /* Weapon sets. */
319 PilotWeaponSet weapon_sets[PILOT_WEAPON_SETS];
324 /* Cargo */
325 credits_t credits;
329 /* Hook attached to the pilot */
332 /* Escort stuff. */
333 unsigned int parent;
335 unsigned int dockpilot;
341 /* Targeting. */
342 unsigned int target;
343 void *ptarget;
349 /* AI */
352 double tcontrol;
353 double timer[MAX_AI_TIMERS];
355 unsigned int shoot_indicator;
357 /* Ship Lua. */
361 /* Misc */
364 char *comm_msg;
365 PilotFlags flags;
367 double pdata;
368 double ptimer;
369 double itimer;
370 double htimer;
371 double stimer;
372 double sbonus;
373 double dtimer;
375 double otimer;
376 double scantimer;
380 int *mounted;
386} Pilot;
387
388/* These depend on Pilot being defined first. */
389#include "pilot_cargo.h"
390#include "pilot_heat.h"
391#include "pilot_hook.h"
392#include "pilot_outfit.h"
393#include "pilot_weapon.h"
394#include "pilot_ew.h"
395
396/* Getting pilot stuff. */
397Pilot*const* pilot_getAll (void);
398Pilot* pilot_get( unsigned int id );
400unsigned int pilot_getNextID( unsigned int id, int mode );
401unsigned int pilot_getPrevID( unsigned int id, int mode );
402unsigned int pilot_getNearestEnemy( const Pilot* p );
403unsigned int pilot_getNearestEnemy_size( const Pilot* p, double target_mass_LB, double target_mass_UB );
404unsigned int pilot_getNearestEnemy_heuristic(const Pilot* p, double mass_factor, double health_factor, double damage_factor, double range_factor);
405unsigned int pilot_getNearestHostile (void); /* only for the player */
406unsigned int pilot_getNearestPilot( const Pilot* p );
407unsigned int pilot_getBoss( const Pilot* p );
408double pilot_getNearestPosPilot( const Pilot *p, Pilot **tp, double x, double y, int disabled );
409double pilot_getNearestPos( const Pilot *p, unsigned int *tp, double x, double y, int disabled );
410double pilot_getNearestAng( const Pilot *p, unsigned int *tp, double ang, int disabled );
411int pilot_getJumps( const Pilot* p );
412const glColour* pilot_getColour( const Pilot* p );
413int pilot_validTarget( const Pilot* p, const Pilot* target );
414int pilot_canTarget( const Pilot* p );
415
416/* non-lua wrappers */
417double pilot_relsize( const Pilot* cur_pilot, const Pilot* p );
418double pilot_reldps( const Pilot* cur_pilot, const Pilot* p );
419double pilot_relhp( const Pilot* cur_pilot, const Pilot* p );
420
421/* Combat. */
422void pilot_setTarget( Pilot* p, unsigned int id );
423double pilot_hit( Pilot* p, const Solid* w, const Pilot *pshooter,
424 const Damage *dmg, const Outfit *outfit, int lua_mem, int reset );
425void pilot_updateDisable( Pilot* p, unsigned int shooter );
426void pilot_explode( double x, double y, double radius, const Damage *dmg, const Pilot *parent );
427double pilot_face( Pilot* p, double dir, double dt );
429double pilot_minbrakedist( const Pilot *p, double dt );
430int pilot_brake( Pilot* p, double dt );
431void pilot_cooldown( Pilot *p, int dochecks );
432void pilot_cooldownEnd( Pilot *p, const char *reason );
433double pilot_aimAngle( Pilot *p, const vec2* pos, const vec2* vel );
434
435/* Outfits */
436int pilot_numOutfit( const Pilot *p, const Outfit *o );
437void pilot_dpseps( const Pilot *p, double *pdps, double *peps );
438
439/* Money. */
440credits_t pilot_worth( const Pilot *p, int count_unique );
441int pilot_hasCredits( const Pilot *p, credits_t amount );
442credits_t pilot_modCredits( Pilot *p, credits_t amount );
443
444/* Creation. */
445Pilot *pilot_create( const Ship* ship, const char* name, int faction, const char *ai,
446 double dir, const vec2* pos, const vec2* vel,
447 const PilotFlags flags, unsigned int dockpilot, int dockslot );
448Pilot* pilot_createEmpty( const Ship* ship, const char* name,
449 int faction, PilotFlags flags );
450unsigned int pilot_clone( const Pilot *p );
451unsigned int pilot_addStack( Pilot *p );
452void pilot_reset( Pilot* pilot );
453Pilot* pilot_setPlayer( Pilot* after );
454void pilot_choosePoint( vec2 *vp, Spob **spob, JumpPoint **jump, int lf, int ignore_rules, int guerilla );
455void pilot_delete( Pilot *p );
456void pilot_dead( Pilot* p, unsigned int killer );
457
458/* Init and cleanup. */
459void pilot_stackRemove( Pilot *p );
460void pilots_init (void);
461void pilots_free (void);
462void pilots_clean( int persist );
463void pilots_newSystem (void);
464void pilots_clear (void);
465void pilots_cleanAll (void);
466void pilot_free( Pilot* p );
467
468/* Movement. */
469void pilot_setAccel( Pilot *p, double accel );
470void pilot_setTurn( Pilot *p, double turn );
471
472/* Update. */
473void pilot_update( Pilot* pilot, double dt );
474void pilots_updatePurge (void);
475void pilots_update( double dt );
476void pilot_renderFramebuffer( Pilot *p, GLuint fbo, double fw, double fh );
477void pilots_render (void);
478void pilots_renderOverlay (void);
479void pilot_render( Pilot* pilot );
480void pilot_renderOverlay( Pilot* p );
481
482/* Communication. */
483void pilot_broadcast( Pilot *p, const char *msg, int ignore_int );
484void pilot_distress( Pilot *p, Pilot *attacker, const char *msg );
485void pilot_setCommMsg( Pilot *p, const char *s );
486
487/* Faction stuff. */
488int pilot_validEnemy( const Pilot* p, const Pilot* target );
489int pilot_validEnemyDist( const Pilot* p, const Pilot* target, double *dist );
490int pilot_areAllies( const Pilot *p, const Pilot *target );
491int pilot_areEnemies( const Pilot *p, const Pilot *target );
492void pilot_setHostile( Pilot *p );
493void pilot_rmHostile( Pilot *p );
494void pilot_setFriendly( Pilot *p );
495void pilot_rmFriendly( Pilot *p );
496int pilot_isHostile( const Pilot *p );
497int pilot_isNeutral( const Pilot *p );
498int pilot_isFriendly( const Pilot *p );
499char pilot_getFactionColourChar( const Pilot *p );
500
501/* Misc details. */
502void pilot_msg( const Pilot *p, const Pilot *receiver, const char *type, unsigned int index );
503void pilot_clearTrails( Pilot *p );
504void pilot_sample_trails( Pilot* p, int none );
505int pilot_hasIllegal( const Pilot *p, int faction );
506int pilot_refuelStart( Pilot *p );
508void pilot_clearTimers( Pilot *pilot );
509int pilot_hasDeployed( const Pilot *p );
510int pilot_dock( Pilot *p, Pilot *target );
511ntime_t pilot_hyperspaceDelay( const Pilot *p );
512void pilot_untargetAsteroid( int anchor, int asteroid );
514const IntList *pilot_collideQuery( int x1, int y1, int x2, int y2 );
515void pilot_collideQueryIL( IntList *il, int x1, int y1, int x2, int y2 );
516void pilot_quadtreeParams( int max_elem, int depth );
Pilot * cur_pilot
Definition ai.c:338
char pilot_getFactionColourChar(const Pilot *p)
Gets the faction colour char, works like faction_getColourChar but for a pilot.
Definition pilot.c:1080
void pilot_free(Pilot *p)
Frees and cleans up a pilot.
Definition pilot.c:3555
void pilot_stackRemove(Pilot *p)
Tries to remove a pilot from the stack.
Definition pilot.c:3640
unsigned int pilot_getNearestEnemy_size(const Pilot *p, double target_mass_LB, double target_mass_UB)
Gets the nearest enemy to the pilot closest to the pilot whose mass is between LB and UB.
Definition pilot.c:352
void pilot_choosePoint(vec2 *vp, Spob **spob, JumpPoint **jump, int lf, int ignore_rules, int guerilla)
Finds a spawn point for a pilot.
Definition pilot.c:3442
int pilot_isHostile(const Pilot *p)
Checks to see if pilot is hostile to the player.
Definition pilot.c:678
void pilot_updateDisable(Pilot *p, unsigned int shooter)
Handles pilot disabling. Set or unset the disable status depending on health and stress values.
Definition pilot.c:1550
void pilot_cooldown(Pilot *p, int dochecks)
Begins active cooldown, reducing hull and outfit temperatures.
Definition pilot.c:893
int pilot_brakeCheckReverseThrusters(const Pilot *p)
See if the pilot wants to use their reverse thrusters to brake.
Definition pilot.c:821
void pilot_rmHostile(Pilot *p)
Unmarks a pilot as hostile to player.
Definition pilot.c:1233
unsigned int pilot_addStack(Pilot *p)
Adds a pilot to the stack.
Definition pilot.c:3358
void pilots_updatePurge(void)
Purges pilots set for deletion.
Definition pilot.c:3797
void pilot_quadtreeParams(int max_elem, int depth)
Sets the quad tree parameters. Can have significant impact on performance.
Definition pilot.c:4177
double pilot_relhp(const Pilot *cur_pilot, const Pilot *p)
Gets the relative hp(combined shields and armour) between the current pilot and the specified target.
Definition pilot.c:4082
int pilot_validEnemy(const Pilot *p, const Pilot *target)
Checks to see if a pilot is a valid enemy for another pilot.
Definition pilot.c:277
double pilot_relsize(const Pilot *cur_pilot, const Pilot *p)
Gets the relative size(shipmass) between the current pilot and the specified target.
Definition pilot.c:3982
int pilot_areEnemies(const Pilot *p, const Pilot *target)
Like areEnemies but for pilots.
Definition pilot.c:745
void pilots_clear(void)
Clears all the pilots except the player and clear-exempt pilots.
Definition pilot.c:3772
unsigned int pilot_getNearestPilot(const Pilot *p)
Get the nearest pilot to a pilot.
Definition pilot.c:423
void pilots_clean(int persist)
Cleans up the pilot stack - leaves the player.
Definition pilot.c:3696
Pilot * pilot_getTarget(Pilot *p)
Gets the target of a pilot using a fancy caching system.
Definition pilot.c:634
Pilot * pilot_createEmpty(const Ship *ship, const char *name, int faction, PilotFlags flags)
Creates a pilot without adding it to the stack.
Definition pilot.c:3301
double pilot_face(Pilot *p, double dir, double dt)
Tries to turn the pilot to face dir.
Definition pilot.c:810
double pilot_getNearestPos(const Pilot *p, unsigned int *tp, double x, double y, int disabled)
Get the nearest pilot to a pilot from a certain position.
Definition pilot.c:547
void pilot_clearTimers(Pilot *pilot)
Clears the pilot's timers.
Definition pilot.c:3945
double pilot_reldps(const Pilot *cur_pilot, const Pilot *p)
Gets the relative damage output(total DPS) between the current pilot and the specified target.
Definition pilot.c:4061
void pilot_msg(const Pilot *p, const Pilot *receiver, const char *type, unsigned int idx)
Sends a message.
Definition pilot.c:4120
void pilot_dead(Pilot *p, unsigned int killer)
Pilot is dead, now will slowly explode.
Definition pilot.c:1628
Pilot * pilot_setPlayer(Pilot *after)
Replaces the player's pilot with an alternate ship with the same ID.
Definition pilot.c:3396
int pilot_validEnemyDist(const Pilot *p, const Pilot *target, double *dist)
Same as pilot_validEnemy, but able to store the distance too.
Definition pilot.c:285
void pilot_renderOverlay(Pilot *p)
Renders the pilot overlay.
Definition pilot.c:2026
void pilot_setAccel(Pilot *p, double accel)
Sets the pilot's accel.
Definition pilot.c:659
void pilot_cooldownEnd(Pilot *p, const char *reason)
Terminates active cooldown.
Definition pilot.c:959
credits_t pilot_modCredits(Pilot *p, credits_t amount)
Modifies the amount of credits the pilot has.
Definition pilot.c:3004
unsigned int pilot_getNearestEnemy(const Pilot *p)
Gets the nearest enemy to the pilot.
Definition pilot.c:323
void pilot_setFriendly(Pilot *p)
Marks pilot as friendly to player.
Definition pilot.c:1251
void pilot_hyperspaceAbort(Pilot *p)
Stops the pilot from hyperspacing.
Definition pilot.c:2857
void pilot_setTurn(Pilot *p, double turn)
Sets the pilot's turn.
Definition pilot.c:667
int pilot_validTarget(const Pilot *p, const Pilot *target)
Checks to see if a pilot is a valid target for another pilot.
Definition pilot.c:237
void pilot_explode(double x, double y, double radius, const Damage *dmg, const Pilot *parent)
Makes the pilot explosion.
Definition pilot.c:1683
void pilot_reset(Pilot *pilot)
Resets a pilot.
Definition pilot.c:3185
int pilot_isFriendly(const Pilot *p)
Checks to see if pilot is friendly to the player.
Definition pilot.c:708
int pilot_refuelStart(Pilot *p)
Attempts to start refueling the pilot's target.
Definition pilot.c:2887
void pilots_renderOverlay(void)
Renders all the pilots overlays.
Definition pilot.c:3926
int pilot_isNeutral(const Pilot *p)
Checks to see if pilot is neutral to the player.
Definition pilot.c:695
PilotOutfitSlot * pilot_getDockSlot(Pilot *p)
Gets the dock slot of the pilot.
Definition pilot.c:776
void pilots_init(void)
Initializes pilot stuff.
Definition pilot.c:3654
int pilot_hasIllegal(const Pilot *p, int faction)
Checks to see if the pilot has illegal stuf to a faction.
Definition pilot.c:4153
void pilot_setCommMsg(Pilot *p, const char *s)
Sets the overhead communication message of the pilot.
Definition pilot.c:1096
Pilot * pilot_get(unsigned int id)
Pulls a pilot out of the pilot_stack based on ID.
Definition pilot.c:620
ntime_t pilot_hyperspaceDelay(const Pilot *p)
Calculates the hyperspace delay for a pilot.
Definition pilot.c:2948
void pilot_broadcast(Pilot *p, const char *msg, int ignore_int)
Has the pilot broadcast a message.
Definition pilot.c:1111
void pilot_setHostile(Pilot *p)
Marks pilot as hostile to player.
Definition pilot.c:1066
double pilot_getNearestPosPilot(const Pilot *p, Pilot **tp, double x, double y, int disabled)
Get the nearest pilot to a pilot from a certain position.
Definition pilot.c:503
void pilot_dpseps(const Pilot *p, double *pdps, double *peps)
Calculates the dps and eps of a pilot.
Definition pilot.c:3994
const glColour * pilot_getColour(const Pilot *p)
Gets a pilot's colour.
Definition pilot.c:1284
void pilot_distress(Pilot *p, Pilot *attacker, const char *msg)
Has the pilot broadcast a distress signal.
Definition pilot.c:1139
void pilot_render(Pilot *p)
Renders the pilot.
Definition pilot.c:1876
Pilot *const * pilot_getAll(void)
Gets the pilot stack.
Definition pilot.c:94
int pilot_canTarget(const Pilot *p)
Same as pilot_validTarget but without the range check.
Definition pilot.c:254
credits_t pilot_worth(const Pilot *p, int count_unique)
Gets the price or worth of a pilot in credits.
Definition pilot.c:4096
unsigned int pilot_getNearestEnemy_heuristic(const Pilot *p, double mass_factor, double health_factor, double damage_factor, double range_factor)
Gets the nearest enemy to the pilot closest to the pilot whose mass is between LB and UB.
Definition pilot.c:387
double pilot_aimAngle(Pilot *p, const vec2 *pos, const vec2 *vel)
Returns the angle for a pilot to aim at another pilot.
Definition pilot.c:999
void pilots_newSystem(void)
Updates pilot state which depends on the system (sensor range, nebula trails...)
Definition pilot.c:3755
unsigned int pilot_getNextID(unsigned int id, int mode)
Gets the next pilot based on id.
Definition pilot.c:135
double pilot_minbrakedist(const Pilot *p, double dt)
Gets the minimum braking distance for the pilot.
Definition pilot.c:845
void pilot_rmFriendly(Pilot *p)
Unmarks a pilot as friendly to player.
Definition pilot.c:1262
void pilots_render(void)
Renders all the pilots.
Definition pilot.c:3909
int pilot_areAllies(const Pilot *p, const Pilot *target)
Like areAllies but for pilots.
Definition pilot.c:721
double pilot_getNearestAng(const Pilot *p, unsigned int *tp, double ang, int disabled)
Get the pilot closest to an angle extending from another pilot.
Definition pilot.c:567
void pilot_untargetAsteroid(int anchor, int asteroid)
Loops over pilot stack to remove an asteroid as target.
Definition pilot.c:2960
int pilot_getJumps(const Pilot *p)
Gets the amount of jumps the pilot has left.
Definition pilot.c:1273
void pilot_delete(Pilot *p)
Deletes a pilot.
Definition pilot.c:2687
void pilots_update(double dt)
Updates all the pilots.
Definition pilot.c:3840
void pilots_cleanAll(void)
Even cleans up the player.
Definition pilot.c:3783
void pilot_clearTrails(Pilot *p)
Resets the trails for a pilot.
Definition pilot.c:3383
unsigned int pilot_getBoss(const Pilot *p)
Get the strongest ally in a given range.
Definition pilot.c:436
void pilots_free(void)
Frees the pilot stack.
Definition pilot.c:3663
double pilot_hit(Pilot *p, const Solid *w, const Pilot *pshooter, const Damage *dmg, const Outfit *outfit, int lua_mem, int reset)
Damages the pilot.
Definition pilot.c:1338
void pilot_renderFramebuffer(Pilot *p, GLuint fbo, double fw, double fh)
Renders a pilot to a framebuffer.
Definition pilot.c:1792
void pilot_update(Pilot *pilot, double dt)
Updates the pilot.
Definition pilot.c:2108
Pilot * pilot_create(const Ship *ship, const char *name, int faction, const char *ai, const double dir, const vec2 *pos, const vec2 *vel, const PilotFlags flags, unsigned int dockpilot, int dockslot)
Creates a new pilot.
Definition pilot.c:3248
unsigned int pilot_getPrevID(unsigned int id, int mode)
Gets the previous pilot based on ID.
Definition pilot.c:183
int pilot_numOutfit(const Pilot *p, const Outfit *o)
Checks to see how many of an outfit a pilot has.
Definition pilot.c:2973
void pilot_sample_trails(Pilot *p, int none)
Updates the given pilot's trail emissions.
Definition pilot.c:2601
int pilot_hasCredits(const Pilot *p, credits_t amount)
Checks to see if the pilot has at least a certain amount of credits.
Definition pilot.c:2990
int pilot_brake(Pilot *p, double dt)
Causes the pilot to turn around and brake.
Definition pilot.c:862
void pilot_setTarget(Pilot *p, unsigned int id)
Sets the target of the pilot.
Definition pilot.c:1308
unsigned int pilot_clone(const Pilot *ref)
Clones an existing pilot.
Definition pilot.c:3319
Basic AI profile.
Definition ai.h:40
Represents a commodity.
Definition commodity.h:43
Core damage that an outfit does.
Definition outfit.h:138
Pilot ship effect.
Definition effect.h:46
Stores an escort.
Definition pilot.h:206
unsigned int id
Definition pilot.h:209
int persist
Definition pilot.h:211
EscortType_t type
Definition pilot.h:208
const Ship * ship
Definition pilot.h:207
A ship outfit, depends radically on the type.
Definition outfit.h:328
Stores a pilot commodity.
Definition pilot.h:179
const Commodity * commodity
Definition pilot.h:180
unsigned int id
Definition pilot.h:182
A wrapper for pilot hooks.
Definition pilot.h:188
unsigned int id
Definition pilot.h:190
int type
Definition pilot.h:189
Stores outfit ammo.
Definition pilot.h:98
double lockon_timer
Definition pilot.h:101
Stores an outfit the pilot has.
Definition pilot.h:108
unsigned int beamid
Definition pilot.h:134
PilotOutfitAmmo ammo
Definition pilot.h:135
double heat_C
Definition pilot.h:118
double stimer
Definition pilot.h:124
double rtimer
Definition pilot.h:126
double heat_start
Definition pilot.h:120
double heat_T
Definition pilot.h:117
double progress
Definition pilot.h:127
double heat_area
Definition pilot.h:119
PilotOutfitState state
Definition pilot.h:123
ShipStatList * lua_stats
Definition pilot.h:140
double timer
Definition pilot.h:125
unsigned int inrange
Definition pilot.h:130
ShipOutfitSlot * sslot
Definition pilot.h:114
const Outfit * outfit
Definition pilot.h:112
A pilot Weapon Set Outfit.
Definition pilot.h:146
A weapon set represents a set of weapons that have an action.
Definition pilot.h:164
PilotWeaponSetOutfit * slots
Definition pilot.h:167
WeaponSetType type
Definition pilot.h:165
The representation of an in-game pilot.
Definition pilot.h:217
double engine_glow
Definition pilot.h:383
double ew_stealth_timer
Definition pilot.h:279
int nturrets
Definition pilot.h:308
double dtimer
Definition pilot.h:373
double dtimer_accum
Definition pilot.h:374
ShipStatList * ship_stats
Definition pilot.h:292
double itimer
Definition pilot.h:369
ShipStats stats
Definition pilot.h:294
double accel
Definition pilot.h:242
double shield
Definition pilot.h:253
double otimer
Definition pilot.h:375
double speed_limit
Definition pilot.h:246
AI_Profile * ai
Definition pilot.h:350
int presence
Definition pilot.h:223
unsigned int id
Definition pilot.h:218
lvar * shipvar
Definition pilot.h:385
double comm_msgWidth
Definition pilot.h:363
PilotCommodity * commodities
Definition pilot.h:326
int aimLines
Definition pilot.h:322
double turn_base
Definition pilot.h:248
int cpu_max
Definition pilot.h:237
double crew
Definition pilot.h:238
double ew_stealth
Definition pilot.h:273
PilotOutfitSlot * outfit_structure
Definition pilot.h:301
unsigned int parent
Definition pilot.h:333
credits_t credits
Definition pilot.h:325
int nav_hyperspace
Definition pilot.h:345
int projectiles
Definition pilot.h:379
double scantimer
Definition pilot.h:376
double refuel_amount
Definition pilot.h:313
double energy_regen
Definition pilot.h:266
PilotOutfitSlot ** outfits
Definition pilot.h:300
PilotOutfitSlot * outfit_utility
Definition pilot.h:302
PilotOutfitSlot * outfit_intrinsic
Definition pilot.h:304
int outfitlupdate
Definition pilot.h:312
int messages
Definition pilot.h:384
double lua_ship_timer
Definition pilot.h:359
double armour_max
Definition pilot.h:254
double speed
Definition pilot.h:244
int tsy
Definition pilot.h:232
int tsx
Definition pilot.h:231
double speed_base
Definition pilot.h:245
double ew_asteroid
Definition pilot.h:276
double heat_start
Definition pilot.h:289
double htimer
Definition pilot.h:370
double ew_mass
Definition pilot.h:275
const Ship * ship
Definition pilot.h:226
double sbonus
Definition pilot.h:372
int lockons
Definition pilot.h:378
double fuel_max
Definition pilot.h:259
ShipStatList * intrinsic_stats
Definition pilot.h:293
int ncannons
Definition pilot.h:307
double energy
Definition pilot.h:264
double ew_detection
Definition pilot.h:271
int nav_anchor
Definition pilot.h:346
double stress
Definition pilot.h:252
int hail_pos
Definition pilot.h:377
double mass_cargo
Definition pilot.h:229
double ptimer
Definition pilot.h:368
int faction
Definition pilot.h:222
PilotHook * hooks
Definition pilot.h:330
int autoweap
Definition pilot.h:321
double comm_msgTimer
Definition pilot.h:362
double stimer
Definition pilot.h:371
double energy_max
Definition pilot.h:265
double landing_delay
Definition pilot.h:366
unsigned int shoot_indicator
Definition pilot.h:355
Solid solid
Definition pilot.h:227
double fuel
Definition pilot.h:260
double energy_loss
Definition pilot.h:268
PilotOutfitSlot * afterburner
Definition pilot.h:316
double cdelay
Definition pilot.h:287
double accel_base
Definition pilot.h:243
double pdata
Definition pilot.h:367
char * name
Definition pilot.h:219
void * ptarget
Definition pilot.h:343
double tcontrol
Definition pilot.h:352
PilotFlags flags
Definition pilot.h:365
int nbeams
Definition pilot.h:309
double mass_outfit
Definition pilot.h:230
Escort_t * escorts
Definition pilot.h:334
unsigned int dockpilot
Definition pilot.h:335
int cpu
Definition pilot.h:236
Trail_spfx ** trail
Definition pilot.h:233
double fuel_consumption
Definition pilot.h:261
int lua_ship_mem
Definition pilot.h:358
double ctimer
Definition pilot.h:288
double heat_cond
Definition pilot.h:285
double base_mass
Definition pilot.h:228
double heat_T
Definition pilot.h:282
double heat_emis
Definition pilot.h:284
Task * task
Definition pilot.h:354
double heat_C
Definition pilot.h:283
int nfighterbays
Definition pilot.h:310
double energy_tau
Definition pilot.h:267
int active_set
Definition pilot.h:320
double shield_regen
Definition pilot.h:257
int cargo_free
Definition pilot.h:327
double ew_jumppoint
Definition pilot.h:277
unsigned int target
Definition pilot.h:342
int nafterburners
Definition pilot.h:311
int nav_spob
Definition pilot.h:344
int dockslot
Definition pilot.h:339
int lua_mem
Definition pilot.h:351
double player_damage
Definition pilot.h:381
Effect * effects
Definition pilot.h:297
double cap_cargo
Definition pilot.h:239
double turn
Definition pilot.h:247
char * comm_msg
Definition pilot.h:364
PilotOutfitSlot * outfit_weapon
Definition pilot.h:303
double armour
Definition pilot.h:251
double shield_max
Definition pilot.h:255
double dmg_absorb
Definition pilot.h:258
int * mounted
Definition pilot.h:380
int nav_asteroid
Definition pilot.h:347
double heat_area
Definition pilot.h:286
double ew_signature
Definition pilot.h:272
double armour_regen
Definition pilot.h:256
Ship outfit slot.
Definition ship.h:70
Represents relative ship statistics as a linked list.
Definition shipstats.h:167
Represents ship statistics, properties ship can use.
Definition shipstats.h:198
Represents a space ship.
Definition ship.h:94
Represents a solid in the game.
Definition physics.h:44
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Definition space.h:89
Basic AI task.
Definition ai.h:24
A trail generated by a ship or an ammo.
Definition spfx.h:64
Contains a mission variable.
Definition lvar.h:24
Represents a 2d vector.
Definition vec2.h:32