Barotrauma Client Doc
Barotrauma.Limb Class Reference
Inheritance diagram for Barotrauma.Limb:
Barotrauma.ISerializableEntity Barotrauma.ISpatialEntity

Public Member Functions

 Limb (Ragdoll ragdoll, Character character, LimbParams limbParams)
 
void MoveToPos (Vector2 pos, float force, bool pullFromCenter=false)
 
void MirrorPullJoint ()
 
AttackResult AddDamage (Vector2 simPosition, float damage, float bleedingDamage, float burnDamage, bool playSound)
 
AttackResult AddDamage (Vector2 simPosition, IEnumerable< Affliction > afflictions, bool playSound, float damageMultiplier=1, float penetration=0f, Character attacker=null)
 
bool SectorHit (Vector2 armorSector, Vector2 simPosition)
 
void Update (float deltaTime)
 
void HideAndDisable (float duration=0, bool ignoreCollisions=true)
 
void ReEnable ()
 
bool UpdateAttack (float deltaTime, Vector2 attackSimPos, IDamageable damageTarget, out AttackResult attackResult, float distance=-1, Limb targetLimb=null)
 Returns true if the attack successfully hit something. If the distance is not given, it will be calculated. More...
 
void ExecuteAttack (IDamageable damageTarget, Limb targetLimb, out AttackResult attackResult)
 
void Release ()
 
void ApplyStatusEffects (ActionType actionType, float deltaTime)
 
void Blink ()
 
void UpdateBlink (float deltaTime, float referenceRotation)
 
IEnumerable< LimbJointGetConnectedJoints ()
 
IEnumerable< LimbGetConnectedLimbs ()
 
void Remove ()
 
void LoadParams ()
 
Sprite GetActiveSprite (bool excludeConditionalSprites=true)
 
void LoadHuskSprite ()
 
void LoadHerpesSprite ()
 
void RecreateSprites ()
 
void Draw (SpriteBatch spriteBatch, Camera cam, Color? overrideColor=null, bool disableDeformations=false)
 
void UpdateWearableTypesToHide ()
 
void DrawDamageModifiers (SpriteBatch spriteBatch, Camera cam, Vector2 startPos, bool isScreenSpace)
 

Static Public Member Functions

static string GetSpritePath (ContentPath texturePath, CharacterInfo characterInfo)
 Get the full path of a limb sprite, taking into account tags, gender and head id More...
 

Public Attributes

readonly Character character
 
readonly Ragdoll ragdoll
 Note that during the limb initialization, character.AnimController returns null, whereas this field is already assigned. More...
 
readonly LimbParams Params
 
PhysicsBody body
 
Hull Hull
 
readonly LimbType type
 
readonly Attack attack
 
Vector2 DebugTargetPos
 
Vector2 DebugRefPos
 
readonly List< WearableSpriteWearingItems = new List<WearableSprite>()
 
readonly List< WearableSpriteOtherWearables = new List<WearableSprite>()
 
float BlinkPhase
 
bool FreezeBlinkState
 
float LastAttackSoundTime
 

Static Public Attributes

const float SoundInterval = 0.4f
 

Protected Member Functions

float GetArmorSectorSize (Vector2 armorSector)
 

Protected Attributes

DeformableSprite _deformSprite
 

Properties

float SeveredFadeOutTime = 10 [get]
 
Vector2 StepOffset [get]
 
bool InWater [get, set]
 
bool IgnoreCollisions [get, set]
 
Vector2 MouthPos [get, set]
 
List< DamageModifierDamageModifiers = new List<DamageModifier>() [get]
 
int HealthIndex [get]
 
float Scale [get]
 
float AttackPriority [get]
 
bool? DoesFlip [get]
 
bool DoesMirror [get]
 
float SteerForce [get]
 
bool IsLowerBody [get]
 
bool IsLeg [get]
 
bool? IsSevered [get, set]
 
Submarine Submarine [get]
 
bool Hidden [get, set]
 
Vector2?? WorldPosition [get]
 
Vector2??? Position [get]
 
Vector2 SimPosition [get]
 
float Rotation [get]
 
Vector2 AnimTargetPos [get]
 
float Mass [get]
 
bool Disabled [get, set]
 
Vector2 LinearVelocity [get]
 
float?? Dir [get, set]
 
int RefJointIndex [get]
 
bool PullJointEnabled [get, set]
 
float PullJointMaxForce [get, set]
 
Vector2 PullJointWorldAnchorA [get, set]
 
Vector2 PullJointWorldAnchorB [get, set]
 
