Barotrauma Client Doc
Barotrauma.AICharacter Class Reference
Inheritance diagram for Barotrauma.AICharacter:
Barotrauma.Character Barotrauma.Character Barotrauma.Networking.IServerPositionSync Barotrauma.Networking.IClientSerializable Barotrauma.ISerializableEntity Barotrauma.IDamageable Barotrauma.Entity Barotrauma.Networking.IServerPositionSync Barotrauma.Networking.IClientSerializable Barotrauma.ISerializableEntity Barotrauma.IDamageable Barotrauma.Entity

Public Member Functions

 AICharacter (CharacterPrefab prefab, Vector2 position, string seed, CharacterInfo characterInfo=null, ushort id=Entity.NullEntityID, bool isNetworkPlayer=false, RagdollParams ragdoll=null, bool spawnInitialItems=true)
 
void SetAI (AIController aiController)
 
override void Update (float deltaTime, Camera cam)
 
override void DrawFront (Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Camera cam)
 
- Public Member Functions inherited from Barotrauma.Character
void SetOriginalTeam (CharacterTeamType newTeam)
 
bool HasTeamChange (string identifier)
 
bool TryAddNewTeamChange (string identifier, ActiveTeamChange newTeamChange)
 
bool TryRemoveTeamChange (string identifier)
 
void UpdateTeam ()
 
void ReleaseSecondaryItem ()
 
bool IsAnySelectedItem (Item item)
 Is the item either the primary or the secondary selected item? More...
 
bool HasSelectedAnotherSecondaryItem (Item item)
 
delegate void OnDeathHandler (Character character, CauseOfDeath causeOfDeath)
 
delegate void OnAttackedHandler (Character attacker, AttackResult attackResult)
 
void ReloadHead (int? headId=null, int hairIndex=-1, int beardIndex=-1, int moustacheIndex=-1, int faceAttachmentIndex=-1)
 
void LoadHeadAttachments ()
 
bool IsKeyHit (InputType inputType)
 
bool IsKeyDown (InputType inputType)
 
void SetInput (InputType inputType, bool hit, bool held)
 
void ClearInput (InputType inputType)
 
void ClearInputs ()
 
override string ToString ()
 
void GiveJobItems (WayPoint spawnPoint=null)
 
void GiveIdCardTags (WayPoint spawnPoint, bool createNetworkEvent=false)
 
float GetSkillLevel (string skillIdentifier)
 
float GetSkillLevel (Identifier skillIdentifier)
 
Vector2 GetTargetMovement ()
 
Vector2 ApplyMovementLimits (Vector2 targetMovement, float currentSpeed)
 
void StackSpeedMultiplier (float val)
 
void ResetSpeedMultiplier ()
 
void StackHealthMultiplier (float val)
 
float GetTemporarySpeedReduction ()
 Speed reduction from the current limb specific damage. Min 0, max 1. More...
 
float GetRightHandPenalty ()
 
float GetLeftHandPenalty ()
 
float GetLegPenalty (float startSum=0)
 
float ApplyTemporarySpeedLimits (float speed)
 
void Control (float deltaTime, Camera cam)
 
void SetAttackTarget (Limb attackLimb, IDamageable damageTarget, Vector2 attackPos)
 
bool CanSeeTarget (ISpatialEntity target, ISpatialEntity seeingEntity=null, bool seeThroughWindows=false, bool checkFacing=false)
 
bool IsFacing (Vector2 targetWorldPos)
 A simple check if the character Dir is towards the target or not. Uses the world coordinates. More...
 
bool HasItem (Item item, bool requireEquipped=false, InvSlotType? slotType=null)
 
bool HasEquippedItem (Item item, InvSlotType? slotType=null, Func< InvSlotType, bool > predicate=null)
 
bool HasEquippedItem (Identifier tagOrIdentifier, bool allowBroken=true, InvSlotType? slotType=null)
 
Item GetEquippedItem (Identifier? tagOrIdentifier=null, InvSlotType? slotType=null)
 
