Barotrauma Server
Loading...
Searching...
No Matches
Barotrauma.Character Class Reference
Inheritance diagram for Barotrauma.Character:
Barotrauma.Entity Barotrauma.IDamageable Barotrauma.ISerializableEntity Barotrauma.Networking.IClientSerializable Barotrauma.Networking.IServerPositionSync Barotrauma.ISpatialEntity Barotrauma.Networking.INetSerializable Barotrauma.Networking.IServerSerializable Barotrauma.Networking.INetSerializable Barotrauma.AICharacter

Classes

struct  AddToCrewEventData
 
struct  AssignCampaignInteractionEventData
 
class  Attacker
 
struct  CharacterStatusEventData
 
struct  ControlEventData
 
struct  ExecuteAttackEventData
 
struct  InventoryStateEventData
 
struct  LatchedOntoTargetEventData
 
struct  ObjectiveManagerStateEventData
 
struct  RemoveFromCrewEventData
 
struct  SetAttackTargetEventData
 
struct  TreatmentEventData
 
struct  UpdateExperienceEventData
 
struct  UpdatePermanentStatsEventData
 
struct  UpdateSkillsEventData
 
struct  UpdateTalentsEventData
 

Public Types

enum  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 ,
  LatchOntoTarget = 16 , MinValue = 0 , MaxValue = 16
}
 

Public Member Functions

void SetOriginalTeam (CharacterTeamType newTeam)
 
bool HasTeamChange (string identifier)
 
bool TryAddNewTeamChange (string identifier, ActiveTeamChange newTeamChange)
 
bool TryRemoveTeamChange (string identifier)
 
void UpdateTeam ()
 
Identifier GetBaseCharacterSpeciesName ()
 
bool IsDualWieldingRangedWeapons ()
 
void ReleaseSecondaryItem ()
 
bool IsAnySelectedItem (Item item)
 Is the item either the primary or the secondary selected item?
 
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 ()
 
bool CanRunWhileDragging ()
 
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.
 
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.
 
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=default, InvSlotType? slotType=null)
 
bool CanAccessInventory (Inventory inventory, CharacterInventory.AccessLevel accessLevel=CharacterInventory.AccessLevel.Limited)
 
bool CanBeHealedBy (Character character, bool checkFriendlyTeam=true)
 
bool CanBeDraggedBy (Character character)
 
bool IsInventoryAccessibleTo (Character character, CharacterInventory.AccessLevel accessLevel=CharacterInventory.AccessLevel.Limited)
 Is the inventory accessible to the character? Doesn't check if the character can actually interact with it (distance checks etc).
 
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.
 
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.
 
void SelectCharacter (Character character)
 
void DeselectCharacter ()
 
void DoInteractionUpdate (float deltaTime, Vector2 mouseSimPos)
 
virtual void Update (float deltaTime, Camera cam)
 
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

 
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 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.
 
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'.
 
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.
 
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.
 
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.
 
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 (Identifier resistanceId)
 
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 SetOwnerClient (Client client)
 
bool IsClientOwner (Client client)
 
float GetPositionUpdateInterval (Client recipient)
 
void ServerReadInput (IReadMessage msg, Client c)
 
virtual void ServerEventRead (IReadMessage msg, Client c)
 
void ServerWritePosition (ReadWriteMessage tempBuffer, Client c)
 
virtual void ServerEventWrite (IWriteMessage msg, Client c, NetEntityEvent.IData extraData=null)
 
void WriteSpawnData (IWriteMessage msg, UInt16 entityId, bool restrictMessageSize)
 
- 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.
 
- Public Member Functions inherited from Barotrauma.IDamageable

Static Public Member Functions

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.
 
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.
 
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 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.
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID.
 
static void RemoveAll ()
 
static void DumpIds (int count, string filename)
 

Public Attributes

Hull PreviousHull = null
 
Hull CurrentHull = null
 
readonly Dictionary< Identifier, SerializablePropertyProperties
 
readonly HashSet< LatchOntoAILatchers = new HashSet<LatchOntoAI>()
 
readonly HashSet< ProjectileAttachedProjectiles = new HashSet<Projectile>()
 
bool IsCriminal
 Do the outpost security officers treat the character as a criminal? Triggers when the character has either committed a major crime or resisted being arrested (or fled). Only affects the reactions of friendly NPCs in the outposts. The NPCs still don't react immediately to "criminals", but take this into account when the character next time does something wrong. The consequences are that the guards will not hold fire and will not give more warnings before attacking.
 
bool IsHostileEscortee
 Set true only, if the character is turned hostile from an escort mission (See EscortMission).
 
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.
 
CampaignMode.InteractionType CampaignInteractionType
 
Identifier MerchantIdentifier
 
HashSet< Identifier > MarkedAsLooted = new()
 
OnDeathHandler OnDeath
 
OnAttackedHandler OnAttacked
 
UInt16 LastNetworkUpdateID = 0
 
UInt16 LastProcessedID
 ID of the last inputs the server has processed.
 
float healthUpdateTimer
 
bool isSynced = false
 
bool ClientDisconnected
 
float KillDisconnectedTimer
 
bool HealthUpdatePending
 
- 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.
 
readonly string CreationStackTrace
 
readonly UInt64 CreationIndex
 

Static Public Attributes

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

 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)
 
float GetDistanceSqrToClosestPlayer ()
 How far the character is from the closest human player (including spectators)
 
- Protected Member Functions inherited from Barotrauma.Entity
virtual ushort DetermineID (ushort id, Submarine submarine)
 

Protected Attributes

Key[] keys
 
readonly Dictionary< string, ActiveTeamChangeactiveTeamChanges = new Dictionary<string, ActiveTeamChange>()
 
ActiveTeamChange currentTeamChange
 
float oxygenAvailable
 
Item focusedItem
 
- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 

Properties

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.
 
bool IsRemotelyControlled [get]
 Is the character controlled remotely (either by another player, or a server-side AIController)
 
bool IsRemotePlayer [get, set]
 Is the character controlled by another human player (should always be false in single player)
 
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.
 
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]
 
