Barotrauma Server 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 ()
 

Public Attributes

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

Static Public Attributes

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

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

Definition at line 8 of file AITarget.cs.

Member Enumeration Documentation

◆ TargetType

Enumerator
Any 
HumanOnly 
EnemyOnly 

Definition at line 142 of file AITarget.cs.

Constructor & Destructor Documentation

◆ AITarget() [1/2]

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

Definition at line 187 of file AITarget.cs.

◆ AITarget() [2/2]

Barotrauma.AITarget.AITarget ( Entity  e)

Definition at line 212 of file AITarget.cs.

Member Function Documentation

◆ DecreaseSightRange()

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

Definition at line 258 of file AITarget.cs.

◆ DecreaseSoundRange()

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

Definition at line 253 of file AITarget.cs.

◆ HasSector()

bool Barotrauma.AITarget.HasSector ( )

Definition at line 263 of file AITarget.cs.

◆ IncreaseSightRange()

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

Definition at line 248 of file AITarget.cs.

◆ IncreaseSoundRange()

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

Definition at line 243 of file AITarget.cs.

◆ IsWithinSector()

bool Barotrauma.AITarget.IsWithinSector ( Vector2  worldPosition)

Definition at line 268 of file AITarget.cs.

◆ Remove()

void Barotrauma.AITarget.Remove ( )

Definition at line 275 of file AITarget.cs.

◆ Reset()

void Barotrauma.AITarget.Reset ( )

Definition at line 281 of file AITarget.cs.

◆ Update()

void Barotrauma.AITarget.Update ( float  deltaTime)

Definition at line 218 of file AITarget.cs.

Member Data Documentation

◆ InDetectableSetTime

double Barotrauma.AITarget.InDetectableSetTime

Definition at line 105 of file AITarget.cs.

◆ List

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

Definition at line 10 of file AITarget.cs.

◆ MaxSoundRange

float Barotrauma.AITarget.MaxSoundRange = 100000

Definition at line 129 of file AITarget.cs.

◆ MinSoundRange

float Barotrauma.AITarget.MinSoundRange

Definition at line 128 of file AITarget.cs.

◆ SonarIconIdentifier

Identifier Barotrauma.AITarget.SonarIconIdentifier

Definition at line 101 of file AITarget.cs.

◆ SonarLabel

LocalizedString Barotrauma.AITarget.SonarLabel

Definition at line 100 of file AITarget.cs.

Property Documentation

◆ Entity

Entity Barotrauma.AITarget.Entity
get

Definition at line 13 of file AITarget.cs.

◆ 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 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 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 AITarget.cs.

◆ SectorDegrees

float Barotrauma.AITarget.SectorDegrees
getset

Definition at line 71 of file AITarget.cs.

◆ SectorDir

Vector2? Barotrauma.AITarget.SectorDir
getset

Definition at line 78 of file AITarget.cs.

◆ SightRange

float Barotrauma.AITarget.SightRange
getset

Definition at line 52 of file AITarget.cs.

◆ SimPosition

Vector2 Barotrauma.AITarget.SimPosition
get

Definition at line 168 of file AITarget.cs.

◆ SonarDisruption

float Barotrauma.AITarget.SonarDisruption
getset

Definition at line 94 of file AITarget.cs.

◆ SoundRange

float Barotrauma.AITarget.SoundRange
getset

Definition at line 34 of file AITarget.cs.

◆ Static

bool Barotrauma.AITarget.Static
get

Definition at line 30 of file AITarget.cs.

◆ StaticSight

bool Barotrauma.AITarget.StaticSight
get

Definition at line 32 of file AITarget.cs.

◆ StaticSound

bool Barotrauma.AITarget.StaticSound
get

Definition at line 31 of file AITarget.cs.

◆ Type

TargetType Barotrauma.AITarget.Type
get

Definition at line 140 of file AITarget.cs.

◆ WorldPosition

Vector2 Barotrauma.AITarget.WorldPosition
get

Definition at line 149 of file AITarget.cs.