bool CanAccessInventory (Inventory inventory)
 
bool FindItem (ref int itemIndex, out Item targetItem, IEnumerable< Identifier > identifiers=null, bool ignoreBroken=true, IEnumerable< Item > ignoredItems=null, IEnumerable< Identifier > ignoredContainerIdentifiers=null, Func< Item, bool > customPredicate=null, Func< Item, float > customPriorityFunction=null, float maxItemDistance=10000, ISpatialEntity positionalReference=null)
 Finds the closest item seeking by identifiers or tags from the world. Ignores items that are outside or in another team's submarine or in a submarine that is not connected to this submarine. Also ignores non-interactable items and items that are taken by someone else. The method is run in steps for performance reasons. So you'll have to provide the reference to the itemIndex. Returns false while running and true when done. More...
 
bool IsItemTakenBySomeoneElse (Item item)
 
bool CanInteractWith (Character c, float maxDist=200.0f, bool checkVisibility=true, bool skipDistanceCheck=false)
 
bool CanInteractWith (Item item, bool checkLinked=true)
 
bool CanInteractWith (Item item, out float distanceToItem, bool checkLinked)
 
void SetCustomInteract (Action< Character, Character > onCustomInteract, LocalizedString hudText)
 Set an action that's invoked when another character interacts with this one. More...
 
void SelectCharacter (Character character)
 
void DeselectCharacter ()
 
void DoInteractionUpdate (float deltaTime, Vector2 mouseSimPos)
 
void AddAttacker (Character character, float damage)
 
void ForgiveAttacker (Character character)
 
float GetDamageDoneByAttacker (Character otherCharacter)
 
float GetDistanceToClosestLimb (Vector2 simPos)
 
void DespawnNow (bool createNetworkEvents=true)
 
bool CanHearCharacter (Character speaker)
 
void SetOrder (Order order, bool isNewOrder, bool speak=true, bool force=false)
 
Parameters
forceForce an order to be set for the character, bypassing hearing checks
More...
 
Order GetCurrentOrderWithTopPriority ()
 
Order GetCurrentOrder (Order order)
 
void DisableLine (Identifier identifier)
 
void DisableLine (string identifier)
 
void Speak (string message, ChatMessageType? messageType=null, float delay=0.0f, Identifier identifier=default, float minDurationBetweenSimilar=0.0f)
 
void ShowSpeechBubble (float duration, Color color)
 
void SetAllDamage (float damageAmount, float bleedingDamageAmount, float burnDamageAmount)
 
AttackResult AddDamage (Character attacker, Vector2 worldPosition, Attack attack, Vector2 impulseDirection, float deltaTime, bool playSound=true)
 
AttackResult ApplyAttack (Character attacker, Vector2 worldPosition, Attack attack, float deltaTime, Vector2 impulseDirection, bool playSound=false, Limb targetLimb=null, float penetration=0f)
 Apply the specified attack to this character. If the targetLimb is not specified, the limb closest to worldPosition will receive the damage. More...
 
void TrySeverLimbJoints (Limb targetLimb, float severLimbsProbability, float damage, bool allowBeheading, bool ignoreSeveranceProbabilityModifier=false, Character attacker=null)
 
AttackResult AddDamage (Vector2 worldPosition, IEnumerable< Affliction > afflictions, float stun, bool playSound, Vector2? attackImpulse=null, Character attacker=null, float damageMultiplier=1f)
 
AttackResult AddDamage (Vector2 worldPosition, IEnumerable< Affliction > afflictions, float stun, bool playSound, Vector2 attackImpulse, out Limb hitLimb, Character attacker=null, float damageMultiplier=1)
 
void RecordKill (Character target)
 
AttackResult DamageLimb (Vector2 worldPosition, Limb hitLimb, IEnumerable< Affliction > afflictions, float stun, bool playSound, Vector2 attackImpulse, Character attacker=null, float damageMultiplier=1, bool allowStacking=true, float penetration=0f, bool shouldImplode=false)
 
void TryAdjustAttackerSkill (Character attacker, AttackResult attackResult)
 