float MaxPerceptionDistance [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.
 
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.
 
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< ItemHeldItems [get]
 Items the character has in their hand slots. Doesn't return nulls and only returns items held in both hands once.
 
float LowPassMultiplier [get, set]
 
float ObstructVisionAmount [get, set]
 
bool ObstructVision [get, set]
 Provided for backwards compatibility: use ObstructVisionAmount instead.
 
float PressureProtection [get, set]
 
bool InPressure [get]
 Can be used by status effects to check whether the characters is in a high-pressure environment.
 
AnimController.Animation Anim [get]
 Can be used by status effects.
 
bool IsIncapacitated [get]
 
bool IsUnconscious [get]
 
bool IsHandcuffed [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?
 
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 TextChatVolume [get, set]
 How "loud" the player is when they use text chat. When the user speaks in text chat this gets set to 1 and then slowly decreases back to 0 over 5 seconds.
 
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.
 
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.
 
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.
 
bool HasSelectedAnyItem [get]
 Has the characters selected a primary or a secondary item?
 
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 IsDraggable [get]
 
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.
 
override Vector2 SimPosition [get]
 
override Vector2 Position [get]
 
override Vector2 DrawPosition [get]
 
bool IsInFriendlySub [get]
 
bool IsInPlayerSub [get]
 
float AITurretPriority [get]
 
Vector2OverrideMovement [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.
 
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)
 
float HealthMultiplier = 1 [get]
 Can be used to modify the character's health via StatusEffects.
 
float HumanPrefabHealthMultiplier = 1 [get]
 Health multiplier of the human prefab this character is an instance of (if any)
 
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.
 
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).
 
bool IsImmuneToPressure [get]
 
IReadOnlyCollection< CharacterTalentCharacterTalents [get]
 
float HealthUpdateInterval [get, set]
 
List< CharacterStateInfoMemState [get]
 
List< CharacterStateInfoMemLocalState [get]
 
static Character Controlled [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]
 Indetectable characters can't be spotted by AIs and aren't visible on the sonar or health scanner.
 
double SpawnTime [get]
 
string ErrorLine [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
- Properties inherited from Barotrauma.IDamageable
Vector2 WorldPosition [get]
 
- Properties inherited from Barotrauma.ISerializableEntity

Member Enumeration Documentation

◆ EventType

Enumerator
InventoryState 
Control 
Status 
Treatment 
SetAttackTarget 
ExecuteAttack 
AssignCampaignInteraction 
ObjectiveManagerState 
TeamChange 
AddToCrew 
UpdateExperience 
UpdateTalents 
UpdateSkills 
UpdateMoney 
UpdatePermanentStats 
RemoveFromCrew 
LatchOntoTarget 
MinValue 
MaxValue 

Constructor & Destructor Documentation

◆ Character()

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

Member Function Documentation

◆ AddAbilityFlag()

void Barotrauma.Character.AddAbilityFlag ( AbilityFlags abilityFlag)

◆ AddAttacker()

void Barotrauma.Character.AddAttacker ( Character character,
float damage )

◆ AddDamage() [1/3]

AttackResult Barotrauma.Character.AddDamage ( Character attacker,
Vector2 worldPosition,
Attack attack,
Vector2 impulseDirection,
float deltaTime,
bool playSound = true )

◆ AddDamage() [2/3]

AttackResult Barotrauma.Character.AddDamage ( Vector2 worldPosition,
IEnumerable< Affliction > afflictions,
float stun,
bool playSound,
Vector2 attackImpulse,
out Limb hitLimb,
Character attacker = null,
float damageMultiplier = 1 )

◆ AddDamage() [3/3]

AttackResult Barotrauma.Character.AddDamage ( Vector2 worldPosition,
IEnumerable< Affliction > afflictions,
float stun,
bool playSound,
Vector2? attackImpulse = null,
Character attacker = null,
float damageMultiplier = 1f )

◆ ApplyAttack()

AttackResult Barotrauma.Character.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.

◆ ApplyMovementLimits()

Vector2 Barotrauma.Character.ApplyMovementLimits ( Vector2 targetMovement,
float currentSpeed )

◆ ApplyStatusEffects()

void Barotrauma.Character.ApplyStatusEffects ( ActionType actionType,
float deltaTime )

◆ ApplyTemporarySpeedLimits()

float Barotrauma.Character.ApplyTemporarySpeedLimits ( float speed)

◆ BreakJoints()

void Barotrauma.Character.BreakJoints ( )

◆ CanAccessInventory()

bool Barotrauma.Character.CanAccessInventory ( Inventory inventory,
CharacterInventory.AccessLevel accessLevel = CharacterInventory::AccessLevel::Limited )

◆ CanBeDraggedBy()

bool Barotrauma.Character.CanBeDraggedBy ( Character character)

◆ CanBeHealedBy()

bool Barotrauma.Character.CanBeHealedBy ( Character character,
bool checkFriendlyTeam = true )

◆ CanHearCharacter()

bool Barotrauma.Character.CanHearCharacter ( Character speaker)

◆ CanInteractWith() [1/3]

bool Barotrauma.Character.CanInteractWith ( Character c,
float maxDist = 200::0f,
bool checkVisibility = true,
bool skipDistanceCheck = false )

◆ CanInteractWith() [2/3]

bool Barotrauma.Character.CanInteractWith ( Item item,
bool checkLinked = true )

◆ CanInteractWith() [3/3]

bool Barotrauma.Character.CanInteractWith ( Item item,
out float distanceToItem,
bool checkLinked )

◆ CanRunWhileDragging()

bool Barotrauma.Character.CanRunWhileDragging ( )

◆ CanSeeTarget()

bool Barotrauma.Character.CanSeeTarget ( ISpatialEntity target,
ISpatialEntity seeingEntity = null,
bool seeThroughWindows = false,
bool checkFacing = false )

◆ ChangeAbilityResistance()

void Barotrauma.Character.ChangeAbilityResistance ( TalentResistanceIdentifier identifier,
float value )

◆ ChangeStat()

void Barotrauma.Character.ChangeStat ( StatTypes statType,
float value )

◆ CheckTalents() [1/2]

void Barotrauma.Character.CheckTalents ( AbilityEffectType abilityEffectType)

◆ CheckTalents() [2/2]

void Barotrauma.Character.CheckTalents ( AbilityEffectType abilityEffectType,
AbilityObject abilityObject )

◆ ClearInput()

void Barotrauma.Character.ClearInput ( InputType inputType)

◆ ClearInputs()

void Barotrauma.Character.ClearInputs ( )

◆ Control()

void Barotrauma.Character.Control ( float deltaTime,
Camera cam )

◆ Create() [1/4]

static Character Barotrauma.Character.Create ( CharacterInfo characterInfo,
Vector2 position,
string seed,
ushort id = Entity::NullEntityID,
bool isRemotePlayer = false,
bool hasAi = true,
RagdollParams ragdoll = null,
bool spawnInitialItems = true )
static

Create a new character.

Parameters
characterInfoThe name, gender, config file, etc of the character.
positionPosition in display units.
seedRNG seed to use if the character config has randomizable parameters.
isRemotePlayerIs the character controlled by a remote player.
hasAiIs the character controlled by AI.
ragdollRagdoll configuration file. If null, will select the default.

◆ Create() [2/4]

static Character Barotrauma.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

◆ Create() [3/4]

static Character Barotrauma.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

◆ Create() [4/4]

static Character Barotrauma.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 )
static

Create a new character.

Parameters
speciesNameName of the species (or the path to the config file)
positionPosition in display units.
seedRNG seed to use if the character config has randomizable parameters.
characterInfoThe name, gender, etc of the character. Only used for humans, and if the parameter is not given, a random CharacterInfo is generated.
idID to assign to the character. If set to 0, automatically find an available ID.
isRemotePlayerIs the character controlled by a remote player.
hasAiIs the character controlled by AI.
createNetworkEventShould clients receive a network event about the creation of this character?
ragdollRagdoll configuration file. If null, will select the default.

◆ DamageLimb()

AttackResult Barotrauma.Character.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 )

