Barotrauma Client Doc
Barotrauma.AITarget Class Reference

Public Types

enum class  TargetType { Any , HumanOnly , EnemyOnly }
 

Public Member Functions

 AITarget (Entity e, XElement element)
 
 AITarget (Entity e)
 
void Update (float deltaTime)
 
void IncreaseSoundRange (float deltaTime, float speed=1)
 
void IncreaseSightRange (float deltaTime, float speed=1)
 
void DecreaseSoundRange (float deltaTime, float speed=1)
 
void DecreaseSightRange (float deltaTime, float speed=1)
 
bool HasSector ()
 
bool IsWithinSector (Vector2 worldPosition)
 
void Remove ()
 
void Reset ()
 
void Draw (SpriteBatch spriteBatch)
 

Public Attributes

LocalizedString SonarLabel
 
Identifier SonarIconIdentifier
 
double InDetectableSetTime
 
float MinSoundRange
 
float MaxSoundRange = 100000
 

Static Public Attributes

static List< AITargetList = new List<AITarget>()
 
static bool ShowAITargets
 

Properties

Entity Entity [get]
 
float FadeOutTime = 2 [get]
 How long does it take for the ai target to fade out if not kept alive. More...
 
bool Static [get]
 
bool StaticSound [get]
 
bool StaticSight [get]
 
float SoundRange [get, set]
 
float SightRange [get, set]
 
float SectorDegrees [get, set]
 
Vector2? SectorDir [get, set]
 
float SonarDisruption [get, set]
 
bool InDetectable [get, set]
 Should be reset to false each frame and kept indetectable by e.g. a status effect. More...
 
bool NeedsUpdate = true [get]
 Does the AI target do something that requires Update() to be called (e.g. static targets don't need to be updated) More...
 
TargetType Type [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 

Detailed Description

Member Enumeration Documentation

◆ TargetType

Enumerator
Any 
HumanOnly 
EnemyOnly 

Definition at line 142 of file BarotraumaShared/SharedSource/Characters/AI/AITarget.cs.

Constructor & Destructor Documentation

◆ AITarget() [1/2]

Barotrauma.AITarget.AITarget ( Entity  e,
XElement  element 
)

◆ AITarget() [2/2]

Barotrauma.AITarget.AITarget ( Entity  e)

Member Function Documentation

◆ DecreaseSightRange()

void Barotrauma.AITarget.DecreaseSightRange ( float  deltaTime,
float  speed = 1 
)

◆ DecreaseSoundRange()

void Barotrauma.AITarget.DecreaseSoundRange ( float  deltaTime,
float  speed = 1 
)

◆ Draw()

void Barotrauma.AITarget.Draw ( SpriteBatch  spriteBatch)

◆ HasSector()

bool Barotrauma.AITarget.HasSector ( )

◆ IncreaseSightRange()

void Barotrauma.AITarget.IncreaseSightRange ( float  deltaTime,
float  speed = 1 
)

◆ IncreaseSoundRange()

void Barotrauma.AITarget.IncreaseSoundRange ( float  deltaTime,
float  speed = 1 
)

◆ IsWithinSector()

bool Barotrauma.AITarget.IsWithinSector ( Vector2  worldPosition)

◆ Remove()

void Barotrauma.AITarget.Remove ( )

◆ Reset()

void Barotrauma.AITarget.Reset ( )

◆ Update()

void Barotrauma.AITarget.Update ( float  deltaTime)

Member Data Documentation

◆ InDetectableSetTime

double Barotrauma.AITarget.InDetectableSetTime

◆ List

List<AITarget> Barotrauma.AITarget.List = new List<AITarget>()
static

◆ MaxSoundRange

float Barotrauma.AITarget.MaxSoundRange = 100000

◆ MinSoundRange

float Barotrauma.AITarget.MinSoundRange

◆ ShowAITargets

bool Barotrauma.AITarget.ShowAITargets
static

◆ SonarIconIdentifier

Identifier Barotrauma.AITarget.SonarIconIdentifier

◆ SonarLabel

LocalizedString Barotrauma.AITarget.SonarLabel

Property Documentation

◆ Entity

Entity Barotrauma.AITarget.Entity
get

◆ FadeOutTime

float Barotrauma.AITarget.FadeOutTime = 2
get

How long does it take for the ai target to fade out if not kept alive.

Definition at line 28 of file BarotraumaShared/SharedSource/Characters/AI/AITarget.cs.

◆ InDetectable

bool Barotrauma.AITarget.InDetectable
getset

Should be reset to false each frame and kept indetectable by e.g. a status effect.

Definition at line 110 of file BarotraumaShared/SharedSource/Characters/AI/AITarget.cs.

◆ NeedsUpdate

bool Barotrauma.AITarget.NeedsUpdate = true
get

Does the AI target do something that requires Update() to be called (e.g. static targets don't need to be updated)

Definition at line 134 of file BarotraumaShared/SharedSource/Characters/AI/AITarget.cs.

◆ SectorDegrees

float Barotrauma.AITarget.SectorDegrees
getset

◆ SectorDir

Vector2? Barotrauma.AITarget.SectorDir
getset

◆ SightRange

float Barotrauma.AITarget.SightRange
getset

◆ SimPosition

Vector2 Barotrauma.AITarget.SimPosition
get

◆ SonarDisruption

float Barotrauma.AITarget.SonarDisruption
getset

◆ SoundRange

float Barotrauma.AITarget.SoundRange
getset

◆ Static

bool Barotrauma.AITarget.Static
get

◆ StaticSight

bool Barotrauma.AITarget.StaticSight
get

◆ StaticSound

bool Barotrauma.AITarget.StaticSound
get

◆ Type

TargetType Barotrauma.AITarget.Type
get

◆ WorldPosition

Vector2 Barotrauma.AITarget.WorldPosition
get