void TryAdjustHealerSkill (Character healer, float healthChange=0, Affliction affliction=null)
 
void SetStun (float newStun, bool allowStunDecrease=false, bool isNetworkMessage=false)
 
void ApplyStatusEffects (ActionType actionType, float deltaTime)
 
void BreakJoints ()
 
void Kill (CauseOfDeathType causeOfDeath, Affliction causeOfDeathAffliction, bool isNetworkMessage=false, bool log=true)
 
void Revive (bool removeAfflictions=true, bool createNetworkEvent=false)
 
override void Remove ()
 
void TeleportTo (Vector2 worldPos)
 
void SaveInventory ()
 Calls SaveInventory(Barotrauma.Inventory, XElement) using 'Inventory' and 'Info.InventoryData' More...
 
void SpawnInventoryItems (Inventory inventory, ContentXElement itemData)
 
IEnumerable< AttackContextGetAttackContexts ()
 
List< HullGetVisibleHulls ()
 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. Can be heavy if used every frame. More...
 
Vector2 GetRelativeSimPosition (ISpatialEntity target, Vector2? worldPos=null)
 
bool HasJob (string identifier)
 
bool HasJob (Identifier identifier)
 
void LoadTalents ()
 
bool GiveTalent (Identifier talentIdentifier, bool addingFirstTime=true)
 
bool GiveTalent (UInt32 talentIdentifier, bool addingFirstTime=true)
 
bool GiveTalent (TalentPrefab talentPrefab, bool addingFirstTime=true)
 
bool HasTalent (Identifier identifier)
 
bool HasUnlockedAllTalents ()
 
bool HasTalents ()
 
void CheckTalents (AbilityEffectType abilityEffectType, AbilityObject abilityObject)
 
void CheckTalents (AbilityEffectType abilityEffectType)
 
bool IsInSameRoomAs (Character character)
 Check if the character is in the same room Room and hull differ in that a room can consist of multiple linked hulls More...
 
bool HasRecipeForItem (Identifier recipeIdentifier)
 
bool HasStoreAccessForItem (ItemPrefab prefab)
 
void GiveMoney (int amount)
 Shows visual notification of money gained by the specific player. Useful for mid-mission monetary gains. More...
 
void SetMoney (int amount)
 
float GetStatValue (StatTypes statType, bool includeSaved=true)
 
void OnWearablesChanged ()
 
void ChangeStat (StatTypes statType, float value)
 
void AddAbilityFlag (AbilityFlags abilityFlag)
 
void RemoveAbilityFlag (AbilityFlags abilityFlag)
 
bool HasAbilityFlag (AbilityFlags abilityFlag)
 
float GetAbilityResistance (AfflictionPrefab affliction)
 
void ChangeAbilityResistance (TalentResistanceIdentifier identifier, float value)
 
void RemoveAbilityResistance (TalentResistanceIdentifier identifier)
 
bool IsFriendly (Character other)
 
bool IsOnFriendlyTeam (Character other)
 
bool IsOnFriendlyTeam (CharacterTeamType otherTeam)
 
bool IsSameSpeciesOrGroup (Character other)
 
void StopClimbing ()
 
void ResetNetState ()
 
void ControlLocalPlayer (float deltaTime, Camera cam, bool moveCam=true)
 Control the Character according to player input More...
 
void UpdateLocalCursor (Camera cam)
 
void EmulateInput (InputType input)
 
Item FindItemAtPosition (Vector2 simPosition, float aimAssistModifier=0.0f, Item[] ignoredItems=null)
 Finds the front (lowest depth) interactable item at a position. "Interactable" in this case means that the character can "reach" the item. More...
 
bool ShouldLockHud ()
 
virtual void AddToGUIUpdateList ()
 
void DoVisibilityCheck (Camera cam)
 
void Draw (SpriteBatch spriteBatch, Camera cam)
 
void DrawHUD (SpriteBatch spriteBatch, Camera cam, bool drawHealth=true)
 