◆ DeselectCharacter()

void Barotrauma.Character.DeselectCharacter ( )

◆ DespawnNow()

void Barotrauma.Character.DespawnNow ( bool createNetworkEvents = true)

◆ DisableLine() [1/2]

void Barotrauma.Character.DisableLine ( Identifier identifier)

◆ DisableLine() [2/2]

void Barotrauma.Character.DisableLine ( string identifier)

◆ DoInteractionUpdate()

void Barotrauma.Character.DoInteractionUpdate ( float deltaTime,
Vector2 mouseSimPos )

◆ FindItem()

bool Barotrauma.Character.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.

◆ ForgiveAttacker()

void Barotrauma.Character.ForgiveAttacker ( Character character)

◆ GetAbilityResistance() [1/2]

float Barotrauma.Character.GetAbilityResistance ( AfflictionPrefab affliction)

◆ GetAbilityResistance() [2/2]

float Barotrauma.Character.GetAbilityResistance ( Identifier resistanceId)

◆ GetAttackContexts()

IEnumerable< AttackContext > Barotrauma.Character.GetAttackContexts ( )

◆ GetBaseCharacterSpeciesName()

Identifier Barotrauma.Character.GetBaseCharacterSpeciesName ( )

◆ GetCurrentOrder()

Order Barotrauma.Character.GetCurrentOrder ( Order order)

◆ GetCurrentOrderWithTopPriority()

Order Barotrauma.Character.GetCurrentOrderWithTopPriority ( )

◆ GetDamageDoneByAttacker()

float Barotrauma.Character.GetDamageDoneByAttacker ( Character otherCharacter)

◆ GetDistanceSqrToClosestPlayer()

float Barotrauma.Character.GetDistanceSqrToClosestPlayer ( )
protected

How far the character is from the closest human player (including spectators)

◆ GetDistanceToClosestLimb()

float Barotrauma.Character.GetDistanceToClosestLimb ( Vector2 simPos)

◆ GetDistanceToClosestPlayer()

float Barotrauma.Character.GetDistanceToClosestPlayer ( )
protected

How far the character is from the closest human player (including spectators)

◆ GetEquippedItem()

Item Barotrauma.Character.GetEquippedItem ( Identifier tagOrIdentifier = default,
InvSlotType? slotType = null )

◆ GetFriendlyCrew()

static IEnumerable< Character > Barotrauma.Character.GetFriendlyCrew ( Character character)
static

◆ GetLeftHandPenalty()

float Barotrauma.Character.GetLeftHandPenalty ( )

◆ GetLegPenalty()

float Barotrauma.Character.GetLegPenalty ( float startSum = 0)

◆ GetPositionUpdateInterval()

float Barotrauma.Character.GetPositionUpdateInterval ( Client recipient)

◆ GetRelativeSimPosition()

Vector2 Barotrauma.Character.GetRelativeSimPosition ( ISpatialEntity target,
Vector2? worldPos = null )

◆ GetRightHandPenalty()

float Barotrauma.Character.GetRightHandPenalty ( )

◆ GetSkillLevel() [1/2]

float Barotrauma.Character.GetSkillLevel ( Identifier skillIdentifier)

◆ GetSkillLevel() [2/2]

float Barotrauma.Character.GetSkillLevel ( string skillIdentifier)

◆ GetStatValue()

float Barotrauma.Character.GetStatValue ( StatTypes statType,
bool includeSaved = true )

◆ GetTargetMovement()

Vector2 Barotrauma.Character.GetTargetMovement ( )

◆ GetTemporarySpeedReduction()

float Barotrauma.Character.GetTemporarySpeedReduction ( )

Speed reduction from the current limb specific damage. Min 0, max 1.

◆ GetVisibleHulls()

List< Hull > Barotrauma.Character.GetVisibleHulls ( )

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.

◆ GiveIdCardTags()

void Barotrauma.Character.GiveIdCardTags ( WayPoint spawnPoint,
bool createNetworkEvent = false )

◆ GiveJobItems()

void Barotrauma.Character.GiveJobItems ( WayPoint spawnPoint = null)

◆ GiveMoney()

void Barotrauma.Character.GiveMoney ( int amount)

Shows visual notification of money gained by the specific player. Useful for mid-mission monetary gains.

◆ GiveTalent() [1/3]

bool Barotrauma.Character.GiveTalent ( Identifier talentIdentifier,
bool addingFirstTime = true )

