naev 0.10.4
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
21#define PLAYER_ID 1
23/* Hyperspace parameters. */
24#define HYPERSPACE_ENGINE_DELAY 3.
25#define HYPERSPACE_FLY_DELAY 5.
26#define HYPERSPACE_STARS_BLUR 3.
27#define HYPERSPACE_STARS_LENGTH 250
28#define HYPERSPACE_FADEOUT 1.
29#define HYPERSPACE_FADEIN 1.
30#define HYPERSPACE_THRUST 2000.
31#define HYPERSPACE_VEL (2.*HYPERSPACE_THRUST*HYPERSPACE_FLY_DELAY)
32#define HYPERSPACE_ENTER_MIN (HYPERSPACE_VEL*0.3)
33#define HYPERSPACE_ENTER_MAX (HYPERSPACE_VEL*0.4)
34#define HYPERSPACE_EXIT_MIN 1500.
35/* Land/takeoff. */
36#define PILOT_LANDING_DELAY 1.
37#define PILOT_TAKEOFF_DELAY 1.
38/* Refueling. */
39#define PILOT_REFUEL_TIME 3.
40#define PILOT_REFUEL_QUANTITY 100
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. */
50enum {
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};
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
158typedef struct PilotWeaponSet_ {
159 int type;
160 int active;
162 /* Only applicable to weapon type. */
164 int manual;
165 double range[PILOT_WEAPSET_MAX_LEVELS];
166 double speed[PILOT_WEAPSET_MAX_LEVELS];
168
172typedef struct PilotCommodity_ {
175 unsigned int id;
177
181typedef struct PilotHook_ {
182 int type;
183 unsigned int id;
184} PilotHook;
185
189typedef enum EscortType_e {
190 ESCORT_TYPE_NULL,
191 ESCORT_TYPE_BAY,
192 ESCORT_TYPE_MERCENARY,
193 ESCORT_TYPE_FLEET,
194} EscortType_t;
195
199typedef struct Escort_s {
200 char *ship;
201 EscortType_t type;
202 unsigned int id;
203 /* TODO: something better than this */
205} Escort_t;
206
210typedef struct Pilot_ {
211 unsigned int id;
212 char* name;
214 /* Fleet/faction management. */
218 /* Object characteristics */
219 const Ship* ship;
221 double base_mass;
224 int tsx;
225 int tsy;
228 /* Properties. */
229 int cpu;
231 double crew;
232 double cap_cargo;
234 /* Movement */
235 double thrust;
237 double speed;
240 double turn;
241 double turn_base;
243 /* Current health */
244 double armour;
245 double stress;
246 double shield;
252 double fuel_max;
253 double fuel;
256 /* Energy is handled a bit differently. */
257 double energy;
258 double energy_max;
260 double energy_tau;
261 double energy_loss;
263 /* Defensive Electronic Warfare. */
265 double ew_evasion;
266 double ew_stealth;
267 /* Defensive Electronic Warfare. */
268 double ew_mass;
269 double ew_asteroid;
271 /* misc. */
274 /* Heat. */
275 double heat_T;
276 double heat_C;
277 double heat_emis;
278 double heat_cond;
279 double heat_area;
280 double cdelay;
281 double ctimer;
282 double heat_start;
284 /* Ship statistics. */
288 /* Ship effects. */
291 /* Outfit management */
298 /* Primarily for AI usage. */
301 int nbeams;
307 /* For easier usage. */
310 /* Weapon sets. */
311 PilotWeaponSet weapon_sets[PILOT_WEAPON_SETS];
316 /* Cargo */
317 credits_t credits;
321 /* Hook attached to the pilot */
324 /* Escort stuff. */
325 unsigned int parent;
327 unsigned int dockpilot;
333 /* Targeting. */
334 unsigned int target;
335 void *ptarget;
341 /* AI */
344 double tcontrol;
345 double timer[MAX_AI_TIMERS];
347 unsigned int shoot_indicator;
349 /* Misc */
352 char *comm_msg;
353 PilotFlags flags;
355 double pdata;
356 double ptimer;
357 double itimer;
358 double htimer;
359 double stimer;
360 double sbonus;
361 double dtimer;
363 double otimer;
364 double scantimer;
368 int *mounted;
374} Pilot;
375
376/* These depend on Pilot being defined first. */
377#include "pilot_cargo.h"
378#include "pilot_heat.h"
379#include "pilot_hook.h"
380#include "pilot_outfit.h"
381#include "pilot_weapon.h"
382#include "pilot_ew.h"
383
384/*
385 * Getting pilot stuff.
386 */
387Pilot*const* pilot_getAll (void);
388Pilot* pilot_get( unsigned int id );
390unsigned int pilot_getNextID( unsigned int id, int mode );
391unsigned int pilot_getPrevID( unsigned int id, int mode );
392unsigned int pilot_getNearestEnemy( const Pilot* p );
393unsigned int pilot_getNearestEnemy_size( const Pilot* p, double target_mass_LB, double target_mass_UB );
394unsigned int pilot_getNearestEnemy_heuristic(const Pilot* p, double mass_factor, double health_factor, double damage_factor, double range_factor);
395unsigned int pilot_getNearestHostile (void); /* only for the player */
396unsigned int pilot_getNearestPilot( const Pilot* p );
397unsigned int pilot_getBoss( const Pilot* p );
398double pilot_getNearestPos( const Pilot *p, unsigned int *tp, double x, double y, int disabled );
399double pilot_getNearestAng( const Pilot *p, unsigned int *tp, double ang, int disabled );
400int pilot_getJumps( const Pilot* p );
401const glColour* pilot_getColour( const Pilot* p );
402int pilot_validTarget( const Pilot* p, const Pilot* target );
403int pilot_canTarget( const Pilot* p );
404
405/* non-lua wrappers */
406double pilot_relsize( const Pilot* cur_pilot, const Pilot* p );
407double pilot_reldps( const Pilot* cur_pilot, const Pilot* p );
408double pilot_relhp( const Pilot* cur_pilot, const Pilot* p );
409
410/*
411 * Combat.
412 */
413void pilot_setTarget( Pilot* p, unsigned int id );
414double pilot_hit( Pilot* p, const Solid* w, const Pilot *pshooter,
415 const Damage *dmg, const Outfit *outfit, int lua_mem, int reset );
416void pilot_updateDisable( Pilot* p, unsigned int shooter );
417void pilot_explode( double x, double y, double radius, const Damage *dmg, const Pilot *parent );
418double pilot_face( Pilot* p, const double dir );
419int pilot_brake( Pilot* p );
420double pilot_brakeDist( Pilot *p, vec2 *pos );
421int pilot_interceptPos( Pilot *p, double x, double y );
422void pilot_cooldown( Pilot *p, int dochecks );
423void pilot_cooldownEnd( Pilot *p, const char *reason );
424double pilot_aimAngle( Pilot *p, const vec2* pos, const vec2* vel );
425
426/*
427 * Faction stuff.
428 */
429int pilot_validEnemy( const Pilot* p, const Pilot* target );
430int pilot_validEnemyDist( const Pilot* p, const Pilot* target, double *dist );
431int pilot_areAllies( const Pilot *p, const Pilot *target );
432int pilot_areEnemies( const Pilot *p, const Pilot *target );
433
434/* Outfits */
435int pilot_numOutfit( const Pilot *p, const Outfit *o );
436void pilot_dpseps( const Pilot *p, double *pdps, double *peps );
437
438/* Misc. */
439int pilot_hasCredits( Pilot *p, credits_t amount );
440credits_t pilot_modCredits( Pilot *p, credits_t amount );
441int pilot_refuelStart( Pilot *p );
443void pilot_clearTimers( Pilot *pilot );
444int pilot_hasDeployed( Pilot *p );
445int pilot_dock( Pilot *p, Pilot *target );
446ntime_t pilot_hyperspaceDelay( Pilot *p );
447void pilot_untargetAsteroid( int anchor, int asteroid );
449
450/*
451 * Creation.
452 */
453unsigned int pilot_create( const Ship* ship, const char* name, int faction, const char *ai,
454 const double dir, const vec2* pos, const vec2* vel,
455 const PilotFlags flags, unsigned int dockpilot, int dockslot );
456Pilot* pilot_createEmpty( const Ship* ship, const char* name,
457 int faction, PilotFlags flags );
458unsigned int pilot_clone( const Pilot *p );
459unsigned int pilot_addStack( Pilot *p );
460void pilot_reset( Pilot* pilot );
461Pilot* pilot_setPlayer( Pilot* after );
462void pilot_choosePoint( vec2 *vp, Spob **spob, JumpPoint **jump, int lf, int ignore_rules, int guerilla );
463void pilot_delete( Pilot *p );
464void pilot_dead( Pilot* p, unsigned int killer );
465
466/*
467 * Init and cleanup.
468 */
469void pilot_stackRemove( Pilot *p );
470void pilots_init (void);
471void pilots_free (void);
472void pilots_clean( int persist );
473void pilots_newSystem (void);
474void pilots_clear (void);
475void pilots_cleanAll (void);
476void pilot_free( Pilot* p );
477
478/*
479 * Movement.
480 */
481void pilot_setThrust( Pilot *p, double thrust );
482void pilot_setTurn( Pilot *p, double turn );
483
484/*
485 * update
486 */
487void pilot_update( Pilot* pilot, double dt );
488void pilots_update( double dt );
489void pilot_renderFramebuffer( Pilot *p, GLuint fbo, double fw, double fh );
490void pilots_render (void);
491void pilots_renderOverlay (void);
492void pilot_render( Pilot* pilot );
493void pilot_renderOverlay( Pilot* p );
494
495/*
496 * communication
497 */
498void pilot_broadcast( Pilot *p, const char *msg, int ignore_int );
499void pilot_distress( Pilot *p, Pilot *attacker, const char *msg );
500void pilot_setCommMsg( Pilot *p, const char *s );
501
502/*
503 * faction
504 */
505void pilot_setHostile( Pilot *p );
506void pilot_rmHostile( Pilot *p );
507void pilot_setFriendly( Pilot *p );
508void pilot_rmFriendly( Pilot *p );
509int pilot_isHostile( const Pilot *p );
510int pilot_isNeutral( const Pilot *p );
511int pilot_isFriendly( const Pilot *p );
512char pilot_getFactionColourChar( const Pilot *p );
513
514/*
515 * Misc details.
516 */
517credits_t pilot_worth( const Pilot *p );
518void pilot_msg( Pilot *p, Pilot *receiver, const char *type, unsigned int index );
519void pilot_clearTrails( Pilot *p );
520void pilot_sample_trails( Pilot* p, int none );
521int pilot_hasIllegal( const Pilot *p, int faction );
Pilot * cur_pilot
Definition: ai.c:336
char pilot_getFactionColourChar(const Pilot *p)
Gets the faction colour char, works like faction_getColourChar but for a pilot.
Definition: pilot.c:1125
void pilot_free(Pilot *p)
Frees and cleans up a pilot.
Definition: pilot.c:3428
void pilot_stackRemove(Pilot *p)
Tries to remove a pilot from the stack.
Definition: pilot.c:3506
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:341
credits_t pilot_worth(const Pilot *p)
Gets the price or worth of a pilot in credits.
Definition: pilot.c:3917
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:3345
void pilot_setThrust(Pilot *p, double thrust)
Sets the pilot's thrust.
Definition: pilot.c:632
int pilot_isHostile(const Pilot *p)
Checks to see if pilot is hostile to the player.
Definition: pilot.c:651
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:1598
void pilot_cooldown(Pilot *p, int dochecks)
Begins active cooldown, reducing hull and outfit temperatures.
Definition: pilot.c:941
unsigned int 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:3151
void pilot_rmHostile(Pilot *p)
Unmarks a pilot as hostile to player.
Definition: pilot.c:1276
unsigned int pilot_addStack(Pilot *p)
Adds a pilot to the stack.
Definition: pilot.c:3262
void pilot_msg(Pilot *p, Pilot *receiver, const char *type, unsigned int idx)
Sends a message.
Definition: pilot.c:3941
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:3904
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:266
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:3804
int pilot_areEnemies(const Pilot *p, const Pilot *target)
Like areEnemies but for pilots.
Definition: pilot.c:718
void pilots_clear(void)
Clears all the pilots except the player and clear-exempt pilots.
Definition: pilot.c:3624
unsigned int pilot_getNearestPilot(const Pilot *p)
Get the nearest pilot to a pilot.
Definition: pilot.c:412
void pilots_clean(int persist)
Cleans up the pilot stack - leaves the player.
Definition: pilot.c:3555
Pilot * pilot_getTarget(Pilot *p)
Gets the target of a pilot using a fancy caching system.
Definition: pilot.c:607
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:3205
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:492
ntime_t pilot_hyperspaceDelay(Pilot *p)
Calculates the hyperspace delay for a pilot.
Definition: pilot.c:2855
double pilot_face(Pilot *p, const double dir)
Tries to turn the pilot to face dir.
Definition: pilot.c:773
void pilot_clearTimers(Pilot *pilot)
Clears the pilot's timers.
Definition: pilot.c:3767
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:3883
void pilot_dead(Pilot *p, unsigned int killer)
Pilot is dead, now will slowly explode.
Definition: pilot.c:1676
Pilot * pilot_setPlayer(Pilot *after)
Replaces the player's pilot with an alternate ship with the same ID.
Definition: pilot.c:3300
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:274
void pilot_renderOverlay(Pilot *p)
Renders the pilot overlay.
Definition: pilot.c:1968
void pilot_cooldownEnd(Pilot *p, const char *reason)
Terminates active cooldown.
Definition: pilot.c:1004
credits_t pilot_modCredits(Pilot *p, credits_t amount)
Modifies the amount of credits the pilot has.
Definition: pilot.c:2911
unsigned int pilot_getNearestEnemy(const Pilot *p)
Gets the nearest enemy to the pilot.
Definition: pilot.c:312
void pilot_setFriendly(Pilot *p)
Marks pilot as friendly to player.
Definition: pilot.c:1294
void pilot_hyperspaceAbort(Pilot *p)
Stops the pilot from hyperspacing.
Definition: pilot.c:2772
void pilot_setTurn(Pilot *p, double turn)
Sets the pilot's turn.
Definition: pilot.c:640
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:226
void pilot_explode(double x, double y, double radius, const Damage *dmg, const Pilot *parent)
Makes the pilot explosion.
Definition: pilot.c:1728
void pilot_reset(Pilot *pilot)
Resets a pilot.
Definition: pilot.c:3088
int pilot_isFriendly(const Pilot *p)
Checks to see if pilot is friendly to the player.
Definition: pilot.c:681
int pilot_refuelStart(Pilot *p)
Attempts to start refueling the pilot's target.
Definition: pilot.c:2794
void pilots_renderOverlay(void)
Renders all the pilots overlays.
Definition: pilot.c:3748
int pilot_isNeutral(const Pilot *p)
Checks to see if pilot is neutral to the player.
Definition: pilot.c:668
PilotOutfitSlot * pilot_getDockSlot(Pilot *p)
Gets the dock slot of the pilot.
Definition: pilot.c:749
void pilots_init(void)
Initializes pilot stuff.
Definition: pilot.c:3520
int pilot_hasIllegal(const Pilot *p, int faction)
Checks to see if the pilot has illegal stuf to a faction.
Definition: pilot.c:3974
void pilot_setCommMsg(Pilot *p, const char *s)
Sets the overhead communication message of the pilot.
Definition: pilot.c:1139
Pilot * pilot_get(unsigned int id)
Pulls a pilot out of the pilot_stack based on ID.
Definition: pilot.c:589
void pilot_broadcast(Pilot *p, const char *msg, int ignore_int)
Has the pilot broadcast a message.
Definition: pilot.c:1154
double pilot_brakeDist(Pilot *p, vec2 *pos)
Gets the braking distance for a pilot.
Definition: pilot.c:837
void pilot_setHostile(Pilot *p)
Marks pilot as hostile to player.
Definition: pilot.c:1111
void pilot_dpseps(const Pilot *p, double *pdps, double *peps)
Calculates the dps and eps of a pilot.
Definition: pilot.c:3816
int pilot_hasCredits(Pilot *p, credits_t amount)
Checks to see if the pilot has at least a certain amount of credits.
Definition: pilot.c:2897
const glColour * pilot_getColour(const Pilot *p)
Gets a pilot's colour.
Definition: pilot.c:1327
void pilot_distress(Pilot *p, Pilot *attacker, const char *msg)
Has the pilot broadcast a distress signal.
Definition: pilot.c:1182
void pilot_render(Pilot *p)
Renders the pilot.
Definition: pilot.c:1826
Pilot *const * pilot_getAll(void)
Gets the pilot stack.
Definition: pilot.c:83
int pilot_canTarget(const Pilot *p)
Same as pilot_validTarget but without the range check.
Definition: pilot.c:243
int pilot_interceptPos(Pilot *p, double x, double y)
Attempts to make the pilot pass through a given point.
Definition: pilot.c:888
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:376
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:1044
void pilots_newSystem(void)
Updates pilot state which depends on the system (sensor range, nebula trails...)
Definition: pilot.c:3614
unsigned int pilot_getNextID(unsigned int id, int mode)
Gets the next pilot based on id.
Definition: pilot.c:124
void pilot_rmFriendly(Pilot *p)
Unmarks a pilot as friendly to player.
Definition: pilot.c:1305
void pilots_render(void)
Renders all the pilots.
Definition: pilot.c:3731
int pilot_areAllies(const Pilot *p, const Pilot *target)
Like areAllies but for pilots.
Definition: pilot.c:694
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:536
void pilot_untargetAsteroid(int anchor, int asteroid)
Loops over pilot stack to remove an asteroid as target.
Definition: pilot.c:2867
int pilot_getJumps(const Pilot *p)
Gets the amount of jumps the pilot has left.
Definition: pilot.c:1316
int pilot_brake(Pilot *p)
Causes the pilot to turn around and brake.
Definition: pilot.c:788
void pilot_delete(Pilot *p)
Deletes a pilot.
Definition: pilot.c:2603
void pilots_update(double dt)
Updates all the pilots.
Definition: pilot.c:3653
void pilots_cleanAll(void)
Even cleans up the player.
Definition: pilot.c:3635
void pilot_clearTrails(Pilot *p)
Resets the trails for a pilot.
Definition: pilot.c:3287
unsigned int pilot_getBoss(const Pilot *p)
Get the strongest ally in a given range.
Definition: pilot.c:425
void pilots_free(void)
Frees the pilot stack.
Definition: pilot.c:3528
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:1381
void pilot_renderFramebuffer(Pilot *p, GLuint fbo, double fw, double fh)
Renders a pilot to a framebuffer.
Definition: pilot.c:1778
void pilot_update(Pilot *pilot, double dt)
Updates the pilot.
Definition: pilot.c:2050
unsigned int pilot_getPrevID(unsigned int id, int mode)
Gets the previous pilot based on ID.
Definition: pilot.c:172
int pilot_numOutfit(const Pilot *p, const Outfit *o)
Checks to see how many of an outfit a pilot has.
Definition: pilot.c:2880
void pilot_sample_trails(Pilot *p, int none)
Updates the given pilot's trail emissions.
Definition: pilot.c:2529
void pilot_setTarget(Pilot *p, unsigned int id)
Sets the target of the pilot.
Definition: pilot.c:1351
unsigned int pilot_clone(const Pilot *ref)
Clones an existing pilot.
Definition: pilot.c:3223
int pilot_hasDeployed(Pilot *p)
Checks to see if the pilot has deployed ships.
Definition: pilot_outfit.c:251
int pilot_dock(Pilot *p, Pilot *target)
Docks the pilot on its target pilot.
Definition: pilot_outfit.c:189
Basic AI profile.
Definition: ai.h:41
Represents a commodity.
Definition: commodity.h:43
Core damage that an outfit does.
Definition: outfit.h:111
Pilot ship effect.
Definition: effect.h:41
Stores an escort.
Definition: pilot.h:199
unsigned int id
Definition: pilot.h:202
int persist
Definition: pilot.h:204
EscortType_t type
Definition: pilot.h:201
char * ship
Definition: pilot.h:200
A ship outfit, depends radically on the type.
Definition: outfit.h:304
Stores a pilot commodity.
Definition: pilot.h:172
const Commodity * commodity
Definition: pilot.h:173
unsigned int id
Definition: pilot.h:175
int quantity
Definition: pilot.h:174
A wrapper for pilot hooks.
Definition: pilot.h:181
unsigned int id
Definition: pilot.h:183
int type
Definition: pilot.h:182
Stores outfit ammo.
Definition: pilot.h:98
int deployed
Definition: pilot.h:100
int quantity
Definition: pilot.h:99
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
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
ShipStats lua_stats
Definition: pilot.h:140
A pilot Weapon Set Outfit.
Definition: pilot.h:146
A weapon set represents a set of weapons that have an action.
Definition: pilot.h:158
int inrange
Definition: pilot.h:163
PilotWeaponSetOutfit * slots
Definition: pilot.h:161
int active
Definition: pilot.h:160
int manual
Definition: pilot.h:164
The representation of an in-game pilot.
Definition: pilot.h:210
double engine_glow
Definition: pilot.h:371
Solid * solid
Definition: pilot.h:220
double ew_stealth_timer
Definition: pilot.h:272
int nturrets
Definition: pilot.h:300
double dtimer
Definition: pilot.h:361
double dtimer_accum
Definition: pilot.h:362
double itimer
Definition: pilot.h:357
ShipStats stats
Definition: pilot.h:286
double shield
Definition: pilot.h:246
double otimer
Definition: pilot.h:363
double speed_limit
Definition: pilot.h:239
AI_Profile * ai
Definition: pilot.h:342
int presence
Definition: pilot.h:216
unsigned int id
Definition: pilot.h:211
lvar * shipvar
Definition: pilot.h:373
double comm_msgWidth
Definition: pilot.h:351
PilotCommodity * commodities
Definition: pilot.h:318
double thrust
Definition: pilot.h:235
int aimLines
Definition: pilot.h:314
double turn_base
Definition: pilot.h:241
int cpu_max
Definition: pilot.h:230
double crew
Definition: pilot.h:231
double ew_stealth
Definition: pilot.h:266
PilotOutfitSlot * outfit_structure
Definition: pilot.h:293
unsigned int parent
Definition: pilot.h:325
credits_t credits
Definition: pilot.h:317
int nav_hyperspace
Definition: pilot.h:337
int projectiles
Definition: pilot.h:367
double scantimer
Definition: pilot.h:364
double refuel_amount
Definition: pilot.h:305
double energy_regen
Definition: pilot.h:259
PilotOutfitSlot ** outfits
Definition: pilot.h:292
PilotOutfitSlot * outfit_utility
Definition: pilot.h:294
PilotOutfitSlot * outfit_intrinsic
Definition: pilot.h:296
int outfitlupdate
Definition: pilot.h:304
int messages
Definition: pilot.h:372
double armour_max
Definition: pilot.h:247
double speed
Definition: pilot.h:237
int tsy
Definition: pilot.h:225
ShipStats intrinsic_stats
Definition: pilot.h:285
int tsx
Definition: pilot.h:224
double speed_base
Definition: pilot.h:238
double ew_asteroid
Definition: pilot.h:269
double heat_start
Definition: pilot.h:282
double htimer
Definition: pilot.h:358
double ew_mass
Definition: pilot.h:268
const Ship * ship
Definition: pilot.h:219
double sbonus
Definition: pilot.h:360
int lockons
Definition: pilot.h:366
double fuel_max
Definition: pilot.h:252
int ncannons
Definition: pilot.h:299
double thrust_base
Definition: pilot.h:236
double energy
Definition: pilot.h:257
double ew_detection
Definition: pilot.h:264
int nav_anchor
Definition: pilot.h:338
double stress
Definition: pilot.h:245
int hail_pos
Definition: pilot.h:365
double mass_cargo
Definition: pilot.h:222
double ptimer
Definition: pilot.h:356
int faction
Definition: pilot.h:215
PilotHook * hooks
Definition: pilot.h:322
int autoweap
Definition: pilot.h:313
double comm_msgTimer
Definition: pilot.h:350
double stimer
Definition: pilot.h:359
double energy_max
Definition: pilot.h:258
double landing_delay
Definition: pilot.h:354
unsigned int shoot_indicator
Definition: pilot.h:347
double fuel
Definition: pilot.h:253
double energy_loss
Definition: pilot.h:261
PilotOutfitSlot * afterburner
Definition: pilot.h:308
double cdelay
Definition: pilot.h:280
double pdata
Definition: pilot.h:355
char * name
Definition: pilot.h:212
void * ptarget
Definition: pilot.h:335
double tcontrol
Definition: pilot.h:344
PilotFlags flags
Definition: pilot.h:353
int nbeams
Definition: pilot.h:301
double mass_outfit
Definition: pilot.h:223
Escort_t * escorts
Definition: pilot.h:326
unsigned int dockpilot
Definition: pilot.h:327
int cpu
Definition: pilot.h:229
Trail_spfx ** trail
Definition: pilot.h:226
double fuel_consumption
Definition: pilot.h:254
double ctimer
Definition: pilot.h:281
double heat_cond
Definition: pilot.h:278
double base_mass
Definition: pilot.h:221
double heat_T
Definition: pilot.h:275
double heat_emis
Definition: pilot.h:277
Task * task
Definition: pilot.h:346
double heat_C
Definition: pilot.h:276
int nfighterbays
Definition: pilot.h:302
double energy_tau
Definition: pilot.h:260
int active_set
Definition: pilot.h:312
double shield_regen
Definition: pilot.h:250
int cargo_free
Definition: pilot.h:319
double ew_jumppoint
Definition: pilot.h:270
unsigned int target
Definition: pilot.h:334
int nafterburners
Definition: pilot.h:303
int nav_spob
Definition: pilot.h:336
int dockslot
Definition: pilot.h:331
int lua_mem
Definition: pilot.h:343
double player_damage
Definition: pilot.h:369
double ew_evasion
Definition: pilot.h:265
Effect * effects
Definition: pilot.h:289
double cap_cargo
Definition: pilot.h:232
double turn
Definition: pilot.h:240
char * comm_msg
Definition: pilot.h:352
PilotOutfitSlot * outfit_weapon
Definition: pilot.h:295
double armour
Definition: pilot.h:244
double shield_max
Definition: pilot.h:248
double dmg_absorb
Definition: pilot.h:251
int * mounted
Definition: pilot.h:368
int nav_asteroid
Definition: pilot.h:339
double heat_area
Definition: pilot.h:279
double armour_regen
Definition: pilot.h:249
Ship outfit slot.
Definition: ship.h:70
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:17
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Definition: space.h:88
Basic AI task.
Definition: ai.h:25
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