void DrawGUIMessages (SpriteBatch spriteBatch, Camera cam)
 
virtual void DrawFront (SpriteBatch spriteBatch, Camera cam)
 
Color GetNameColor ()
 
void AddMessage (string rawText, Color color, bool playSound, Identifier identifier=default, int? value=null, float lifetime=3.0f)
 
HUDProgressBar UpdateHUDProgressBar (object linkedObject, Vector2 worldPosition, float progress, Color emptyColor, Color fullColor, string textTag="")
 Creates a progress bar that's "linked" to the specified object (or updates an existing one if there's one already linked to the object) The progress bar will automatically fade out after 1 sec if the method hasn't been called during that time More...
 
void PlaySound (CharacterSound.SoundType soundType, float soundIntervalFactor=1.0f, float maxInterval=0)
 
void AddActiveObjectiveEntity (Entity entity, Sprite sprite, Color? color=null)
 
void RemoveActiveObjectiveEntity (Entity entity)
 
CharacterSound GetSound (Func< CharacterSound, bool > predicate=null, bool random=false)
 Note that when a predicate is provided, the random option uses Linq.Where() extension method, which creates a new collection. More...
 
void ClientWriteInput (in SegmentTableWriter< ClientNetSegment > segmentTableWriter, IWriteMessage msg)
 
virtual void ClientEventWrite (IWriteMessage msg, NetEntityEvent.IData extraData=null)
 
void ClientReadPosition (IReadMessage msg, float sendingTime)
 
virtual void ClientEventRead (IReadMessage msg, float sendingTime)
 
- Public Member Functions inherited from Barotrauma.Entity
 Entity (Submarine submarine, ushort id)
 
void FreeID ()
 Removes the entity from the entity dictionary and frees up the ID it was using. More...
 

Properties

override AIController AIController [get]
 
- Properties inherited from Barotrauma.Character
bool Enabled [get, set]
 
bool DisabledByEvent [get, set]
 MonsterEvents disable monsters (which includes removing them from the character list, so they essentially "don't exist") until they're ready to spawn More...
 
bool IsRemotelyControlled [get]
 Is the character controlled remotely (either by another player, or a server-side AIController) More...
 
bool IsRemotePlayer [get, set]
 Is the character controlled by another human player (should always be false in single player) More...
 
bool IsLocalPlayer [get]
 
bool IsPlayer [get]
 
bool IsCommanding [get]
 Is the character player or does it have an active ship command manager (an AI controlled sub)? Bots in the player team are not treated as commanders. More...
 
bool IsBot [get]
 
bool IsEscorted [get, set]
 
Identifier JobIdentifier [get]
 
bool DoesBleed [get, set]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 
Key[] Keys [get]
 
HumanPrefab HumanPrefab [get, set]
 
Identifier????? Faction [get, set]
 
CharacterTeamType TeamID [get, set]
 
CharacterTeamType?? OriginalTeamID [get]
 
Wallet Wallet [get, set]
 
bool IsOnPlayerTeam [get]
 
bool IsOriginallyOnPlayerTeam [get]
 
bool IsFriendlyNPCTurnedHostile [get]
 
bool IsInstigator [get]
 
IEnumerable< AttackerLastAttackers [get]
 
Character LastAttacker [get]
 
Character LastOrderedCharacter [get]
 
Character SecondLastOrderedCharacter [get]
 
Dictionary< ItemPrefab, double > ItemSelectedDurations [get]
 
float InvisibleTimer [get, set]
 
Identifier SpeciesName [get]
 
Identifier Group [get]
 
bool IsHumanoid [get]
 
bool IsMachine [get]
 
bool IsHusk [get]
 
bool IsDisguisedAsHusk [get]
 
bool IsHuskInfected [get]
 
bool IsMale [get]
 
bool IsFemale [get]
 
string BloodDecalName [get]
 
bool CanSpeak [get, set]
 
bool NeedsAir [get, set]
 
bool NeedsWater [get, set]
 
bool NeedsOxygen [get]
 
float Noise [get, set]
 
