Barotrauma Server Doc
Barotrauma.EnemyAIController Class Reference
Inheritance diagram for Barotrauma.EnemyAIController:
Barotrauma.AIController Barotrauma.ISteerable

Public Member Functions

bool IsBeingChasedBy (Character c)
 
 EnemyAIController (Character c, string seed)
 
override void SelectTarget (AITarget target)
 
void SelectTarget (AITarget target, float priority)
 
override void Update (float deltaTime)
 
void AimRangedAttack (Attack attack, Entity targetEntity)
 
override void OnAttacked (Character attacker, AttackResult attackResult)
 
AITarget UpdateTargets (out CharacterParams.TargetParams targetingParams)
 
void IgnoreTarget (AITarget target)
 
void LaunchTrigger (StatusEffect.AITrigger trigger)
 
void ReevaluateAttacks ()
 
override bool SteerThroughGap (Structure wall, WallSection section, Vector2 targetWorldPos, float deltaTime)
 
override bool SteerThroughGap (Gap gap, Vector2 targetWorldPos, float deltaTime, float maxDistance=-1)
 
bool CanPassThroughHole (Structure wall, int sectionIndex)
 
override bool Escape (float deltaTime)
 
Limb GetTargetLimb (Limb attackLimb, Character target, LimbType targetLimbType=LimbType.None)
 
- Public Member Functions inherited from Barotrauma.AIController
bool HasValidPath (bool requireNonDirty=true, bool requireUnfinished=true, Func< WayPoint, bool > nodePredicate=null)
 Is the current path valid, using the provided parameters. More...
 
 AIController (Character c)
 
virtual void OnHealed (Character healer, float healAmount)
 
virtual void Reset ()
 
void FaceTarget (ISpatialEntity target)
 
bool CanPassThroughHole (Structure wall, int sectionIndex, int requiredHoleCount)
 
bool TakeItem (Item item, CharacterInventory targetInventory, bool equip, bool wear=false, bool dropOtherIfCannotMove=true, bool allowSwapping=false, bool storeUnequipped=false, IEnumerable< Identifier > targetTags=null)
 
void UnequipEmptyItems (Item parentItem, bool avoidDroppingInSea=true)
 
void UnequipContainedItems (Item parentItem, Func< Item, bool > predicate=null, bool avoidDroppingInSea=true, int? unequipMax=null)
 
void ReequipUnequipped ()
 
void ResetEscape ()
 

Static Public Member Functions

static bool IsTargetBeingChasedBy (Character target, Character character)
 
static bool IsLatchedTo (Character target, Character character)
 
static bool IsLatchedToSomeoneElse (Character target, Character character)
 
- Static Public Member Functions inherited from Barotrauma.AIController
static void UnequipEmptyItems (Character character, Item parentItem, bool avoidDroppingInSea=true)
 
static void UnequipContainedItems (Character character, Item parentItem, Func< Item, bool > predicate, bool avoidDroppingInSea=true, int? unequipMax=null)
 

Public Attributes

bool TargetOutposts
 Enable the character to attack the outposts and the characters inside them. Disabled by default in normal levels, enabled in outpost levels. More...
 
- Public Attributes inherited from Barotrauma.AIController
bool Enabled
 
readonly Character Character
 

Static Public Attributes

static bool DisableEnemyAI
 

Protected Member Functions

override void OnTargetChanged (AITarget previousTarget, AITarget newTarget)
 
override void OnStateChanged (AIState from, AIState to)
 
- Protected Member Functions inherited from Barotrauma.AIController
void ResetAITarget ()
 
bool IsWallDisabled (Structure wall)
 
bool UpdateEscape (float deltaTime, bool canAttackDoors)
 

Properties

AIState State [get, set]
 
AIState PreviousState [get]
 
float CombatStrength [get]
 
Limb?? AttackLimb [get]
 
AttackActiveAttack [get]
 
AITargetMemory SelectedTargetMemory [get]
 
bool CanAttackDoors [get]
 
float PriorityFearIncrement [get]
 
LatchOntoAI LatchOntoAI [get]
 
SwarmBehavior SwarmBehavior [get]
 
PetBehavior PetBehavior [get]
 
CharacterParams.TargetParams SelectedTargetingParams [get]
 
bool AttackHumans [get]
 
bool AttackRooms [get]
 
override bool CanEnterSubmarine [get]
 
override bool CanFlip [get]
 
HashSet< SubmarineUnattackableSubmarines = new HashSet<Submarine>() [get]
 The monster won't try to damage these submarines More...
 
bool Reverse [get]
 
CharacterParams.AIParams AIParams [get]
 Shorthand for Character.Params.AI with null checking. More...
 
- Properties inherited from Barotrauma.AIController
AITarget SelectedAiTarget [get, protected set]
 
SteeringManager SteeringManager [get]
 
Vector2 Steering [get, set]
 
Vector2 SimPosition [get]
 
