naev 0.12.6
pilot_ew.c File Reference

Pilot electronic warfare information. More...

#include "array.h"
#include "hook.h"
#include "pilot.h"
#include "player.h"
#include "player_autonav.h"
#include "space.h"
Include dependency graph for pilot_ew.c:

Go to the source code of this file.

Functions

static void pilot_ewUpdate (Pilot *p)
 Updates all the internal values.
static double pilot_ewMass (double mass)
 Gets the electronic warfare mass modifier for a given mass.
static double pilot_ewAsteroid (const Pilot *p)
 Gets the electronic warfare asteroid modifier.
static double pilot_ewJumpPoint (const Pilot *p)
 Gets the electronic warfare jump point modifier.
static int pilot_ewStealthGetNearby (const Pilot *p, double *mod, int *close, int *isplayer)
 Checks to see if there are pilots nearby to a stealthed pilot that could break stealth.
double pilot_ewScanTime (const Pilot *p)
 Gets the time it takes to scan a pilot.
void pilot_ewScanStart (Pilot *p)
 Initializes the scan timer for a pilot.
int pilot_ewScanCheck (const Pilot *p)
 Checks to see if a scan is done.
void pilot_ewUpdateStatic (Pilot *p)
 Updates the pilot's static electronic warfare properties.
void pilot_ewUpdateDynamic (Pilot *p, double dt)
 Updates the pilot's dynamic electronic warfare properties.
void pilot_updateSensorRange (void)
 Updates the system's base sensor range.
double pilot_sensorRange (void)
 Returns the default sensor range for the current system.
int pilot_inRange (const Pilot *p, double x, double y)
 Check to see if a position is in range of the pilot.
int pilot_inRangePilot (const Pilot *p, const Pilot *target, double *dist2)
 Check to see if a pilot is in sensor range of another.
int pilot_inRangeSpob (const Pilot *p, int target)
 Check to see if a spob is in sensor range of the pilot.
int pilot_inRangeAsteroid (const Pilot *p, int ast, int fie)
 Check to see if an asteroid is in sensor range of the pilot.
int pilot_inRangeJump (const Pilot *p, int i)
 Check to see if a jump point is in sensor range of the pilot.
double pilot_ewWeaponTrack (const Pilot *p, const Pilot *t, double trackmin, double trackmax)
 Calculates the weapon lead (1. is 100%, 0. is 0%)..
void pilot_ewUpdateStealth (Pilot *p, double dt)
 Updates the stealth mode and checks to see if it is getting broken.
int pilot_stealth (Pilot *p)
 Stealths a pilot.
void pilot_destealth (Pilot *p)
 Destealths a pilot.

Variables

static double ew_interference = 1.

Detailed Description

Pilot electronic warfare information.

Definition in file pilot_ew.c.

Function Documentation

◆ pilot_destealth()

void pilot_destealth ( Pilot * p)

Destealths a pilot.

Definition at line 585 of file pilot_ew.c.

◆ pilot_ewAsteroid()

double pilot_ewAsteroid ( const Pilot * p)
static

Gets the electronic warfare asteroid modifier.

Parameters
pPilot.
Returns
The electronic warfare asteroid modifier.

Definition at line 173 of file pilot_ew.c.

◆ pilot_ewJumpPoint()

double pilot_ewJumpPoint ( const Pilot * p)
static

Gets the electronic warfare jump point modifier.

Parameters
pPilot.
Returns
The electronic warfare jump point modifier.

Definition at line 187 of file pilot_ew.c.

◆ pilot_ewMass()

double pilot_ewMass ( double mass)
static

Gets the electronic warfare mass modifier for a given mass.

Parameters
massMass to get the electronic warfare mass modifier of.
Returns
The electronic warfare mass modifier.

Definition at line 162 of file pilot_ew.c.

◆ pilot_ewScanCheck()

int pilot_ewScanCheck ( const Pilot * p)

Checks to see if a scan is done.

Parameters
pPilot to check.
Returns
1 if scan is done, 0 otherwise.

Definition at line 74 of file pilot_ew.c.

◆ pilot_ewScanStart()

void pilot_ewScanStart ( Pilot * p)

Initializes the scan timer for a pilot.

Parameters
pPilot to set scan timer for.

Definition at line 54 of file pilot_ew.c.

◆ pilot_ewScanTime()

double pilot_ewScanTime ( const Pilot * p)

Gets the time it takes to scan a pilot.

Parameters
pPilot to scan.
Returns
Time it takes to scan the pilot.

Definition at line 40 of file pilot_ew.c.

◆ pilot_ewStealthGetNearby()

int pilot_ewStealthGetNearby ( const Pilot * p,
double * mod,
int * close,
int * isplayer )
static