◆ GiveTalent() [2/3]

bool Barotrauma.Character.GiveTalent ( TalentPrefab talentPrefab,
bool addingFirstTime = true )

◆ GiveTalent() [3/3]

bool Barotrauma.Character.GiveTalent ( UInt32 talentIdentifier,
bool addingFirstTime = true )

◆ HasAbilityFlag()

bool Barotrauma.Character.HasAbilityFlag ( AbilityFlags abilityFlag)

◆ HasEquippedItem() [1/2]

bool Barotrauma.Character.HasEquippedItem ( Identifier tagOrIdentifier,
bool allowBroken = true,
InvSlotType? slotType = null )

◆ HasEquippedItem() [2/2]

bool Barotrauma.Character.HasEquippedItem ( Item item,
InvSlotType? slotType = null,
Func< InvSlotType, bool > predicate = null )

◆ HasItem()

bool Barotrauma.Character.HasItem ( Item item,
bool requireEquipped = false,
InvSlotType? slotType = null )

◆ HasJob() [1/2]

bool Barotrauma.Character.HasJob ( Identifier identifier)

◆ HasJob() [2/2]

bool Barotrauma.Character.HasJob ( string identifier)

◆ HasRecipeForItem()

bool Barotrauma.Character.HasRecipeForItem ( Identifier recipeIdentifier)

◆ HasSelectedAnotherSecondaryItem()

bool Barotrauma.Character.HasSelectedAnotherSecondaryItem ( Item item)

◆ HasStoreAccessForItem()

bool Barotrauma.Character.HasStoreAccessForItem ( ItemPrefab prefab)

◆ HasTalent()

bool Barotrauma.Character.HasTalent ( Identifier identifier)

◆ HasTalents()

bool Barotrauma.Character.HasTalents ( )

◆ HasTeamChange()

bool Barotrauma.Character.HasTeamChange ( string identifier)

◆ HasUnlockedAllTalents()

bool Barotrauma.Character.HasUnlockedAllTalents ( )

◆ IsAnySelectedItem()

bool Barotrauma.Character.IsAnySelectedItem ( Item item)

Is the item either the primary or the secondary selected item?

Parameters
item
Returns

◆ IsClientOwner()

bool Barotrauma.Character.IsClientOwner ( Client client)

◆ IsDualWieldingRangedWeapons()

bool Barotrauma.Character.IsDualWieldingRangedWeapons ( )

◆ IsFacing()

bool Barotrauma.Character.IsFacing ( Vector2 targetWorldPos)

A simple check if the character Dir is towards the target or not. Uses the world coordinates.

◆ IsFriendly() [1/2]

static bool Barotrauma.Character.IsFriendly ( Character me,
Character other )
static

◆ IsFriendly() [2/2]

bool Barotrauma.Character.IsFriendly ( Character other)

◆ IsInSameRoomAs()

bool Barotrauma.Character.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.

◆ IsInventoryAccessibleTo()

bool Barotrauma.Character.IsInventoryAccessibleTo ( Character character,
CharacterInventory.AccessLevel accessLevel = CharacterInventory::AccessLevel::Limited )

Is the inventory accessible to the character? Doesn't check if the character can actually interact with it (distance checks etc).

◆ IsItemTakenBySomeoneElse()

bool Barotrauma.Character.IsItemTakenBySomeoneElse ( Item item)

◆ IsKeyDown()

bool Barotrauma.Character.IsKeyDown ( InputType inputType)

◆ IsKeyHit()

bool Barotrauma.Character.IsKeyHit ( InputType inputType)

◆ IsOnFriendlyTeam() [1/4]

static bool Barotrauma.Character.IsOnFriendlyTeam ( Character me,
Character other )
static

◆ IsOnFriendlyTeam() [2/4]

bool Barotrauma.Character.IsOnFriendlyTeam ( Character other)

◆ IsOnFriendlyTeam() [3/4]

static bool Barotrauma.Character.IsOnFriendlyTeam ( CharacterTeamType myTeam,
CharacterTeamType otherTeam )
static

◆ IsOnFriendlyTeam() [4/4]

bool Barotrauma.Character.IsOnFriendlyTeam ( CharacterTeamType otherTeam)

◆ IsSameSpeciesOrGroup() [1/2]

static bool Barotrauma.Character.IsSameSpeciesOrGroup ( Character me,
Character other )
static

◆ IsSameSpeciesOrGroup() [2/2]

bool Barotrauma.Character.IsSameSpeciesOrGroup ( Character other)

◆ IsTargetVisible()

static bool Barotrauma.Character.IsTargetVisible ( ISpatialEntity target,
ISpatialEntity seeingEntity,
bool seeThroughWindows = false,
bool checkFacing = false )
static

◆ Kill()

void Barotrauma.Character.Kill ( CauseOfDeathType causeOfDeath,
Affliction causeOfDeathAffliction,
bool isNetworkMessage = false,
bool log = true )

◆ LoadHeadAttachments()

void Barotrauma.Character.LoadHeadAttachments ( )

◆ LoadTalents()

void Barotrauma.Character.LoadTalents ( )

◆ OnAttackedHandler()

delegate void Barotrauma.Character.OnAttackedHandler ( Character attacker,
AttackResult attackResult )

◆ OnDeathHandler()

delegate void Barotrauma.Character.OnDeathHandler ( Character character,
CauseOfDeath causeOfDeath )

◆ OnWearablesChanged()

void Barotrauma.Character.OnWearablesChanged ( )

◆ RecordKill()

void Barotrauma.Character.RecordKill ( Character target)

◆ ReleaseSecondaryItem()

void Barotrauma.Character.ReleaseSecondaryItem ( )

◆ ReloadHead()

void Barotrauma.Character.ReloadHead ( int? headId = null,
int hairIndex = -1,
int beardIndex = -1,
int moustacheIndex = -1,
int faceAttachmentIndex = -1 )

◆ Remove()

override void Barotrauma.Character.Remove ( )
virtual

Reimplemented from Barotrauma.Entity.

◆ RemoveAbilityFlag()

void Barotrauma.Character.RemoveAbilityFlag ( AbilityFlags abilityFlag)

◆ RemoveAbilityResistance()