Vector2 WorldPosition [get]
 
Vector2 Velocity [get]
 
virtual bool CanEnterSubmarine [get]
 
virtual bool CanFlip [get]
 
virtual bool IsMentallyUnstable [get]
 
IEnumerable< HullVisibleHulls [get]
 Returns hulls that are visible to the character, including the current hull. Note that this is not an accurate visibility check, it only checks for open gaps between the adjacent and linked hulls. More...
 
bool IsCurrentPathNullOrUnreachable [get]
 
bool IsCurrentPathUnreachable [get]
 
bool IsCurrentPathFinished [get]
 
bool IsSteeringThroughGap [get, protected set]
 
bool IsTryingToSteerThroughGap [get, protected set]
 
Gap EscapeTarget [get]
 
- Properties inherited from Barotrauma.ISteerable
Vector2 Steering [get, set]
 
Vector2 Velocity [get]
 
Vector2 SimPosition [get]
 
Vector2 WorldPosition [get]
 

Additional Inherited Members

- Protected Attributes inherited from Barotrauma.AIController
AITarget _lastAiTarget
 
AITarget _previousAiTarget
 
AITarget _selectedAiTarget
 
SteeringManager steeringManager
 
readonly float colliderWidth
 
readonly float minGapSize
 
readonly float colliderLength
 
readonly float avoidLookAheadDistance
 
bool allGapsSearched
 
readonly HashSet< GapunreachableGaps = new HashSet<Gap>()
 

Detailed Description

Definition at line 27 of file EnemyAIController.cs.

Constructor & Destructor Documentation

◆ EnemyAIController()

Barotrauma.EnemyAIController.EnemyAIController ( Character  c,
string  seed 
)

Definition at line 242 of file EnemyAIController.cs.

Member Function Documentation

◆ AimRangedAttack()

void Barotrauma.EnemyAIController.AimRangedAttack ( Attack  attack,
Entity  targetEntity 
)

Definition at line 2008 of file EnemyAIController.cs.

◆ CanPassThroughHole()

bool Barotrauma.EnemyAIController.CanPassThroughHole ( Structure  wall,
int  sectionIndex 
)

◆ Escape()

override bool Barotrauma.EnemyAIController.Escape ( float  deltaTime)
virtual

Implements Barotrauma.AIController.

Definition at line 3958 of file EnemyAIController.cs.

◆ GetTargetLimb()

Limb Barotrauma.EnemyAIController.GetTargetLimb ( Limb  attackLimb,
Character  target,
LimbType  targetLimbType = LimbType.None 
)

Definition at line 4026 of file EnemyAIController.cs.

◆ IgnoreTarget()

void Barotrauma.EnemyAIController.IgnoreTarget ( AITarget  target)

Definition at line 3526 of file EnemyAIController.cs.

◆ IsBeingChasedBy()

bool Barotrauma.EnemyAIController.IsBeingChasedBy ( Character  c)

◆ IsLatchedTo()

static bool Barotrauma.EnemyAIController.IsLatchedTo ( Character  target,
Character  character 
)
static

Definition at line 2622 of file EnemyAIController.cs.

◆ IsLatchedToSomeoneElse()

static bool Barotrauma.EnemyAIController.IsLatchedToSomeoneElse ( Character  target,
Character  character 
)
static

Definition at line 2631 of file EnemyAIController.cs.

◆ IsTargetBeingChasedBy()

static bool Barotrauma.EnemyAIController.IsTargetBeingChasedBy ( Character  target,
Character  character 
)
static

◆ LaunchTrigger()

void Barotrauma.EnemyAIController.LaunchTrigger ( StatusEffect.AITrigger  trigger)

Definition at line 3545 of file EnemyAIController.cs.

◆ OnAttacked()

override void Barotrauma.EnemyAIController.OnAttacked ( Character  attacker,
AttackResult  attackResult 
)
virtual

Reimplemented from Barotrauma.AIController.

Definition at line 2111 of file EnemyAIController.cs.

◆ OnStateChanged()

override void Barotrauma.EnemyAIController.OnStateChanged ( AIState  from,
AIState  to 
)
protectedvirtual

Reimplemented from Barotrauma.AIController.

Definition at line 3740 of file EnemyAIController.cs.

◆ OnTargetChanged()

override void Barotrauma.EnemyAIController.OnTargetChanged ( AITarget  previousTarget,
AITarget  newTarget 
)
protectedvirtual

Reimplemented from Barotrauma.AIController.

Definition at line 3723 of file EnemyAIController.cs.

◆ ReevaluateAttacks()

void Barotrauma.EnemyAIController.ReevaluateAttacks ( )

Definition at line 3834 of file EnemyAIController.cs.

◆ SelectTarget() [1/2]

override void Barotrauma.EnemyAIController.SelectTarget ( AITarget  target)
virtual

Reimplemented from Barotrauma.AIController.

◆ SelectTarget() [2/2]