Checks to see if there are pilots nearby to a stealthed pilot that could break stealth.

Parameters
pPilot to check.
modDistance-dependent trength modifier.
closeNumber of pilots nearby.
isplayerWhether or not the player is the pilot breaking stealth.
Returns
Number of stealth-breaking pilots nearby.

Definition at line 431 of file pilot_ew.c.

◆ pilot_ewUpdate()

void pilot_ewUpdate ( Pilot * p)
static

Updates all the internal values.

Definition at line 84 of file pilot_ew.c.

◆ pilot_ewUpdateDynamic()

void pilot_ewUpdateDynamic ( Pilot * p,
double dt )

Updates the pilot's dynamic electronic warfare properties.

Parameters
pPilot to update.
dtDelta time increment (seconds).

Definition at line 113 of file pilot_ew.c.

◆ pilot_ewUpdateStatic()

void pilot_ewUpdateStatic ( Pilot * p)

Updates the pilot's static electronic warfare properties.

Parameters
pPilot to update.

Definition at line 101 of file pilot_ew.c.

◆ pilot_ewUpdateStealth()

void pilot_ewUpdateStealth ( Pilot * p,
double dt )

Updates the stealth mode and checks to see if it is getting broken.

Parameters
pPilot to update.
dtCurrent delta-tick.

Definition at line 497 of file pilot_ew.c.

◆ pilot_ewWeaponTrack()

double pilot_ewWeaponTrack ( const Pilot * p,
const Pilot * t,
double trackmin,
double trackmax )

Calculates the weapon lead (1. is 100%, 0. is 0%)..

Parameters
pPilot tracking.
tPilot being tracked.
trackminMinimum track limit of the weapon.
trackmaxMaximum track limit of the weapon.
Returns
The lead angle of the weapon.

Definition at line 407 of file pilot_ew.c.

◆ pilot_inRange()

int pilot_inRange ( const Pilot * p,
double x,
double y )

Check to see if a position is in range of the pilot.

Parameters
pPilot to check to see if position is in their sensor range.
xX position to check.
yY position to check.
Returns
1 if the position is in range, -1 if it is fuzzy, 0 if it isn't.

Definition at line 231 of file pilot_ew.c.

◆ pilot_inRangeAsteroid()

int pilot_inRangeAsteroid ( const Pilot * p,
int ast,
int fie )

Check to see if an asteroid is in sensor range of the pilot.

Parameters
pPilot who is trying to check to see if the asteroid is in sensor range.
astAsteroid to see if is in sensor range.
fieField the Asteroid belongs to to see if is in sensor range.
Returns
1 if they are in range, 0 if they aren't.

Definition at line 324 of file pilot_ew.c.

◆ pilot_inRangeJump()

int pilot_inRangeJump ( const Pilot * p,
int i )

Check to see if a jump point is in sensor range of the pilot.

Parameters
pPilot who is trying to check to see if the jump point is in sensor range.
itarget Jump point to see if is in sensor range.
Returns
1 if they are in range, 0 if they aren't.

Definition at line 361 of file pilot_ew.c.

◆ pilot_inRangePilot()

int pilot_inRangePilot ( const Pilot * p,
const Pilot * target,
double * dist2 )

Check to see if a pilot is in sensor range of another.

Parameters
pPilot who is trying to check to see if other is in sensor range.
targetTarget of p to check to see if is in sensor range.
[out]dist2Distance squared of the two pilots. Set to NULL if you're not interested.
Returns
1 if they are in range, 0 if they aren't and -1 if they are detected fuzzily.

Definition at line 256 of file pilot_ew.c.

◆ pilot_inRangeSpob()

int pilot_inRangeSpob ( const Pilot * p,
int target )

Check to see if a spob is in sensor range of the pilot.

Parameters
pPilot who is trying to check to see if the spob is in sensor range.
targetSpob to see if is in sensor range.
Returns
1 if they are in range, 0 if they aren't.

Definition at line 293 of file pilot_ew.c.

◆ pilot_sensorRange()

double pilot_sensorRange ( void )

Returns the default sensor range for the current system.

Returns
Sensor range.

Definition at line 218 of file pilot_ew.c.

◆ pilot_stealth()

int pilot_stealth ( Pilot * p)

Stealths a pilot.

Definition at line 543 of file pilot_ew.c.

◆ pilot_updateSensorRange()

void pilot_updateSensorRange ( void )

Updates the system's base sensor range.

Definition at line 208 of file pilot_ew.c.

Variable Documentation

◆ ew_interference

double ew_interference = 1.
static

Interference factor.

Definition at line 22 of file pilot_ew.c.