void Barotrauma.Character.RemoveAbilityResistance ( TalentResistanceIdentifier identifier)

◆ RemoveByPrefab()

static void Barotrauma.Character.RemoveByPrefab ( CharacterPrefab prefab)
static

◆ ResetNetState()

void Barotrauma.Character.ResetNetState ( )

◆ ResetSpeedMultiplier()

void Barotrauma.Character.ResetSpeedMultiplier ( )

◆ Revive()

void Barotrauma.Character.Revive ( bool removeAfflictions = true,
bool createNetworkEvent = false )

◆ SaveInventory() [1/2]

void Barotrauma.Character.SaveInventory ( )

Calls SaveInventory(Barotrauma.Inventory, XElement) using 'Inventory' and 'Info.InventoryData'.

◆ SaveInventory() [2/2]

static void Barotrauma.Character.SaveInventory ( Inventory inventory,
XElement parentElement )
static

◆ SelectCharacter()

void Barotrauma.Character.SelectCharacter ( Character character)

◆ ServerEventRead()

virtual void Barotrauma.Character.ServerEventRead ( IReadMessage msg,
Client c )
virtual

◆ ServerEventWrite()

virtual void Barotrauma.Character.ServerEventWrite ( IWriteMessage msg,
Client c,
NetEntityEvent.IData extraData = null )
virtual

◆ ServerReadInput()

void Barotrauma.Character.ServerReadInput ( IReadMessage msg,
Client c )

◆ ServerWritePosition()

void Barotrauma.Character.ServerWritePosition ( ReadWriteMessage tempBuffer,
Client c )

◆ SetAllDamage()

void Barotrauma.Character.SetAllDamage ( float damageAmount,
float bleedingDamageAmount,
float burnDamageAmount )

◆ SetAttackTarget()

void Barotrauma.Character.SetAttackTarget ( Limb attackLimb,
IDamageable damageTarget,
Vector2 attackPos )

◆ SetCustomInteract()

void Barotrauma.Character.SetCustomInteract ( Action< Character, Character > onCustomInteract,
LocalizedString hudText )

Set an action that's invoked when another character interacts with this one.

Parameters
onCustomInteractAction invoked when another character interacts with this one. T1 = this character, T2 = the interacting character
hudTextDisplayed on the character when highlighted.

◆ SetInput()

void Barotrauma.Character.SetInput ( InputType inputType,
bool hit,
bool held )

◆ SetOrder()

void Barotrauma.Character.SetOrder ( Order order,
bool isNewOrder,
bool speak = true,
bool force = false )

Parameters
forceForce an order to be set for the character, bypassing hearing checks

◆ SetOriginalTeam()

void Barotrauma.Character.SetOriginalTeam ( CharacterTeamType newTeam)

◆ SetOwnerClient()

void Barotrauma.Character.SetOwnerClient ( Client client)

◆ SetStun()

void Barotrauma.Character.SetStun ( float newStun,
bool allowStunDecrease = false,
bool isNetworkMessage = false )

◆ SpawnInventoryItems()

void Barotrauma.Character.SpawnInventoryItems ( Inventory inventory,
ContentXElement itemData )

◆ Speak()

void Barotrauma.Character.Speak ( string message,
ChatMessageType? messageType = null,
float delay = 0::0f,
Identifier identifier = default,
float minDurationBetweenSimilar = 0::0f )

◆ StackHealthMultiplier()

void Barotrauma.Character.StackHealthMultiplier ( float val)

◆ StackSpeedMultiplier()

void Barotrauma.Character.StackSpeedMultiplier ( float val)

◆ StopClimbing()

void Barotrauma.Character.StopClimbing ( )

◆ TeleportTo()

void Barotrauma.Character.TeleportTo ( Vector2 worldPos)

◆ ToString()

override string Barotrauma.Character.ToString ( )

◆ TryAddNewTeamChange()

bool Barotrauma.Character.TryAddNewTeamChange ( string identifier,
ActiveTeamChange newTeamChange )

◆ TryAdjustAttackerSkill()

void Barotrauma.Character.TryAdjustAttackerSkill ( Character attacker,
AttackResult attackResult )

◆ TryAdjustHealerSkill()

void Barotrauma.Character.TryAdjustHealerSkill ( Character healer,
float healthChange = 0,
Affliction affliction = null )

◆ TryRemoveTeamChange()

bool Barotrauma.Character.TryRemoveTeamChange ( string identifier)

◆ TrySeverLimbJoints()

void Barotrauma.Character.TrySeverLimbJoints ( Limb targetLimb,
float severLimbsProbability,
float damage,
bool allowBeheading,
bool ignoreSeveranceProbabilityModifier = false,
Character attacker = null )

◆ Update()

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

Reimplemented in Barotrauma.AICharacter.

◆ UpdateAll()

static void Barotrauma.Character.UpdateAll ( float deltaTime,
Camera cam )
static

◆ UpdateAnimAll()

static void Barotrauma.Character.UpdateAnimAll ( float deltaTime)
static

◆ UpdateTeam()

void Barotrauma.Character.UpdateTeam ( )

◆ WriteSpawnData()

void Barotrauma.Character.WriteSpawnData ( IWriteMessage msg,
UInt16 entityId,
bool restrictMessageSize )

Member Data Documentation

◆ ActiveConversation

ConversationAction Barotrauma.Character.ActiveConversation

◆ activeTeamChanges

readonly Dictionary<string, ActiveTeamChange> Barotrauma.Character.activeTeamChanges = new Dictionary<string, ActiveTeamChange>()
protected

◆ AnimController

readonly AnimController Barotrauma.Character.AnimController

◆ AttachedProjectiles

readonly HashSet<Projectile> Barotrauma.Character.AttachedProjectiles = new HashSet<Projectile>()

◆ CampaignInteractionType

CampaignMode.InteractionType Barotrauma.Character.CampaignInteractionType

◆ CharacterList

readonly List<Character> Barotrauma.Character.CharacterList = new List<Character>()
static

◆ CharacterUpdateInterval

int Barotrauma.Character.CharacterUpdateInterval = 1
static

◆ ClientDisconnected

bool Barotrauma.Character.ClientDisconnected

◆ CombatAction

