34#include "nlua_pilot.h"
35#include "nlua_pilotoutfit.h"
59 return &p->weapon_sets[ id ];
73 int isstealth = pilot_isFlag( p, PILOT_STEALTH );
87 if ((level != -1) && (ws->
slots[i].
level != level))
97 for (
int j=0; j<i; j++) {
99 if ((level != -1) && (ws->
slots[j].
level != level))
102 if (p->outfits[ ws->
slots[j].
slotid ]->outfit == o) {
125 (!
weapon_inArc( o, p, &wt, &p->solid.pos, &p->solid.vel, p->solid.dir, time))))
136 if (isstealth && (ret>0))
151 for (
int i=0; i<PILOT_WEAPON_SETS; i++) {
167 int isstealth = pilot_isFlag( p, PILOT_STEALTH );
170 if (ws->
slots == NULL)
175 case WEAPSET_TYPE_SWITCH:
183 case WEAPSET_TYPE_TOGGLE:
193 if ((pilot_isDisabled(p)) || (pilot_isFlag(p, PILOT_COOLDOWN)))
201 pilotoutfit_modified = 0;
211 for (
int i=0; i<l; i++) {
213 if (pos->
state != PILOT_OUTFIT_ON)
226 for (
int i=0; i<l; i++) {
228 if (pos->
state != PILOT_OUTFIT_OFF)
235 if ((n > 0) || pilotoutfit_modified) {
237 if (isstealth && (type>0))
244 case WEAPSET_TYPE_HOLD:
249 if ((pilot_isDisabled(p)) || (pilot_isFlag(p, PILOT_COOLDOWN)))
255 pilotoutfit_modified = 0;
264 for (
int i=0; i<l; i++) {
266 if (pos->
state != PILOT_OUTFIT_OFF)
277 for (
int i=0; i<l; i++) {
279 if (pos->
state != PILOT_OUTFIT_ON)
287 if ((n > 0) || pilotoutfit_modified) {
289 if (isstealth && (type>0))
305 if (pilot_isFlag( p, PILOT_HYP_BEGIN))
308 for (
int i=0; i<PILOT_WEAPON_SETS; i++) {
311 if (ws->
slots == NULL)
325 if (pos->
state != PILOT_OUTFIT_OFF)
330 if ((n > 0) || pilotoutfit_modified) {
332 if (pilot_isFlag(p,PILOT_STEALTH))
347 if (wsa->
type != WEAPSET_TYPE_SWITCH) {
348 for (
int i=0; i<PILOT_WEAPON_SETS; i++) {
350 if (wsi->
type == WEAPSET_TYPE_SWITCH) {
359 for (
int i=0; i<
array_size(p->outfits); i++) {
362 for (
int j=0; j<PILOT_WEAPON_SETS; j++) {
375 p->outfits[i]->level = -1;
491 static char setname[STRMAX_SHORT];
492 const char *base, *type, *problem;
494 problem = type = base = NULL;
497 case WEAPSET_TYPE_SWITCH:
498 type = p_(
"weapset",
"Switch");
500 case WEAPSET_TYPE_TOGGLE:
501 type = p_(
"weapset",
"Toggle");
503 case WEAPSET_TYPE_HOLD:
504 type = p_(
"weapset",
"Hold");
507 type = p_(
"weapset",
"Unknown");
530 case OUTFIT_SLOT_STRUCTURE:
533 case OUTFIT_SLOT_UTILITY:
536 case OUTFIT_SLOT_WEAPON:
545 else if (not_same==0)
547 else if (has_weap && !has_util && !has_stru)
548 base = p_(
"weapset",
"Weapons");
549 else if (!has_weap && has_util && !has_stru)
550 base = p_(
"weapset",
"Utilities");
551 else if (!has_weap && !has_util && has_stru)
552 base = p_(
"weapset",
"Structurals");
554 base = p_(
"weapset",
"Mixed");
557 if (!has_weap && (ws->
type==WEAPSET_TYPE_SWITCH))
558 problem = _(
"no weapons!");
562 snprintf( setname,
sizeof(setname), p_(
"weapset",
"#o%s - %s#0 [#r%s#0]"), type, base, problem );
564 snprintf( setname,
sizeof(setname), p_(
"weapset",
"%s - %s"), type, base );
582 if (ws->
slots == NULL)
634 ws->
type = WEAPSET_TYPE_SWITCH;
689 for (
int i=0; i<PILOT_WEAPON_SETS; i++)
703 double range_accum[PILOT_WEAPSET_MAX_LEVELS];
704 int range_num[PILOT_WEAPSET_MAX_LEVELS];
705 double speed_accum[PILOT_WEAPSET_MAX_LEVELS];
706 int speed_num[PILOT_WEAPSET_MAX_LEVELS];
709 for (
int i=0; i<PILOT_WEAPSET_MAX_LEVELS; i++) {
722 if (lev >= PILOT_WEAPSET_MAX_LEVELS)
730 range = pilot_outfitRange( p, pos->
outfit );
733 range_accum[ lev ] += range;
741 speed_accum[ lev ] += speed;
747 for (
int i=0; i<PILOT_WEAPSET_MAX_LEVELS; i++) {
749 if (range_num[i] == 0)
752 ws->
range[i] = range_accum[i] / (double) range_num[i];
755 if (speed_num[i] == 0)
758 ws->
speed[i] = speed_accum[i] / (double) speed_num[i];
775 for (
int i=0; i<PILOT_WEAPSET_MAX_LEVELS; i++)
776 range += ws->
range[i];
779 range = ws->
range[ level ];
797 for (
int i=0; i<PILOT_WEAPSET_MAX_LEVELS; i++)
798 speed += ws->
speed[i];
801 speed = ws->
speed[ level ];
821 if ((level >= 0) && (ws->
slots[i].
level != level))
829 return (nammo==0) ? 0. : ammo / (double)nammo;
854 for (
int i=0; i<PILOT_WEAPON_SETS; i++)
882 if (ws->
type == WEAPSET_TYPE_SWITCH) {
886 if (pilot_isFlag(p, PILOT_COOLDOWN) && ret)
934 if ((level != -1) && (ws->
slots[i].
level != level))
969 double rate_mod, energy_mod, used;
972 if (w->u.beamid == 0)
976 if (w->outfit == NULL) {
995 w->timer = rate_mod * (used / w->outfit->u.bem.duration) *
outfit_delay( w->outfit );
997 w->state = PILOT_OUTFIT_OFF;
1010 vec2 approach_vector, relative_location, orthoradial_vector;
1011 double speed, radial_speed, orthoradial_speed, dist, t;
1013 dist = vec2_dist( &parent->
solid.
pos, pos );
1028 vec2_cset( &approach_vector, - vel->
x, - vel->
y );
1030 vec2_cset( &approach_vector, VX(parent->
solid.
vel) - vel->
x,
1036 vec2_cset( &relative_location, pos->
x - VX(parent->
solid.
pos),
1040 vec2_cset(&orthoradial_vector, VY(parent->
solid.
pos) - pos->
y,
1043 radial_speed = vec2_dot( &approach_vector, &relative_location );
1044 radial_speed = radial_speed / VMOD(relative_location);
1046 orthoradial_speed = vec2_dot(&approach_vector, &orthoradial_vector);
1047 orthoradial_speed = orthoradial_speed / VMOD(relative_location);
1049 if ( ((speed*speed - VMOD(approach_vector)*VMOD(approach_vector)) != 0) && (speed*speed - orthoradial_speed*orthoradial_speed) > 0)
1050 t = dist * (sqrt( speed*speed - orthoradial_speed*orthoradial_speed ) - radial_speed) /
1051 (speed*speed - VMOD(approach_vector)*VMOD(approach_vector));
1057 t = - dist * (sqrt( speed*speed - orthoradial_speed*orthoradial_speed ) + radial_speed) /
1058 (speed*speed - VMOD(approach_vector)*VMOD(approach_vector));
1078 wt->type = TARGET_PILOT;
1082 else if (p->nav_asteroid != -1) {
1083 wt->type = TARGET_ASTEROID;
1084 wt->u.ast.anchor = p->nav_anchor;
1085 wt->u.ast.asteroid = p->nav_asteroid;
1088 wt->type = TARGET_NONE;
1098 int is_launcher, is_bay;
1099 double rate_mod, energy_mod;
1138 if ((level != -1) && (ws->
slots[i].
level != level))
1142 if ((is_launcher || is_bay) && (pos->u.
ammo.
quantity <= 0))
1146 if (pos->
timer <= 0.) {
1158 if ((maxp < 0) || (pos->
timer > maxt)) {
1192 double rate_mod, energy_mod;
1196 if (w->outfit == NULL)
1200 if (
outfit_isBeam(w->outfit) && w->outfit->u.bem.min_duration)
1201 w->stimer = INFINITY;
1214 vec2_cset( &vv, p->solid.vel.x - vp.
y*p->solid.dir_vel,
1215 p->solid.vel.y + vp.
x*p->solid.dir_vel );
1218 vp.
x += p->solid.pos.x;
1219 vp.
y += p->solid.pos.y;
1228 if ((aim >= 0) && (w->outfit->lua_onshoot != LUA_NOREF) &&
1233 p->energy -= energy;
1235 if (!outfit_isProp( w->outfit, OUTFIT_PROP_SHOOT_DRY )) {
1236 for (
int i=0; i<w->outfit->u.blt.shots; i++) {
1238 &vp, &vv, p, target, time, aim );
1248 if (w->u.beamid > 0)
1256 if ((aim>=0) && (w->outfit->lua_onshoot != LUA_NOREF) &&
1261 w->state = PILOT_OUTFIT_ON;
1262 if (!outfit_isProp( w->outfit, OUTFIT_PROP_SHOOT_DRY )) {
1264 &vp, &p->solid.vel, p, target, aim );
1267 w->timer = w->outfit->u.bem.duration;
1278 if (w->u.ammo.quantity <= 0)
1286 if (target == NULL) {
1290 if ((w->outfit->u.lau.ai != AMMO_AI_UNGUIDED) && (target->type!=TARGET_PILOT))
1294 if ((aim>=0) && (w->outfit->lua_onshoot != LUA_NOREF) &&
1299 p->energy -= energy;
1301 if (!outfit_isProp( w->outfit, OUTFIT_PROP_SHOOT_DRY )) {
1302 for (
int i=0; i<w->outfit->u.lau.shots; i++)
1304 &vp, &vv, p, target, time, aim );
1311 p->shoot_indicator = 1;
1314 if (w->u.ammo.quantity <= 0) {
1315 for (
int j=0; j<PILOT_WEAPON_SETS; j++)
1327 if (w->u.ammo.quantity <= 0)
1331 if ((aim>=0) && (w->outfit->lua_onshoot != LUA_NOREF) &&
1336 for (
int j=0; j<
array_size(p->outfits); j++) {
1337 if (p->outfits[j] == w)
1342 if (!outfit_isProp( w->outfit, OUTFIT_PROP_SHOOT_DRY ))
1344 &vp, &p->solid.vel, p->solid.dir, ESCORT_TYPE_BAY, 1, dockslot );
1346 w->u.ammo.quantity -= 1;
1347 p->mass_outfit -= w->outfit->u.bay.ship_mass;
1351 WARN(_(
"Shooting unknown weapon type: %s"), w->outfit->name);
1371 case OUTFIT_TYPE_BOLT:
1372 case OUTFIT_TYPE_BEAM:
1373 *rate_mod = 1. / p->stats.fwd_firerate;
1374 *energy_mod = p->stats.fwd_energy;
1376 case OUTFIT_TYPE_TURRET_BOLT:
1377 case OUTFIT_TYPE_TURRET_BEAM:
1378 *rate_mod = 1. / p->stats.tur_firerate;
1379 *energy_mod = p->stats.tur_energy;
1382 case OUTFIT_TYPE_LAUNCHER:
1383 case OUTFIT_TYPE_TURRET_LAUNCHER:
1384 *rate_mod = 1. / p->stats.launch_rate;
1388 case OUTFIT_TYPE_FIGHTER_BAY:
1389 *rate_mod = 1. / p->stats.fbay_rate;
1407 for (
int i=0; i<PILOT_WEAPON_SETS; i++) {
1445 if (!pilot_isPlayer(p))
1446 for (
int i=0; i<PILOT_WEAPON_SETS; i++) {
1453 for (
int i=0; i<
array_size(p->outfits); i++) {
1521 if ((p->weapon_sets[ p->active_set ].type==WEAPSET_TYPE_SWITCH)
1522 && (
array_size(p->weapon_sets[ p->active_set ].slots)>0)) {
1529 for (i=0; i<PILOT_WEAPON_SETS; i++) {
1536 if (i >= PILOT_WEAPON_SETS) {
1538 for (i=0; i<PILOT_WEAPON_SETS; i++) {
1540 if (ws->
type==WEAPSET_TYPE_SWITCH)
1543 p->active_set = (i>=PILOT_WEAPON_SETS) ? 0 : i;
1559 for (
int j=0; j<PILOT_WEAPON_SETS; j++) {
1580 if (o->
outfit == NULL || (pilot_isDisabled(p)) || (pilot_isFlag(p, PILOT_COOLDOWN)))
1607 o->
state = PILOT_OUTFIT_OFF;
1613 o->
state = PILOT_OUTFIT_OFF;
1615 o->
state = PILOT_OUTFIT_COOLDOWN;
1637 o->
state = PILOT_OUTFIT_ON;
1641 o->
state = PILOT_OUTFIT_ON;
1657 for (
int i=0; i<
array_size(p->outfits); i++) {
1662 if (o->
state == PILOT_OUTFIT_ON)
1676 if (pilot_isFlag(p, PILOT_HYP_PREP) || pilot_isFlag(p, PILOT_HYPERSPACE) ||
1677 pilot_isFlag(p, PILOT_LANDING) || pilot_isFlag(p, PILOT_TAKEOFF) ||
1678 pilot_isDisabled(p) || pilot_isFlag(p, PILOT_COOLDOWN))
1682 if (pilot_isFlag( p, PILOT_MANUAL_CONTROL ) && pilot_isPlayer(p))
1686 if (p->afterburner == NULL)
1690 if (p->energy < p->afterburner->outfit->u.afb.energy*0.5)
1694 if (
pilot_heatEfficiencyMod( p->afterburner->heat_T, p->afterburner->outfit->overheat_min, p->afterburner->outfit->overheat_max ) < 0.1) {
1695 if (pilot_isPlayer(p))
1696 player_message(_(
"#r%s is overheating!#0"),_(p->afterburner->outfit->name));
1701 if (p->afterburner->state == PILOT_OUTFIT_OFF) {
1702 p->afterburner->state = PILOT_OUTFIT_ON;
1704 pilot_setFlag(p,PILOT_AFTERBURNER);
1710 p->solid.pos.x, p->solid.pos.y, p->solid.vel.x, p->solid.vel.y);
1713 if (pilot_isPlayer(p)) {
1726 if (p->afterburner == NULL)
1729 if (p->afterburner->state == PILOT_OUTFIT_ON) {
1730 p->afterburner->state = PILOT_OUTFIT_OFF;
1731 pilot_rmFlag(p,PILOT_AFTERBURNER);
1736 p->solid.pos.x, p->solid.pos.y, p->solid.vel.x, p->solid.vel.y);
1747 for (
int i=0; i<PILOT_WEAPON_SETS; i++)
1756 for (
int i=0; i<PILOT_WEAPON_SETS; i++) {
Provides macros to work with dynamic arrays.
#define array_free(ptr_array)
Frees memory allocated and sets array to NULL.
#define array_copy(basic_type, ptr_array)
Returns a shallow copy of the input array.
#define array_end(array)
Returns a pointer to the end of the reserved memory space.
#define array_erase(ptr_array, first, last)
Erases elements in interval [first, last).
static ALWAYS_INLINE int array_size(const void *array)
Returns number of elements in the array.
#define array_grow(ptr_array)
Increases the number of elements by one and returns the last element.
#define array_begin(array)
Returns a pointer to the beginning of the reserved memory space.
#define array_create(basic_type)
Creates a new dynamic array of ‘basic_type’.
unsigned int escort_create(Pilot *p, const Ship *ship, const vec2 *pos, const vec2 *vel, double dir, EscortType_t type, int add, int dockslot)
Creates an escort.
void player_message(const char *fmt,...)
Adds a mesg to the queue to be displayed on screen.
Header file with generic functions and naev-specifics.
int outfit_isSecondary(const Outfit *o)
Checks if outfit has the secondary flag set.
double outfit_speed(const Outfit *o)
Gets the outfit's speed.
int outfit_isBeam(const Outfit *o)
Checks if outfit is a beam type weapon.
int outfit_isActive(const Outfit *o)
Checks if outfit is an active outfit.
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_isWeapon(const Outfit *o)
Checks to see if an outfit is a weapon.
int outfit_isFighterBay(const Outfit *o)
Checks if outfit is a fighter bay.
int outfit_isAfterburner(const Outfit *o)
Checks if outfit is an afterburner.
int outfit_isTurret(const Outfit *o)
Checks if outfit is a turret class weapon.
double outfit_duration(const Outfit *o)
Gets the outfit's duration.
double outfit_cooldown(const Outfit *o)
Gets the outfit's cooldown.
int outfit_isBolt(const Outfit *o)
Checks if outfit is bolt type weapon.
double outfit_energy(const Outfit *o)
Gets the outfit's energy usage.
double outfit_delay(const Outfit *o)
Gets the outfit's delay.
Pilot * pilot_getTarget(Pilot *p)
Gets the target of a pilot using a fancy caching system.
void pilot_cooldownEnd(Pilot *p, const char *reason)
Terminates active cooldown.
void pilot_destealth(Pilot *p)
Destealths a pilot.
void pilot_heatAddSlot(const Pilot *p, PilotOutfitSlot *o)
Adds heat to an outfit slot.
double pilot_heatEfficiencyMod(double T, double Tb, double Tc)
Returns a 0:1 modifier representing efficiency (1. being normal).
double pilot_heatAccuracyMod(double T)
Returns a 0:1 modifier representing accuracy (0. being normal).
int pilot_getMount(const Pilot *p, const PilotOutfitSlot *w, vec2 *v)
Gets the mount position of a pilot.
void pilot_updateMass(Pilot *pilot)
Updates the pilot stats after mass change.
int pilot_maxAmmoO(const Pilot *p, const Outfit *o)
Gets the maximum available ammo for a pilot for a specific outfit.
int pilot_slotIsToggleable(const PilotOutfitSlot *o)
Checks to see if a slot has an active outfit that can be toggleable.
int pilot_outfitLOntoggle(const Pilot *pilot, PilotOutfitSlot *po, int on)
Handle the manual toggle of an outfit.
void pilot_calcStats(Pilot *pilot)
Recalculates the pilot's stats based on his outfits.
double pilot_massFactor(const Pilot *pilot)
Gets the factor at which speed gets worse.
int pilot_outfitLOnshoot(const Pilot *pilot, PilotOutfitSlot *po)
Handle the manual shoot of an outfit.
int pilot_rmAmmo(Pilot *pilot, PilotOutfitSlot *s, int quantity)
Removes some ammo from the pilot stock.
void pilot_outfitLOnshootany(Pilot *pilot)
Runs the pilot's Lua outfits onshootany script.
int pilot_weapSetTypeCheck(Pilot *p, int id)
Checks the current weapon set type.
void pilot_getRateMod(double *rate_mod, double *energy_mod, const Pilot *p, const Outfit *o)
Gets applicable fire rate and energy modifications for a pilot's weapon.
static int pilot_shootWeaponSetOutfit(Pilot *p, PilotWeaponSet *ws, const Outfit *o, int level, const Target *target, double time, int aim)
Calculates and shoots the appropriate weapons in a weapon set matching an outfit.
void pilot_weapSetInrange(Pilot *p, int id, int inrange)
Changes the weapon set inrange property.
void pilot_weaponSafe(Pilot *p)
Sets the weapon set as safe.
int pilot_shoot(Pilot *p, int level)
Makes the pilot shoot.
void pilot_weapSetManual(Pilot *p, int id, int manual)
Changes the weapon set manual property.
void pilot_afterburnOver(Pilot *p)
Deactivates the afterburner.
void pilot_weapSetCleanup(Pilot *p, int id)
Cleans up a weapon set.
void pilot_weapSetVolley(Pilot *p, int id, int volley)
Changes the weapon set volley property.
int pilot_weapSetManualCheck(Pilot *p, int id)
Checks the current weapon set manual property.
void pilot_stopBeam(const Pilot *p, PilotOutfitSlot *w)
Stops a beam outfit and sets delay as appropriate.
static int pilot_weapSetFire(Pilot *p, PilotWeaponSet *ws, int level)
Fires a weapon set.
static void pilot_weapSetUpdateOutfits(Pilot *p, PilotWeaponSet *ws)
Updates the outfits with their current weapon set level.
void pilot_weapSetRm(Pilot *p, int id, const PilotOutfitSlot *o)
Removes a slot from a weapon set.
void pilot_shootStop(Pilot *p, int level)
Have pilot stop shooting their weapon.
void pilot_afterburn(Pilot *p)
Activate the afterburner.
void pilot_weaponClear(Pilot *p)
Clears the pilots weapon settings.
void ws_copy(PilotWeaponSet dest[PILOT_WEAPON_SETS], const PilotWeaponSet src[PILOT_WEAPON_SETS])
Copies a weapon set over.
void ws_free(PilotWeaponSet ws[PILOT_WEAPON_SETS])
Frees a weapon set.
static void pilot_weapSetUpdateRange(const Pilot *p, PilotWeaponSet *ws)
Updates the weapon range for a pilot weapon set.
int pilot_weapSetVolleyCheck(Pilot *p, int id)
Checks the current weapon set volley property.
double pilot_weapFlyTime(const Outfit *o, const Pilot *parent, const vec2 *pos, const vec2 *vel)
Computes an estimation of ammo flying time.
void pilot_weapSetAIClear(Pilot *p)
Useful function for AI, clears activeness of all weapon sets.
PilotWeaponSet * pilot_weapSet(Pilot *p, int id)
Gets a weapon set from id.
Pilot * pilot_weaponTarget(Pilot *p, Target *wt)
Gets the weapon target of a pilot.
void pilot_weapSetUpdate(Pilot *p)
Updates the pilot's weapon sets.
int pilot_weapSetInSet(Pilot *p, int id, const PilotOutfitSlot *o)
Checks to see if a slot is in a weapon set.
int pilot_outfitOffAll(Pilot *p)
Disables all active outfits for a pilot.
void pilot_weaponSetDefault(Pilot *p)
Gives the pilot a default weapon set.
int pilot_weapSetCheck(Pilot *p, int id, const PilotOutfitSlot *o)
Checks to see if a slot is in a weapon set and usable.
PilotWeaponSetOutfit * pilot_weapSetList(Pilot *p, int id)
Lists the items in a pilot weapon set.
unsigned int pilot_weaponSetShootStop(Pilot *p, PilotWeaponSet *ws, int level)
Have pilot stop shooting a given weaponset.
int pilot_outfitOn(Pilot *p, PilotOutfitSlot *o)
Enable a given active outfit.
double pilot_weapSetAmmo(Pilot *p, int id, int level)
Gets the ammo of the current pilot weapon set.
int pilot_shootWeapon(Pilot *p, PilotOutfitSlot *w, const Target *target, double time, int aim)
Actually handles the shooting, how often the player.p can shoot and such.
void pilot_weapSetClear(Pilot *p, int id)
Clears a weapon set.
void pilot_weaponAuto(Pilot *p)
Tries to automatically set and create the pilot's weapon set.
int pilot_weapSetInrangeCheck(Pilot *p, int id)
Checks the current weapon set inrange property.
void pilot_weapSetPress(Pilot *p, int id, int type)
Handles a weapon set press.
void pilot_weapSetFree(Pilot *p)
Frees a pilot's weapon sets.
const char * pilot_weapSetName(Pilot *p, int id)
Gets the name of a weapon set.
double pilot_weapSetSpeed(Pilot *p, int id, int level)
Gets the speed of the current pilot weapon set.
int pilot_outfitOff(Pilot *p, PilotOutfitSlot *o)
Disables a given active outfit.
void pilot_weapSetType(Pilot *p, int id, WeaponSetType type)
Changes the weapon sets mode.
double pilot_weapSetRange(Pilot *p, int id, int level)
Gets the range of the current pilot weapon set.
void pilot_weapSetUpdateStats(Pilot *p)
Update the weapon sets given pilot stat changes.
void pilot_weapSetAdd(Pilot *p, int id, const PilotOutfitSlot *o, int level)
Adds an outfit to a weapon set.
int sound_playPos(int sound, double px, double py, double vx, double vy)
Plays a sound based on position.
void spfx_shake(double mod)
Increases the current rumble level.
A ship outfit, depends radically on the type.
OutfitAfterburnerData afb
Stores an outfit the pilot has.
A pilot Weapon Set Outfit.
A weapon set represents a set of weapons that have an action.
PilotWeaponSetOutfit * slots
double range[PILOT_WEAPSET_MAX_LEVELS]
double speed[PILOT_WEAPSET_MAX_LEVELS]
The representation of an in-game pilot.
PilotOutfitSlot * afterburner
Represents a weapon target.
double weapon_targetFlyTime(const Outfit *o, const Pilot *p, const Target *t)
Gets the fly time for a weapon target.
unsigned int beam_start(PilotOutfitSlot *po, double dir, const vec2 *pos, const vec2 *vel, const Pilot *parent, const Target *target, int aim)
Starts a beam weapon.
Weapon * weapon_add(PilotOutfitSlot *po, const Outfit *ref, double dir, const vec2 *pos, const vec2 *vel, const Pilot *parent, const Target *target, double time, int aim)
Creates a new weapon.
int weapon_inArc(const Outfit *o, const Pilot *parent, const Target *target, const vec2 *pos, const vec2 *vel, double dir, double time)
Gets the aim position of a turret weapon.
void beam_end(unsigned int beam)
Ends a beam weapon.