float Visibility [get, set]
 
bool IsTraitor [get, set]
 
bool IsHuman [get]
 
List< OrderCurrentOrders [get]
 
bool IsDismissed [get]
 
Entity ViewTarget [get, set]
 
Vector2 AimRefPosition [get]
 
CharacterInfo Info [get, set]
 
Identifier VariantOf [get]
 
string? Name [get]
 
string? DisplayName [get]
 
string?? LogName [get]
 
bool? HideFace [get, set]
 
string ConfigPath [get]
 
float Mass [get]
 
CharacterInventory Inventory [get]
 
bool DisableInteract [get, set]
 Prevents the character from interacting with items or characters More...
 
bool DisableFocusingOnEntities [get, set]
 Prevents the character from highlighting items or characters with the cursor, meaning it can't interact with anything but the things it has currently selected/equipped More...
 
LocalizedString CustomInteractHUDText [get]
 
bool AllowCustomInteract [get]
 
bool? LockHands [get, set]
 
bool AllowInput [get]
 
bool CanMove [get]
 
bool CanInteract [get]
 
bool CanEat [get]
 
Vector2 CursorPosition [get, set]
 
Vector2 SmoothedCursorPosition [get]
 
Vector2? CursorWorldPosition [get]
 
Character FocusedCharacter [get, set]
 
Character SelectedCharacter [get, set]
 
Character SelectedBy [get, set]
 
IEnumerable< Item >?? HeldItems [get]
 Items the character has in their hand slots. Doesn't return nulls and only returns items held in both hands once. More...
 
float LowPassMultiplier [get, set]
 
bool? ObstructVision [get, set]
 
float PressureProtection [get, set]
 
bool InPressure [get]
 Can be used by status effects to check whether the characters is in a high-pressure environment More...
 
AnimController.Animation??? Anim [get]
 Can be used by status effects More...
 
bool IsIncapacitated [get]
 
bool IsUnconscious [get]
 
bool IsArrested [get]
 
bool IsPet [get]
 
float Oxygen [get, set]
 
float OxygenAvailable [get, set]
 
float??? HullOxygenPercentage [get]
 
bool UseHullOxygen = true [get, set]
 
float? Stun [get, set]
 
CharacterHealth CharacterHealth [get]
 
float Vitality [get]
 
float Health [get]
 
float HealthPercentage [get]
 
float MaxVitality [get]
 
float MaxHealth [get]
 
bool WasFullHealth [get]
 Was the character in full health at the beginning of the frame? More...
 
AIState AIState [get]
 
bool IsLatched [get]
 
float EmpVulnerability [get]
 
float PoisonVulnerability [get]
 
bool IsFlipped [get]
 
float Bloodloss [get, set]
 
float Bleeding [get]
 
float SpeechImpediment [get, set]
 
float PressureTimer [get]
 
float DisableImpactDamageTimer [get, set]
 
bool IgnoreMeleeWeapons [get, set]
 
float???? CurrentSpeed [get]
 Current speed of the character's collider. Can be used by status effects to check if the character is moving. More...
 
Item????????? SelectedItem [get, set]
 The primary selected item. It can be any device that character interacts with. This excludes items like ladders and chairs which are assigned to SelectedSecondaryItem. More...
 
Item SelectedSecondaryItem [get, set]
 The secondary selected item. It's an item other than a device (see SelectedItem), e.g. a ladder or a chair. More...
 
bool HasSelectedAnyItem [get]
 Has the characters selected a primary or a secondary item? More...
 
Item FocusedItem [get, set]
 
Item PickingItem [get, set]
 
virtual AIController AIController [get]
 
bool IsDead [get, set]
 
bool EnableDespawn = true [get, set]
 
CauseOfDeath CauseOfDeath [get]
 
bool CanBeSelected [get]
 
bool CanBeDragged [get, set]
 
bool CanInventoryBeAccessed [get, set]
 
bool CanAim [get]
 
bool InWater [get]
 
bool IsLowInOxygen [get]
 
bool Unkillable [get, set]
 