CombatAction Barotrauma.Character.CombatAction

◆ CurrentHull

Hull Barotrauma.Character.CurrentHull = null

◆ currentTeamChange

ActiveTeamChange Barotrauma.Character.currentTeamChange
protected

◆ DisableHealthWindow

bool Barotrauma.Character.DisableHealthWindow

◆ dontFollowCursor

bool Barotrauma.Character.dontFollowCursor

◆ focusedItem

Item Barotrauma.Character.focusedItem
protected

◆ GodMode

bool Barotrauma.Character.GodMode = false

Godmoded characters cannot receive any afflictions whatsoever.

◆ HealthUpdatePending

bool Barotrauma.Character.HealthUpdatePending

◆ healthUpdateTimer

float Barotrauma.Character.healthUpdateTimer

◆ IsCriminal

bool Barotrauma.Character.IsCriminal

Do the outpost security officers treat the character as a criminal? Triggers when the character has either committed a major crime or resisted being arrested (or fled). Only affects the reactions of friendly NPCs in the outposts. The NPCs still don't react immediately to "criminals", but take this into account when the character next time does something wrong. The consequences are that the guards will not hold fire and will not give more warnings before attacking.

◆ IsForceRagdolled

bool Barotrauma.Character.IsForceRagdolled

◆ IsHostileEscortee

bool Barotrauma.Character.IsHostileEscortee

Set true only, if the character is turned hostile from an escort mission (See EscortMission).

◆ IsRagdolled

bool Barotrauma.Character.IsRagdolled

◆ isSynced

bool Barotrauma.Character.isSynced = false

◆ keys

Key [] Barotrauma.Character.keys
protected

◆ KillDisconnectedTimer

float Barotrauma.Character.KillDisconnectedTimer

◆ KnockbackCooldown

const float Barotrauma.Character.KnockbackCooldown = 5.0f
static

◆ KnockbackCooldownTimer

float Barotrauma.Character.KnockbackCooldownTimer

◆ LastDamage

AttackResult Barotrauma.Character.LastDamage

◆ LastDamageSource

Entity Barotrauma.Character.LastDamageSource

◆ LastNetworkUpdateID

UInt16 Barotrauma.Character.LastNetworkUpdateID = 0

◆ LastProcessedID

UInt16 Barotrauma.Character.LastProcessedID

ID of the last inputs the server has processed.

◆ Latchers

readonly HashSet<LatchOntoAI> Barotrauma.Character.Latchers = new HashSet<LatchOntoAI>()

◆ MarkedAsLooted

HashSet<Identifier> Barotrauma.Character.MarkedAsLooted = new()

◆ MaxDragDistance

const float Barotrauma.Character.MaxDragDistance = 200.0f
static

◆ MaxHighlightDistance

const float Barotrauma.Character.MaxHighlightDistance = 150.0f
static

◆ MerchantIdentifier

Identifier Barotrauma.Character.MerchantIdentifier

◆ OnAttacked

OnAttackedHandler Barotrauma.Character.OnAttacked

◆ OnDeath

OnDeathHandler Barotrauma.Character.OnDeath

◆ oxygenAvailable

float Barotrauma.Character.oxygenAvailable
protected

◆ Params

readonly CharacterParams Barotrauma.Character.Params

◆ Prefab

readonly CharacterPrefab Barotrauma.Character.Prefab

◆ PreviousHull

Hull Barotrauma.Character.PreviousHull = null

◆ Properties

readonly Dictionary<Identifier, SerializableProperty> Barotrauma.Character.Properties

◆ RequireConsciousnessForCustomInteract

bool Barotrauma.Character.RequireConsciousnessForCustomInteract = true

◆ Seed

readonly string Barotrauma.Character.Seed

◆ TraitorCurrentObjective

LocalizedString Barotrauma.Character.TraitorCurrentObjective = ""

Property Documentation

◆ AIController

virtual AIController Barotrauma.Character.AIController
get

◆ AimRefPosition

Vector2 Barotrauma.Character.AimRefPosition
get

◆ AIState

AIState Barotrauma.Character.AIState
get

◆ AITurretPriority

float Barotrauma.Character.AITurretPriority
get

◆ AllowCustomInteract

bool Barotrauma.Character.AllowCustomInteract
get

◆ AllowInput

bool Barotrauma.Character.AllowInput
get

◆ Anim

AnimController.Animation Barotrauma.Character.Anim
get

Can be used by status effects.

◆ Bleeding

float Barotrauma.Character.Bleeding
get

◆ BloodDecalName

string Barotrauma.Character.BloodDecalName
get

◆ Bloodloss

float Barotrauma.Character.Bloodloss
getset

◆ CanAim

bool Barotrauma.Character.CanAim
get

◆ CanBeSelected

bool Barotrauma.Character.CanBeSelected
get

◆ CanEat

bool Barotrauma.Character.CanEat
get

◆ CanInteract

bool Barotrauma.Character.CanInteract
get

◆ CanMove

bool Barotrauma.Character.CanMove
get

◆ CanRun

bool Barotrauma.Character.CanRun
get

◆ CanSpeak

bool Barotrauma.Character.CanSpeak
getset

◆ CauseOfDeath

CauseOfDeath Barotrauma.Character.CauseOfDeath
get

◆ CharacterHealth

CharacterHealth Barotrauma.Character.CharacterHealth
get

◆ CharacterTalents

IReadOnlyCollection<CharacterTalent> Barotrauma.Character.CharacterTalents
get

◆ ConfigPath

string Barotrauma.Character.ConfigPath
get

◆ Controlled

Character Barotrauma.Character.Controlled
staticget

◆ CurrentOrders

List<Order> Barotrauma.Character.CurrentOrders
get

◆ CurrentSpeed

float Barotrauma.Character.CurrentSpeed
get

Current speed of the character's collider. Can be used by status effects to check if the character is moving.

◆ CursorPosition

Vector2 Barotrauma.Character.CursorPosition
getset

◆ CursorWorldPosition

Vector2 Barotrauma.Character.CursorWorldPosition
get

◆ CustomInteractHUDText

LocalizedString Barotrauma.Character.CustomInteractHUDText
get

◆ DisabledByEvent