void Barotrauma.EnemyAIController.SelectTarget ( AITarget  target,
float  priority 
)

Definition at line 440 of file EnemyAIController.cs.

◆ SteerThroughGap() [1/2]

override bool Barotrauma.EnemyAIController.SteerThroughGap ( Gap  gap,
Vector2  targetWorldPos,
float  deltaTime,
float  maxDistance = -1 
)
virtual

Reimplemented from Barotrauma.AIController.

Definition at line 3942 of file EnemyAIController.cs.

◆ SteerThroughGap() [2/2]

override bool Barotrauma.EnemyAIController.SteerThroughGap ( Structure  wall,
WallSection  section,
Vector2  targetWorldPos,
float  deltaTime 
)
virtual

Reimplemented from Barotrauma.AIController.

Definition at line 3925 of file EnemyAIController.cs.

◆ Update()

override void Barotrauma.EnemyAIController.Update ( float  deltaTime)
virtual

Reimplemented from Barotrauma.AIController.

Definition at line 459 of file EnemyAIController.cs.

◆ UpdateTargets()

AITarget Barotrauma.EnemyAIController.UpdateTargets ( out CharacterParams.TargetParams  targetingParams)

Definition at line 2645 of file EnemyAIController.cs.

Member Data Documentation

◆ DisableEnemyAI

bool Barotrauma.EnemyAIController.DisableEnemyAI
static

Definition at line 29 of file EnemyAIController.cs.

◆ TargetOutposts

bool Barotrauma.EnemyAIController.TargetOutposts

Enable the character to attack the outposts and the characters inside them. Disabled by default in normal levels, enabled in outpost levels.

Definition at line 55 of file EnemyAIController.cs.

Property Documentation

◆ ActiveAttack

Attack? Barotrauma.EnemyAIController.ActiveAttack
get

Definition at line 105 of file EnemyAIController.cs.

◆ AIParams

CharacterParams.AIParams Barotrauma.EnemyAIController.AIParams
get

Shorthand for Character.Params.AI with null checking.

Returns
Character.Params.AI or an empty params. Does not return nulls.

Definition at line 329 of file EnemyAIController.cs.

◆ AttackHumans

bool Barotrauma.EnemyAIController.AttackHumans
get

Definition at line 161 of file EnemyAIController.cs.

◆ AttackLimb

Limb?? Barotrauma.EnemyAIController.AttackLimb
get

Definition at line 82 of file EnemyAIController.cs.

◆ AttackRooms

bool Barotrauma.EnemyAIController.AttackRooms
get

Definition at line 170 of file EnemyAIController.cs.

◆ CanAttackDoors

bool Barotrauma.EnemyAIController.CanAttackDoors
get

Definition at line 128 of file EnemyAIController.cs.

◆ CanEnterSubmarine

override bool Barotrauma.EnemyAIController.CanEnterSubmarine
get

Definition at line 179 of file EnemyAIController.cs.

◆ CanFlip

override bool Barotrauma.EnemyAIController.CanFlip
get

Definition at line 188 of file EnemyAIController.cs.

◆ CombatStrength

float Barotrauma.EnemyAIController.CombatStrength
get

Definition at line 72 of file EnemyAIController.cs.

◆ LatchOntoAI

LatchOntoAI Barotrauma.EnemyAIController.LatchOntoAI
get

Definition at line 155 of file EnemyAIController.cs.

◆ PetBehavior

PetBehavior Barotrauma.EnemyAIController.PetBehavior
get

Definition at line 157 of file EnemyAIController.cs.

◆ PreviousState

AIState Barotrauma.EnemyAIController.PreviousState
get

Definition at line 50 of file EnemyAIController.cs.

◆ PriorityFearIncrement

float Barotrauma.EnemyAIController.PriorityFearIncrement
get

Definition at line 132 of file EnemyAIController.cs.

◆ Reverse

bool Barotrauma.EnemyAIController.Reverse
get

Definition at line 224 of file EnemyAIController.cs.

◆ SelectedTargetingParams

CharacterParams.TargetParams Barotrauma.EnemyAIController.SelectedTargetingParams
get

Definition at line 159 of file EnemyAIController.cs.

◆ SelectedTargetMemory

AITargetMemory Barotrauma.EnemyAIController.SelectedTargetMemory
get

Definition at line 119 of file EnemyAIController.cs.

◆ State

AIState Barotrauma.EnemyAIController.State
getset

Definition at line 32 of file EnemyAIController.cs.

◆ SwarmBehavior

SwarmBehavior Barotrauma.EnemyAIController.SwarmBehavior
get

Definition at line 156 of file EnemyAIController.cs.

◆ UnattackableSubmarines

HashSet<Submarine> Barotrauma.EnemyAIController.UnattackableSubmarines = new HashSet<Submarine>()
get

The monster won't try to damage these submarines

Definition at line 203 of file EnemyAIController.cs.