Merge branch 'master' of https://github.com/Regalis11/Barotrauma.git
This commit is contained in:
@@ -112,6 +112,7 @@ namespace Barotrauma
|
||||
private Affliction oxygenLowAffliction;
|
||||
private Affliction pressureAffliction;
|
||||
private Affliction stunAffliction;
|
||||
public Affliction BloodlossAffliction { get => bloodlossAffliction; }
|
||||
|
||||
public bool IsUnconscious
|
||||
{
|
||||
@@ -182,7 +183,7 @@ namespace Barotrauma
|
||||
public float BloodlossAmount
|
||||
{
|
||||
get { return bloodlossAffliction.Strength; }
|
||||
set { bloodlossAffliction.Strength = MathHelper.Clamp(value, 0.0f, 100.0f); }
|
||||
set { bloodlossAffliction.Strength = MathHelper.Clamp(value, 0, bloodlossAffliction.Prefab.MaxStrength); }
|
||||
}
|
||||
|
||||
public float Stun
|
||||
@@ -202,7 +203,7 @@ namespace Barotrauma
|
||||
get { return pressureAffliction; }
|
||||
}
|
||||
|
||||
public Character Character { get; private set; }
|
||||
public readonly Character Character;
|
||||
|
||||
public CharacterHealth(Character character)
|
||||
{
|
||||
@@ -325,7 +326,11 @@ namespace Barotrauma
|
||||
if (kvp.Key == affliction)
|
||||
{
|
||||
int limbHealthIndex = limbHealths.IndexOf(kvp.Value);
|
||||
return Character.AnimController.Limbs.FirstOrDefault(l => l.HealthIndex == limbHealthIndex);
|
||||
foreach (Limb limb in Character.AnimController.Limbs)
|
||||
{
|
||||
if (limb.HealthIndex == limbHealthIndex) { return limb; }
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -681,7 +686,7 @@ namespace Barotrauma
|
||||
newStrength = Math.Min(existingAffliction.Prefab.MaxStrength, newStrength);
|
||||
if (existingAffliction == stunAffliction) { Character.SetStun(newStrength, true, true); }
|
||||
existingAffliction.Strength = newStrength;
|
||||
existingAffliction.Source = newAffliction.Source;
|
||||
if (newAffliction.Source != null) { existingAffliction.Source = newAffliction.Source; }
|
||||
CalculateVitality();
|
||||
if (Vitality <= MinVitality)
|
||||
{
|
||||
@@ -767,7 +772,6 @@ namespace Barotrauma
|
||||
|
||||
Character.StackSpeedMultiplier(1f + Character.GetStatValue(StatTypes.MovementSpeed));
|
||||
|
||||
// maybe a bit of a hacky way to do this. should inquire if there is a better way. M61T
|
||||
if (Character.InWater)
|
||||
{
|
||||
Character.StackSpeedMultiplier(1f + Character.GetStatValue(StatTypes.SwimmingSpeed));
|
||||
|
||||
Reference in New Issue
Block a user