bool Barotrauma.Character.DisabledByEvent
getset

MonsterEvents disable monsters (which includes removing them from the character list, so they essentially "don't exist") until they're ready to spawn.

◆ DisableFocusingOnEntities

bool Barotrauma.Character.DisableFocusingOnEntities
getset

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.

◆ DisableImpactDamageTimer

float Barotrauma.Character.DisableImpactDamageTimer
getset

◆ DisableInteract

bool Barotrauma.Character.DisableInteract
getset

Prevents the character from interacting with items or characters.

◆ DisplayName

string Barotrauma.Character.DisplayName
get

◆ DoesBleed

bool Barotrauma.Character.DoesBleed
getset

◆ DrawPosition

override Vector2 Barotrauma.Character.DrawPosition
get

◆ EmpVulnerability

float Barotrauma.Character.EmpVulnerability
get

◆ Enabled

bool Barotrauma.Character.Enabled
getset

◆ EnableDespawn

bool Barotrauma.Character.EnableDespawn = true
getset

◆ Faction

Identifier Barotrauma.Character.Faction
getset

◆ FocusedCharacter

Character Barotrauma.Character.FocusedCharacter
getset

◆ FocusedItem

Item Barotrauma.Character.FocusedItem
getset

◆ ForceRun

bool Barotrauma.Character.ForceRun
getset

◆ Group

Identifier Barotrauma.Character.Group
get

◆ HasSelectedAnyItem

bool Barotrauma.Character.HasSelectedAnyItem
get

Has the characters selected a primary or a secondary item?

◆ Health

float Barotrauma.Character.Health
get

◆ HealthMultiplier

float Barotrauma.Character.HealthMultiplier = 1
get

Can be used to modify the character's health via StatusEffects.

◆ HealthPercentage

float Barotrauma.Character.HealthPercentage
get

◆ HealthUpdateInterval

float Barotrauma.Character.HealthUpdateInterval
getset

◆ HeldItems

IEnumerable<Item> Barotrauma.Character.HeldItems
get

Items the character has in their hand slots. Doesn't return nulls and only returns items held in both hands once.

◆ HideFace

bool Barotrauma.Character.HideFace
getset

◆ HullOxygenPercentage

float Barotrauma.Character.HullOxygenPercentage
get

◆ HumanPrefab

HumanPrefab Barotrauma.Character.HumanPrefab
getset

◆ HumanPrefabHealthMultiplier

float Barotrauma.Character.HumanPrefabHealthMultiplier = 1
get

Health multiplier of the human prefab this character is an instance of (if any)

◆ IgnoreMeleeWeapons

bool Barotrauma.Character.IgnoreMeleeWeapons
getset

◆ Info

CharacterInfo Barotrauma.Character.Info
getset

◆ InPressure

bool Barotrauma.Character.InPressure
get

Can be used by status effects to check whether the characters is in a high-pressure environment.

◆ Inventory

CharacterInventory Barotrauma.Character.Inventory
get

◆ InvisibleTimer

float Barotrauma.Character.InvisibleTimer
getset

◆ InWater

bool Barotrauma.Character.InWater
get

◆ IsAssistant

bool Barotrauma.Character.IsAssistant
get

◆ IsBot

bool Barotrauma.Character.IsBot
get

◆ IsCaptain

bool Barotrauma.Character.IsCaptain
get

◆ IsClimbing

bool Barotrauma.Character.IsClimbing
get

◆ IsCommanding

bool Barotrauma.Character.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.

◆ IsDead

bool Barotrauma.Character.IsDead
getset

◆ IsDisguisedAsHusk

bool Barotrauma.Character.IsDisguisedAsHusk
get

◆ IsDismissed

bool Barotrauma.Character.IsDismissed
get

◆ IsDraggable

bool Barotrauma.Character.IsDraggable
get

◆ IsEngineer

bool Barotrauma.Character.IsEngineer
get

◆ IsEscorted

bool Barotrauma.Character.IsEscorted
getset

◆ IsFemale

bool Barotrauma.Character.IsFemale
get

◆ IsFlipped

bool Barotrauma.Character.IsFlipped
get

◆ IsFriendlyNPCTurnedHostile

bool Barotrauma.Character.IsFriendlyNPCTurnedHostile
get

◆ IsHandcuffed

bool Barotrauma.Character.IsHandcuffed
get

◆ IsHuman

bool Barotrauma.Character.IsHuman
get

◆ IsHumanoid

bool Barotrauma.Character.IsHumanoid
get

◆ IsHusk

bool Barotrauma.Character.IsHusk
get

◆ IsHuskInfected

bool Barotrauma.Character.IsHuskInfected
get

◆ IsImmuneToPressure

bool Barotrauma.Character.IsImmuneToPressure
get

◆ IsIncapacitated

bool Barotrauma.Character.IsIncapacitated
get

◆ IsInFriendlySub

bool Barotrauma.Character.IsInFriendlySub
get

◆ IsInPlayerSub

bool Barotrauma.Character.IsInPlayerSub
get

◆ IsInstigator

bool Barotrauma.Character.IsInstigator
get

◆ IsKiller

bool Barotrauma.Character.IsKiller
get

◆ IsKnockedDown

bool Barotrauma.Character.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.

◆ IsLatched

bool Barotrauma.Character.IsLatched
get

◆ IsLocalPlayer

bool Barotrauma.Character.IsLocalPlayer
get

◆ IsLowInOxygen

bool Barotrauma.Character.IsLowInOxygen
get

◆ IsMachine

bool Barotrauma.Character.IsMachine
get

◆ IsMale

bool Barotrauma.Character.IsMale
get

◆ IsMechanic

bool Barotrauma.Character.IsMechanic
get

◆ IsMedic

bool Barotrauma.Character.IsMedic
get

◆ IsOnPlayerTeam

bool Barotrauma.Character.IsOnPlayerTeam
get

◆ IsOriginallyOnPlayerTeam

bool Barotrauma.Character.IsOriginallyOnPlayerTeam
get

◆ IsPet

bool Barotrauma.Character.IsPet
get

◆ IsPlayer

bool Barotrauma.Character.IsPlayer
get

◆ IsPrisoner

bool Barotrauma.Character.IsPrisoner
get