bool UseHealthWindow [get, set]
 Is the health interface available on this character? Can be used by status effects More...
 
override Vector2? SimPosition [get]
 
override Vector2 Position [get]
 
override Vector2 DrawPosition [get]
 
bool IsInFriendlySub [get]
 
bool IsInPlayerSub [get]
 
float AITurretPriority [get]
 
Vector2? OverrideMovement [get, set]
 
bool ForceRun [get, set]
 
bool IsClimbing [get]
 
bool CanRun [get]
 
float SpeedMultiplier = 1 [get]
 Can be used to modify the character's speed via StatusEffects More...
 
float PropulsionSpeedMultiplier [get, set]
 Can be used to modify the speed at which Propulsion ItemComponents move the character via StatusEffects (e.g. heavy suit can slow down underwater scooters) More...
 
float HealthMultiplier = 1 [get]
 Can be used to modify the character's health via StatusEffects More...
 
float HumanPrefabHealthMultiplier = 1 [get]
 Health multiplier of the human prefab this character is an instance of (if any) More...
 
bool IsKnockedDown [get]
 Is the character knocked down regardless whether the technical state is dead, unconcious, paralyzed, or stunned. With stunning, the parameter uses an one second delay before the character is treated as knocked down. The purpose of this is to ignore minor stunning. If you don't want to to ignore any stun, use the Stun property. More...
 
bool IsCaptain [get]
 
bool IsEngineer [get]
 
bool IsMechanic [get]
 
bool IsMedic [get]
 
bool IsSecurity [get]
 
bool IsAssistant [get]
 
bool IsWatchman [get]
 
bool IsVip [get]
 
bool IsPrisoner [get]
 
bool IsKiller [get]
 
Color? UniqueNameColor = null [get, set]
 
bool IsProtectedFromPressure [get]
 Is the character currently protected from the pressure by immunity/ability or a status effect (e.g. from a diving suit). More...
 
bool IsImmuneToPressure [get]
 
IReadOnlyCollection< CharacterTalentCharacterTalents [get]
 
float? HealthUpdateInterval [get, set]
 
List< CharacterStateInfoMemState [get]
 
List< CharacterStateInfoMemLocalState [get]
 
bool IsVisible = true [get]
 Is the character currently visible on the camera. Refresh the value by calling DoVisibilityCheck. More...
 
static CharacterControlled [get, set]
 
Dictionary< object, HUDProgressBarHUDProgressBars [get]
 
float BlurStrength [get, set]
 
float DistortStrength [get, set]
 
float RadialDistortStrength [get, set]
 
float ChromaticAberrationStrength [get, set]
 
Color GrainColor [get, set]
 
float GrainStrength [get, set]
 
float???????? CollapseEffectStrength [get, set]
 Can be used by status effects More...
 
float????? CameraShake [get, set]
 Can be used to set camera shake from status effects More...
 
IEnumerable< ParticleEmitterBloodEmitters [get]
 
IEnumerable< ParticleEmitterDamageEmitters [get]
 
IEnumerable< ParticleEmitterGibEmitters [get]
 
static bool IsMouseOnUI [get]
 
IEnumerable< ObjectiveEntityActiveObjectiveEntities [get]
 
- Properties inherited from Barotrauma.Entity
static int EntityCount [get]
 
bool Removed [get]
 
bool IdFreed [get]
 
virtual Vector2 SimPosition [get]
 
virtual Vector2 Position [get]
 
virtual Vector2 WorldPosition [get]
 
virtual Vector2 DrawPosition [get]
 
Submarine Submarine [get, set]
 
AITarget AiTarget [get]
 
bool InDetectable [get, set]
 
double SpawnTime [get]
 
