Client LuaCsForBarotrauma
AfflictionBleeding.cs
1 namespace Barotrauma
2 {
7  {
8  public AfflictionBleeding(AfflictionPrefab prefab, float strength) :
9  base(prefab, strength)
10  {
11  }
12 
13  public override void Update(CharacterHealth characterHealth, Limb targetLimb, float deltaTime)
14  {
15  base.Update(characterHealth, targetLimb, deltaTime);
16  float bloodlossResistance = characterHealth.GetResistance(characterHealth.BloodlossAffliction.Prefab, targetLimb?.type ?? LimbType.None);
17  characterHealth.BloodlossAmount += Strength * (1.0f - bloodlossResistance) / 60.0f * deltaTime;
18  if (Source != null)
19  {
20  characterHealth.BloodlossAffliction.Source = Source;
21  }
22  }
23  }
24 }
A special affliction type that increases the character's Bloodloss affliction with a rate relative to...
AfflictionBleeding(AfflictionPrefab prefab, float strength)
override void Update(CharacterHealth characterHealth, Limb targetLimb, float deltaTime)
virtual float Strength
Definition: Affliction.cs:31
Character Source
Which character gave this affliction
Definition: Affliction.cs:88
readonly AfflictionPrefab Prefab
Definition: Affliction.cs:12
AfflictionPrefab is a prefab that defines a type of affliction that can be applied to a character....
float GetResistance(AfflictionPrefab afflictionPrefab, LimbType limbType)
How much resistance all the afflictions the character has give to the specified affliction?