Vector2 PullJointLocalAnchorA [get]
 
bool Removed [get]
 
Items.Components.Rope AttachedRope [get, set]
 
string Name [get]
 
bool IsDead [get]
 
float Health [get]
 
float HealthPercentage [get]
 
bool IsHuman [get]
 
AIState AIState [get]
 
bool IsFlipped [get]
 
bool CanBeSeveredAlive [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 
Dictionary< ActionType, List< StatusEffect > > StatusEffects [get]
 
bool IsStuck [get]
 
List< SpriteDeformationActiveDeformations = new List<SpriteDeformation>() [get, set]
 
Sprite Sprite [get, protected set]
 
Sprite TintMask [get, protected set]
 
Sprite HuskMask [get, protected set]
 
float TintHighlightThreshold [get, protected set]
 
float TintHighlightMultiplier [get, protected set]
 
DeformableSprite DeformSprite [get]
 
List< DecorativeSpriteDecorativeSprites = new List<DecorativeSprite>() [get]
 
SpriteActiveSprite [get]
 
float DefaultSpriteDepth [get]
 
WearableSprite HairWithHatSprite [get, set]
 
WearableSprite HuskSprite [get]
 
WearableSprite HerpesSprite [get]
 
float TextureScale [get]
 
Sprite DamagedSprite [get]
 
bool Hide [get, set]
 
List< ConditionalSpriteConditionalSprites = new List<ConditionalSprite>() [get]
 
Color InitialLightSourceColor [get]
 
float? InitialLightSpriteAlpha [get]
 
LightSource LightSource [get]
 
float DamageOverlayStrength [get, set]
 
float BurnOverlayStrength [get, set]
 
string HitSoundTag [get]
 
bool EnableHuskSprite [get, set]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ Limb()

Barotrauma.Limb.Limb ( Ragdoll  ragdoll,
Character  character,
LimbParams  limbParams 
)

Member Function Documentation

◆ AddDamage() [1/2]

AttackResult Barotrauma.Limb.AddDamage ( Vector2  simPosition,
float  damage,
float  bleedingDamage,
float  burnDamage,
bool  playSound 
)

◆ AddDamage() [2/2]

AttackResult Barotrauma.Limb.AddDamage ( Vector2  simPosition,
IEnumerable< Affliction afflictions,
bool  playSound,
float  damageMultiplier = 1,
float  penetration = 0f,
Character  attacker = null 
)

◆ ApplyStatusEffects()

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

◆ Blink()

void Barotrauma.Limb.Blink ( )

◆ Draw()

void Barotrauma.Limb.Draw ( SpriteBatch  spriteBatch,
Camera  cam,
Color?  overrideColor = null,
bool  disableDeformations = false 
)

◆ DrawDamageModifiers()

void Barotrauma.Limb.DrawDamageModifiers ( SpriteBatch  spriteBatch,
Camera  cam,
Vector2  startPos,
bool  isScreenSpace 
)

◆ ExecuteAttack()

void Barotrauma.Limb.ExecuteAttack ( IDamageable  damageTarget,
Limb  targetLimb,
out AttackResult  attackResult 
)

◆ GetActiveSprite()

Sprite Barotrauma.Limb.GetActiveSprite ( bool  excludeConditionalSprites = true)

◆ GetArmorSectorSize()

float Barotrauma.Limb.GetArmorSectorSize ( Vector2  armorSector)
protected

◆ GetConnectedJoints()

IEnumerable<LimbJoint> Barotrauma.Limb.GetConnectedJoints ( )

◆ GetConnectedLimbs()

IEnumerable<Limb> Barotrauma.Limb.GetConnectedLimbs ( )

◆ GetSpritePath()

static string Barotrauma.Limb.GetSpritePath ( ContentPath  texturePath,
CharacterInfo  characterInfo 
)
static

Get the full path of a limb sprite, taking into account tags, gender and head id

Definition at line 510 of file BarotraumaClient/ClientSource/Characters/Limb.cs.

◆ HideAndDisable()

void Barotrauma.Limb.HideAndDisable ( float  duration = 0,
bool  ignoreCollisions = true 
)

◆ LoadHerpesSprite()

void Barotrauma.Limb.LoadHerpesSprite ( )

◆ LoadHuskSprite()

void Barotrauma.Limb.LoadHuskSprite ( )

◆ LoadParams()

void Barotrauma.Limb.LoadParams ( )

◆ MirrorPullJoint()

void Barotrauma.Limb.MirrorPullJoint ( )

◆ MoveToPos()

void Barotrauma.Limb.MoveToPos ( Vector2  pos,
float  force,
bool  pullFromCenter = false 
)

◆ RecreateSprites()

void Barotrauma.Limb.RecreateSprites ( )

◆ ReEnable()

void Barotrauma.Limb.ReEnable ( )

◆ Release()

void Barotrauma.Limb.Release ( )

◆ Remove()

void Barotrauma.Limb.Remove ( )

◆ SectorHit()

bool Barotrauma.Limb.SectorHit ( Vector2  armorSector,
Vector2  simPosition 
)

◆ Update()

void Barotrauma.Limb.Update ( float  deltaTime)

◆ UpdateAttack()

bool Barotrauma.Limb.UpdateAttack ( float  deltaTime,
Vector2  attackSimPos,
IDamageable  damageTarget,
out AttackResult  attackResult,
float  distance = -1,
Limb  targetLimb = null 
)

Returns true if the attack successfully hit something. If the distance is not given, it will be calculated.

Definition at line 970 of file BarotraumaShared/SharedSource/Characters/Limb.cs.

◆ UpdateBlink()

void Barotrauma.Limb.UpdateBlink ( float  deltaTime,
float  referenceRotation 
)

◆ UpdateWearableTypesToHide()

void Barotrauma.Limb.UpdateWearableTypesToHide ( )

Member Data Documentation

◆ _deformSprite

DeformableSprite Barotrauma.Limb._deformSprite
protected

◆ attack

readonly Attack Barotrauma.Limb.attack

◆ BlinkPhase

float Barotrauma.Limb.BlinkPhase

◆ body

PhysicsBody Barotrauma.Limb.body

◆ character

readonly Character Barotrauma.Limb.character

◆ DebugRefPos

Vector2 Barotrauma.Limb.DebugRefPos

◆ DebugTargetPos

Vector2 Barotrauma.Limb.DebugTargetPos

◆ FreezeBlinkState

bool Barotrauma.Limb.FreezeBlinkState

◆ Hull

Hull Barotrauma.Limb.Hull

◆ LastAttackSoundTime

float Barotrauma.Limb.LastAttackSoundTime

◆ OtherWearables

readonly List<WearableSprite> Barotrauma.Limb.OtherWearables = new List<WearableSprite>()

◆ Params

readonly LimbParams Barotrauma.Limb.Params

◆ ragdoll

readonly Ragdoll Barotrauma.Limb.ragdoll

Note that during the limb initialization, character.AnimController returns null, whereas this field is already assigned.

Definition at line 213 of file BarotraumaShared/SharedSource/Characters/Limb.cs.

◆ SoundInterval

const float Barotrauma.Limb.SoundInterval = 0.4f
static

◆ type

readonly LimbType Barotrauma.Limb.type

◆ WearingItems

readonly List<WearableSprite> Barotrauma.Limb.WearingItems = new List<WearableSprite>()

Property Documentation

◆ ActiveDeformations

List<SpriteDeformation> Barotrauma.Limb.ActiveDeformations = new List<SpriteDeformation>()
getset

◆ ActiveSprite

Sprite? Barotrauma.Limb.ActiveSprite
get

◆ AIState

AIState Barotrauma.Limb.AIState
get

◆ AnimTargetPos

Vector2 Barotrauma.Limb.AnimTargetPos
get

◆ AttachedRope

Items.Components.Rope Barotrauma.Limb.AttachedRope
getset

◆ AttackPriority

float Barotrauma.Limb.AttackPriority
get

◆ BurnOverlayStrength

float Barotrauma.Limb.BurnOverlayStrength
getset

◆ CanBeSeveredAlive

bool Barotrauma.Limb.CanBeSeveredAlive
get

◆ ConditionalSprites

List<ConditionalSprite> Barotrauma.Limb.ConditionalSprites = new List<ConditionalSprite>()
get

◆ DamagedSprite

Sprite Barotrauma.Limb.DamagedSprite
get

◆ DamageModifiers

List<DamageModifier> Barotrauma.Limb.DamageModifiers = new List<DamageModifier>()
get

◆ DamageOverlayStrength

float Barotrauma.Limb.DamageOverlayStrength
getset

◆ DecorativeSprites

List<DecorativeSprite> Barotrauma.Limb.DecorativeSprites = new List<DecorativeSprite>()
get

◆ DefaultSpriteDepth

float Barotrauma.Limb.DefaultSpriteDepth
get

◆ DeformSprite

DeformableSprite Barotrauma.Limb.DeformSprite
get

◆ Dir

float?? Barotrauma.Limb.Dir
getset

◆ Disabled

bool Barotrauma.Limb.Disabled
getset

◆ DoesFlip

bool? Barotrauma.Limb.DoesFlip
get

◆ DoesMirror

bool Barotrauma.Limb.DoesMirror
get

◆ EnableHuskSprite

bool Barotrauma.Limb.EnableHuskSprite
getset

◆ HairWithHatSprite

WearableSprite Barotrauma.Limb.HairWithHatSprite
getset

◆ Health

float Barotrauma.Limb.Health
get

◆ HealthIndex

int Barotrauma.Limb.HealthIndex
get

◆ HealthPercentage

float Barotrauma.Limb.HealthPercentage
get

◆ HerpesSprite

WearableSprite Barotrauma.Limb.HerpesSprite
get

◆ Hidden

bool Barotrauma.Limb.Hidden
getset

◆ Hide

bool Barotrauma.Limb.Hide
getset

◆ HitSoundTag

string Barotrauma.Limb.HitSoundTag
get

◆ HuskMask

Sprite Barotrauma.Limb.HuskMask
getprotected set

◆ HuskSprite

WearableSprite Barotrauma.Limb.HuskSprite
get

◆ IgnoreCollisions

bool Barotrauma.Limb.IgnoreCollisions
getset

◆ InitialLightSourceColor

Color Barotrauma.Limb.InitialLightSourceColor
get

◆ InitialLightSpriteAlpha

float? Barotrauma.Limb.InitialLightSpriteAlpha
get

◆ InWater

bool Barotrauma.Limb.InWater
getset

◆ IsDead

bool Barotrauma.Limb.IsDead
get

◆ IsFlipped

bool Barotrauma.Limb.IsFlipped
get

◆ IsHuman

bool Barotrauma.Limb.IsHuman
get

◆ IsLeg

bool Barotrauma.Limb.IsLeg
get

◆ IsLowerBody

bool Barotrauma.Limb.IsLowerBody
get

◆ IsSevered

bool? Barotrauma.Limb.IsSevered
getset

◆ IsStuck

bool Barotrauma.Limb.IsStuck
get

◆ LightSource

LightSource Barotrauma.Limb.LightSource
get

◆ LinearVelocity

Vector2 Barotrauma.Limb.LinearVelocity
get

◆ Mass

float Barotrauma.Limb.Mass
get

◆ MouthPos

Vector2 Barotrauma.Limb.MouthPos
getset

◆ Name

string Barotrauma.Limb.Name
get

◆ Position

Vector2??? Barotrauma.Limb.Position
get

◆ PullJointEnabled

bool Barotrauma.Limb.PullJointEnabled
getset

◆ PullJointLocalAnchorA

Vector2 Barotrauma.Limb.PullJointLocalAnchorA
get

◆ PullJointMaxForce

float Barotrauma.Limb.PullJointMaxForce
getset

◆ PullJointWorldAnchorA

Vector2 Barotrauma.Limb.PullJointWorldAnchorA
getset

◆ PullJointWorldAnchorB

Vector2 Barotrauma.Limb.PullJointWorldAnchorB
getset

◆ RefJointIndex

int Barotrauma.Limb.RefJointIndex
get

◆ Removed

bool Barotrauma.Limb.Removed
get

◆ Rotation

float Barotrauma.Limb.Rotation
get

◆ Scale

float Barotrauma.Limb.Scale
get

◆ SerializableProperties

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

◆ SeveredFadeOutTime

float Barotrauma.Limb.SeveredFadeOutTime = 10
get

◆ SimPosition

Vector2 Barotrauma.Limb.SimPosition
get

◆ Sprite

Sprite Barotrauma.Limb.Sprite
getprotected set

◆ StatusEffects

Dictionary<ActionType, List<StatusEffect> > Barotrauma.Limb.StatusEffects
get

◆ SteerForce

float Barotrauma.Limb.SteerForce
get

◆ StepOffset

Vector2 Barotrauma.Limb.StepOffset
get

◆ Submarine

Submarine Barotrauma.Limb.Submarine
get

◆ TextureScale

float Barotrauma.Limb.TextureScale
get

◆ TintHighlightMultiplier

float Barotrauma.Limb.TintHighlightMultiplier
getprotected set

◆ TintHighlightThreshold

float Barotrauma.Limb.TintHighlightThreshold
getprotected set

◆ TintMask

Sprite Barotrauma.Limb.TintMask
getprotected set

◆ WorldPosition

Vector2?? Barotrauma.Limb.WorldPosition
get