string ErrorLine [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 
- Properties inherited from Barotrauma.IDamageable
Vector2 SimPosition [get]
 
Vector2 WorldPosition [get]
 
float Health [get]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Additional Inherited Members

- Public Types inherited from Barotrauma.Character
enum class  EventType {
  InventoryState = 0 , Control = 1 , Status = 2 , Treatment = 3 ,
  SetAttackTarget = 4 , ExecuteAttack = 5 , AssignCampaignInteraction = 6 , ObjectiveManagerState = 7 ,
  TeamChange = 8 , AddToCrew = 9 , UpdateExperience = 10 , UpdateTalents = 11 ,
  UpdateSkills = 12 , UpdateMoney = 13 , UpdatePermanentStats = 14 , RemoveFromCrew = 15 ,
  MinValue = 0 , MaxValue = 15
}
 
- Static Public Member Functions inherited from Barotrauma.Character
static Character Create (CharacterInfo characterInfo, Vector2 position, string seed, ushort id=Entity.NullEntityID, bool isRemotePlayer=false, bool hasAi=true, RagdollParams ragdoll=null, bool spawnInitialItems=true)
 Create a new character More...
 
static Character Create (string speciesName, Vector2 position, string seed, CharacterInfo characterInfo=null, ushort id=Entity.NullEntityID, bool isRemotePlayer=false, bool hasAi=true, bool createNetworkEvent=true, RagdollParams ragdoll=null, bool throwErrorIfNotFound=true, bool spawnInitialItems=true)
 Create a new character More...
 
static Character Create (Identifier speciesName, Vector2 position, string seed, CharacterInfo characterInfo=null, ushort id=Entity.NullEntityID, bool isRemotePlayer=false, bool hasAi=true, bool createNetworkEvent=true, RagdollParams ragdoll=null, bool throwErrorIfNotFound=true, bool spawnInitialItems=true)
 
static Character Create (CharacterPrefab prefab, Vector2 position, string seed, CharacterInfo characterInfo=null, ushort id=Entity.NullEntityID, bool isRemotePlayer=false, bool hasAi=true, bool createNetworkEvent=true, RagdollParams ragdoll=null, bool spawnInitialItems=true)
 
static bool IsTargetVisible (ISpatialEntity target, ISpatialEntity seeingEntity, bool seeThroughWindows=false, bool checkFacing=false)
 
static void UpdateAnimAll (float deltaTime)
 
static void UpdateAll (float deltaTime, Camera cam)
 
static void RemoveByPrefab (CharacterPrefab prefab)
 
static void SaveInventory (Inventory inventory, XElement parentElement)
 
static IEnumerable< CharacterGetFriendlyCrew (Character character)
 
static bool IsFriendly (Character me, Character other)
 
static bool IsOnFriendlyTeam (CharacterTeamType myTeam, CharacterTeamType otherTeam)
 
static bool IsOnFriendlyTeam (Character me, Character other)
 
static bool IsSameSpeciesOrGroup (Character me, Character other)
 
static void AddAllToGUIUpdateList ()
 
static Character ReadSpawnData (IReadMessage inc)
 
- Static Public Member Functions inherited from Barotrauma.Entity
static IReadOnlyCollection< EntityGetEntities ()
 
static int FindFreeIdBlock (int minBlockSize)
 Finds a contiguous block of free IDs of at least the given size More...
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID More...
 
static void RemoveAll ()
 
static void DumpIds (int count, string filename)
 
- Public Attributes inherited from Barotrauma.Character
Hull PreviousHull = null
 
Hull CurrentHull = null
 
readonly Dictionary< Identifier, SerializablePropertyProperties
 
readonly HashSet< LatchOntoAILatchers = new HashSet<LatchOntoAI>()
 
readonly HashSet< ProjectileAttachedProjectiles = new HashSet<Projectile>()
 
CombatAction CombatAction
 
readonly AnimController AnimController
 
readonly string Seed
 
Entity LastDamageSource
 
AttackResult LastDamage
 
readonly CharacterPrefab Prefab
 
readonly CharacterParams Params
 
LocalizedString TraitorCurrentObjective = ""
 
ConversationAction ActiveConversation
 
bool RequireConsciousnessForCustomInteract = true
 
float KnockbackCooldownTimer
 
bool IsRagdolled
 
bool IsForceRagdolled
 
bool dontFollowCursor
 
bool DisableHealthWindow
 
bool GodMode = false
 Godmoded characters cannot receive any afflictions whatsoever More...
 
CampaignMode.InteractionType CampaignInteractionType
 
Identifier MerchantIdentifier
 
HashSet< IdentifierMarkedAsLooted = new()
 
OnDeathHandler OnDeath
 
OnAttackedHandler OnAttacked
 
UInt16 LastNetworkUpdateID = 0
 
UInt16 LastProcessedID
 ID of the last inputs the server has processed More...
 
float healthUpdateTimer
 
bool isSynced = false
 
bool ExternalHighlight
 
- Public Attributes inherited from Barotrauma.Entity
readonly ushort ID
 Unique, but non-persistent identifier. Stays the same if the entities are created in the exactly same order, but doesn't persist e.g. between the rounds. More...
 
readonly string CreationStackTrace
 
readonly UInt64 CreationIndex
 
- Static Public Attributes inherited from Barotrauma.Character
static readonly List< CharacterCharacterList = new List<Character>()
 
static int CharacterUpdateInterval = 1
 
const float MaxHighlightDistance = 150.0f
 
const float MaxDragDistance = 200.0f
 
const float KnockbackCooldown = 5.0f
 
static bool DisableControls
 
static bool DebugDrawInteract
 
- Static Public Attributes inherited from Barotrauma.Entity
const ushort NullEntityID = 0
 
const ushort EntitySpawnerID = ushort.MaxValue
 
const ushort RespawnManagerID = ushort.MaxValue - 1
 
const ushort DummyID = ushort.MaxValue - 2
 
const ushort ReservedIDStart = ushort.MaxValue - 3
 
const ushort MaxEntityCount = ushort.MaxValue - 4
 
static EntitySpawner Spawner
 
- Protected Member Functions inherited from Barotrauma.Character
 Character (CharacterPrefab prefab, Vector2 position, string seed, CharacterInfo characterInfo=null, ushort id=Entity.NullEntityID, bool isRemotePlayer=false, RagdollParams ragdollParams=null, bool spawnInitialItems=true)
 
float GetDistanceToClosestPlayer ()
 How far the character is from the closest human player (including spectators) More...
 
float GetDistanceSqrToClosestPlayer ()
 How far the character is from the closest human player (including spectators) More...
 
- Protected Member Functions inherited from Barotrauma.Entity
virtual ushort DetermineID (ushort id, Submarine submarine)
 
- Protected Attributes inherited from Barotrauma.Character
Key[] keys
 
readonly Dictionary< string, ActiveTeamChangeactiveTeamChanges = new Dictionary<string, ActiveTeamChange>()
 
ActiveTeamChange currentTeamChange
 
float oxygenAvailable
 
Item focusedItem
 
float soundTimer
 
float hudInfoTimer = 1.0f
 
bool hudInfoVisible = false
 
float lastRecvPositionUpdateTime
 
- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 

Detailed Description

Constructor & Destructor Documentation

◆ AICharacter()

Barotrauma.AICharacter.AICharacter ( CharacterPrefab  prefab,
Vector2  position,
string  seed,
CharacterInfo  characterInfo = null,
ushort  id = Entity.NullEntityID,
bool  isNetworkPlayer = false,
RagdollParams  ragdoll = null,
bool  spawnInitialItems = true 
)

Member Function Documentation

◆ DrawFront()

override void Barotrauma.AICharacter.DrawFront ( Microsoft.Xna.Framework.Graphics.SpriteBatch  spriteBatch,
Camera  cam 
)

◆ SetAI()

void Barotrauma.AICharacter.SetAI ( AIController  aiController)

◆ Update()

override void Barotrauma.AICharacter.Update ( float  deltaTime,
Camera  cam 
)
virtual

Reimplemented from Barotrauma.Character.

Definition at line 36 of file BarotraumaShared/SharedSource/Characters/AICharacter.cs.

Property Documentation

◆ AIController

override AIController Barotrauma.AICharacter.AIController
get