Build 0.21.6.0 (1.0 pre-patch)

This commit is contained in:
Regalis11
2023-01-31 18:08:26 +02:00
parent e1c04bc31d
commit cf9ecd35b3
231 changed files with 4479 additions and 2276 deletions
@@ -200,7 +200,7 @@ namespace Barotrauma
}
}
}
partial class Limb : ISerializableEntity, ISpatialEntity
{
//how long it takes for severed limbs to fade out
@@ -215,7 +215,7 @@ namespace Barotrauma
//the physics body of the limb
public PhysicsBody body;
public Vector2 StepOffset => ConvertUnits.ToSimUnits(Params.StepOffset) * ragdoll.RagdollParams.JointScale;
public Hull Hull;
@@ -249,7 +249,7 @@ namespace Barotrauma
}
}
}
private bool isSevered;
private float severedFadeOutTimer;
@@ -269,7 +269,7 @@ namespace Barotrauma
mouthPos = value;
}
}
public readonly Attack attack;
public List<DamageModifier> DamageModifiers { get; private set; } = new List<DamageModifier>();
@@ -282,39 +282,73 @@ namespace Barotrauma
{
get
{
if (character.AnimController.CurrentAnimationParams is GroundedMovementParams)
if (character?.AnimController.CurrentAnimationParams is GroundedMovementParams && IsLeg)
{
switch (type)
{
case LimbType.LeftFoot:
case LimbType.LeftLeg:
case LimbType.LeftThigh:
case LimbType.RightFoot:
case LimbType.RightLeg:
case LimbType.RightThigh:
// Legs always has to flip
return true;
}
// Legs always has to flip when not swimming
return true;
}
return Params.Flip;
}
}
public bool DoesMirror
{
get
{
if (IsLeg)
{
// Legs always has to mirror
return true;
}
return DoesFlip;
}
}
public float SteerForce => Params.SteerForce;
public Vector2 DebugTargetPos;
public Vector2 DebugRefPos;
public bool IsLowerBody =>
type == LimbType.LeftLeg ||
type == LimbType.RightLeg ||
type == LimbType.LeftFoot ||
type == LimbType.RightFoot ||
type == LimbType.Tail ||
type == LimbType.Legs ||
type == LimbType.RightThigh ||
type == LimbType.LeftThigh ||
type == LimbType.Waist;
public bool IsLowerBody
{
get
{
switch (type)
{
case LimbType.LeftLeg:
case LimbType.RightLeg:
case LimbType.LeftFoot:
case LimbType.RightFoot:
case LimbType.Tail:
case LimbType.Legs:
case LimbType.LeftThigh:
case LimbType.RightThigh:
case LimbType.Waist:
return true;
default:
return false;
}
}
}
public bool IsLeg
{
get
{
switch (type)
{
case LimbType.LeftFoot:
case LimbType.LeftLeg:
case LimbType.LeftThigh:
case LimbType.RightFoot:
case LimbType.RightLeg:
case LimbType.RightThigh:
return true;
default:
return false;
}
}
}
public bool IsSevered
{
@@ -456,13 +490,9 @@ namespace Barotrauma
public int RefJointIndex => Params.RefJoint;
private List<WearableSprite> wearingItems;
public List<WearableSprite> WearingItems
{
get { return wearingItems; }
}
public readonly List<WearableSprite> WearingItems = new List<WearableSprite>();
public List<WearableSprite> OtherWearables { get; private set; } = new List<WearableSprite>();
public readonly List<WearableSprite> OtherWearables = new List<WearableSprite>();
public bool PullJointEnabled
{
@@ -606,7 +636,6 @@ namespace Barotrauma
this.ragdoll = ragdoll;
this.character = character;
this.Params = limbParams;
wearingItems = new List<WearableSprite>();
dir = Direction.Right;
body = new PhysicsBody(limbParams);
type = limbParams.Type;
@@ -738,7 +767,7 @@ namespace Barotrauma
tempModifiers.Add(damageModifier);
}
}
foreach (WearableSprite wearable in wearingItems)
foreach (WearableSprite wearable in WearingItems)
{
foreach (DamageModifier damageModifier in wearable.WearableComponent.DamageModifiers)
{
@@ -757,10 +786,14 @@ namespace Barotrauma
}
if (!foundMatchingModifier && random > affliction.Probability) { continue; }
float finalDamageModifier = damageMultiplier;
if (affliction.Prefab.AfflictionType == "emp" && character.EmpVulnerability > 0)
if (character.EmpVulnerability > 0 && affliction.Prefab.AfflictionType == "emp")
{
finalDamageModifier *= character.EmpVulnerability;
}
if (!character.Params.Health.PoisonImmunity && (affliction.Prefab.AfflictionType == "poison" || affliction.Prefab.AfflictionType == "paralysis"))
{
finalDamageModifier *= character.PoisonVulnerability;
}
foreach (DamageModifier damageModifier in tempModifiers)
{
float damageModifierValue = damageModifier.DamageMultiplier;