◆ IsProtectedFromPressure

bool Barotrauma.Character.IsProtectedFromPressure
get

Is the character currently protected from the pressure by immunity/ability or a status effect (e.g. from a diving suit).

◆ IsRemotelyControlled

bool Barotrauma.Character.IsRemotelyControlled
get

Is the character controlled remotely (either by another player, or a server-side AIController)

◆ IsRemotePlayer

bool Barotrauma.Character.IsRemotePlayer
getset

Is the character controlled by another human player (should always be false in single player)

◆ IsSecurity

bool Barotrauma.Character.IsSecurity
get

◆ IsTraitor

bool Barotrauma.Character.IsTraitor
getset

◆ IsUnconscious

bool Barotrauma.Character.IsUnconscious
get

◆ IsVip

bool Barotrauma.Character.IsVip
get

◆ IsWatchman

bool Barotrauma.Character.IsWatchman
get

◆ ItemSelectedDurations

Dictionary<ItemPrefab, double> Barotrauma.Character.ItemSelectedDurations
get

◆ JobIdentifier

Identifier Barotrauma.Character.JobIdentifier
get

◆ Keys

Key [] Barotrauma.Character.Keys
get

◆ LastAttacker

Character Barotrauma.Character.LastAttacker
get

◆ LastAttackers

IEnumerable<Attacker> Barotrauma.Character.LastAttackers
get

◆ LastOrderedCharacter

Character Barotrauma.Character.LastOrderedCharacter
get

◆ LockHands

bool Barotrauma.Character.LockHands
getset

◆ LogName

string Barotrauma.Character.LogName
get

◆ LowPassMultiplier

float Barotrauma.Character.LowPassMultiplier
getset

◆ Mass

float Barotrauma.Character.Mass
get

◆ MaxHealth

float Barotrauma.Character.MaxHealth
get

◆ MaxPerceptionDistance

float Barotrauma.Character.MaxPerceptionDistance
getset

◆ MaxVitality

float Barotrauma.Character.MaxVitality
get

◆ MemLocalState

List<CharacterStateInfo> Barotrauma.Character.MemLocalState
get

◆ MemState

List<CharacterStateInfo> Barotrauma.Character.MemState
get

◆ Name

string Barotrauma.Character.Name
get

◆ NeedsAir

bool Barotrauma.Character.NeedsAir
getset

◆ NeedsOxygen

bool Barotrauma.Character.NeedsOxygen
get

◆ NeedsWater

bool Barotrauma.Character.NeedsWater
getset

◆ Noise

float Barotrauma.Character.Noise
getset

◆ ObstructVision

bool Barotrauma.Character.ObstructVision
getset

Provided for backwards compatibility: use ObstructVisionAmount instead.

◆ ObstructVisionAmount

float Barotrauma.Character.ObstructVisionAmount
getset

◆ OriginalTeamID

CharacterTeamType Barotrauma.Character.OriginalTeamID
get

◆ OverrideMovement

Vector2? Barotrauma.Character.OverrideMovement
getset

◆ Oxygen

float Barotrauma.Character.Oxygen
getset

◆ OxygenAvailable

float Barotrauma.Character.OxygenAvailable
getset

◆ PickingItem

Item Barotrauma.Character.PickingItem
getset

◆ PoisonVulnerability

float Barotrauma.Character.PoisonVulnerability
get

◆ Position

override Vector2 Barotrauma.Character.Position
get

◆ PressureProtection

float Barotrauma.Character.PressureProtection
getset

◆ PressureTimer

float Barotrauma.Character.PressureTimer
get

◆ PropulsionSpeedMultiplier

float Barotrauma.Character.PropulsionSpeedMultiplier
getset

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)

◆ SecondLastOrderedCharacter

Character Barotrauma.Character.SecondLastOrderedCharacter
get

◆ SelectedBy

Character Barotrauma.Character.SelectedBy
getset

◆ SelectedCharacter

Character Barotrauma.Character.SelectedCharacter
getset

◆ SelectedItem

Item Barotrauma.Character.SelectedItem
getset

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.

◆ SelectedSecondaryItem

Item Barotrauma.Character.SelectedSecondaryItem
getset

The secondary selected item. It's an item other than a device (see SelectedItem), e.g. a ladder or a chair.

◆ SerializableProperties

Dictionary<Identifier, SerializableProperty> Barotrauma.Character.SerializableProperties
get

◆ SimPosition

override Vector2 Barotrauma.Character.SimPosition
get

◆ SmoothedCursorPosition

Vector2 Barotrauma.Character.SmoothedCursorPosition
get

◆ SpeciesName

Identifier Barotrauma.Character.SpeciesName
get

◆ SpeechImpediment

float Barotrauma.Character.SpeechImpediment
getset

◆ SpeedMultiplier

float Barotrauma.Character.SpeedMultiplier = 1
get

Can be used to modify the character's speed via StatusEffects.

◆ Stun

float Barotrauma.Character.Stun
getset

◆ TeamID

CharacterTeamType Barotrauma.Character.TeamID
getset

◆ TextChatVolume

float Barotrauma.Character.TextChatVolume
getset

How "loud" the player is when they use text chat. When the user speaks in text chat this gets set to 1 and then slowly decreases back to 0 over 5 seconds.

◆ UniqueNameColor

Color? Barotrauma.Character.UniqueNameColor = null
getset

◆ Unkillable

bool Barotrauma.Character.Unkillable
getset

◆ UseHealthWindow

bool Barotrauma.Character.UseHealthWindow
getset

Is the health interface available on this character? Can be used by status effects.

◆ UseHullOxygen

bool Barotrauma.Character.UseHullOxygen = true
getset

◆ VariantOf

Identifier Barotrauma.Character.VariantOf
get

◆ ViewTarget

Entity Barotrauma.Character.ViewTarget
getset

◆ Visibility

float Barotrauma.Character.Visibility
getset

◆ Vitality

float Barotrauma.Character.Vitality
get

◆ Wallet

Wallet Barotrauma.Character.Wallet
getset

◆ WasFullHealth

bool Barotrauma.Character.WasFullHealth
get

Was the character in full health at the beginning of the frame?


The documentation for this class was generated from the following files: