Barotrauma Client Doc
Barotrauma.EnemyAIController Class Reference
Inheritance diagram for Barotrauma.EnemyAIController:
Barotrauma.AIController Barotrauma.AIController Barotrauma.ISteerable Barotrauma.ISteerable Barotrauma.ISteerable 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)
 
override void DebugDraw (SpriteBatch spriteBatch)
 
- 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

Constructor & Destructor Documentation

◆ EnemyAIController()

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

Member Function Documentation

◆ AimRangedAttack()

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

◆ CanPassThroughHole()

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

◆ DebugDraw()

override void Barotrauma.EnemyAIController.DebugDraw ( SpriteBatch  spriteBatch)
virtual

◆ Escape()

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

◆ GetTargetLimb()

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

◆ IgnoreTarget()

void Barotrauma.EnemyAIController.IgnoreTarget ( AITarget  target)

◆ IsBeingChasedBy()

bool Barotrauma.EnemyAIController.IsBeingChasedBy ( Character  c)

◆ IsLatchedTo()

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

◆ IsLatchedToSomeoneElse()

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

◆ IsTargetBeingChasedBy()

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

◆ LaunchTrigger()

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

◆ OnAttacked()

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

◆ OnStateChanged()

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

◆ OnTargetChanged()

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

◆ ReevaluateAttacks()

void Barotrauma.EnemyAIController.ReevaluateAttacks ( )

◆ 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 
)

◆ SteerThroughGap() [1/2]

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

◆ SteerThroughGap() [2/2]

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

◆ Update()

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

◆ UpdateTargets()

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

Member Data Documentation

◆ DisableEnemyAI

bool Barotrauma.EnemyAIController.DisableEnemyAI
static

◆ 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 BarotraumaShared/SharedSource/Characters/AI/EnemyAIController.cs.

Property Documentation

◆ ActiveAttack

Attack? Barotrauma.EnemyAIController.ActiveAttack
get

◆ 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 BarotraumaShared/SharedSource/Characters/AI/EnemyAIController.cs.

◆ AttackHumans

bool Barotrauma.EnemyAIController.AttackHumans
get

◆ AttackLimb

Limb?? Barotrauma.EnemyAIController.AttackLimb
get

◆ AttackRooms

bool Barotrauma.EnemyAIController.AttackRooms
get

◆ CanAttackDoors

bool Barotrauma.EnemyAIController.CanAttackDoors
get

◆ CanEnterSubmarine

override bool Barotrauma.EnemyAIController.CanEnterSubmarine
get

◆ CanFlip

override bool Barotrauma.EnemyAIController.CanFlip
get

◆ CombatStrength

float Barotrauma.EnemyAIController.CombatStrength
get

◆ LatchOntoAI

LatchOntoAI Barotrauma.EnemyAIController.LatchOntoAI
get

◆ PetBehavior

PetBehavior Barotrauma.EnemyAIController.PetBehavior
get

◆ PreviousState

AIState Barotrauma.EnemyAIController.PreviousState
get

◆ PriorityFearIncrement

float Barotrauma.EnemyAIController.PriorityFearIncrement
get

◆ Reverse

bool Barotrauma.EnemyAIController.Reverse
get

◆ SelectedTargetingParams

CharacterParams.TargetParams Barotrauma.EnemyAIController.SelectedTargetingParams
get

◆ SelectedTargetMemory

AITargetMemory Barotrauma.EnemyAIController.SelectedTargetMemory
get

◆ State

AIState Barotrauma.EnemyAIController.State
getset

◆ SwarmBehavior

SwarmBehavior Barotrauma.EnemyAIController.SwarmBehavior
get

◆ 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 BarotraumaShared/SharedSource/Characters/AI/EnemyAIController.cs.