v0.10.5.1

This commit is contained in:
Juan Pablo Arce
2020-09-22 11:31:56 -03:00
parent 44032d0ae0
commit 0002ad2c50
343 changed files with 12276 additions and 5023 deletions
@@ -613,8 +613,13 @@ namespace Barotrauma
movementAngle -= MathHelper.TwoPi;
}
float offset = MathHelper.Pi * CurrentGroundedParams.StepLiftOffset;
if (CurrentGroundedParams.MultiplyByDir)
{
offset *= Dir;
}
float stepLift = TargetMovement.X == 0.0f ? 0 :
(float)Math.Sin(WalkPos * CurrentGroundedParams.StepLiftFrequency + MathHelper.Pi * CurrentGroundedParams.StepLiftOffset) * (CurrentGroundedParams.StepLiftAmount / 100);
(float)Math.Sin(WalkPos * Dir * CurrentGroundedParams.StepLiftFrequency + offset) * (CurrentGroundedParams.StepLiftAmount / 100);
float limpAmount = character.GetLegPenalty();
if (limpAmount > 0)
@@ -631,7 +636,7 @@ namespace Barotrauma
{
SmoothRotateWithoutWrapping(torso, movementAngle + TorsoAngle.Value * Dir, mainLimb, TorsoTorque);
}
if (TorsoPosition.HasValue)
if (TorsoPosition.HasValue && TorsoMoveForce > 0.0f)
{
Vector2 pos = colliderBottom + new Vector2(limpAmount, TorsoPosition.Value + stepLift);
@@ -649,11 +654,16 @@ namespace Barotrauma
Limb head = GetLimb(LimbType.Head);
if (head != null)
{
bool headFacingBackwards = false;
if (HeadAngle.HasValue)
{
SmoothRotateWithoutWrapping(head, movementAngle + HeadAngle.Value * Dir, mainLimb, HeadTorque);
if (Math.Sign(head.SimPosition.X - mainLimb.SimPosition.X) != Math.Sign(Dir))
{
headFacingBackwards = true;
}
}
if (HeadPosition.HasValue)
if (HeadPosition.HasValue && HeadMoveForce > 0.0f && !headFacingBackwards)
{
Vector2 pos = colliderBottom + new Vector2(limpAmount, HeadPosition.Value + stepLift * CurrentGroundedParams.StepLiftHeadMultiplier);
@@ -1873,6 +1873,7 @@ namespace Barotrauma
forearm = GetLimb(LimbType.RightForearm);
RightHandIKPos = pos;
}
if (arm == null) { return; }
//distance from shoulder to holdpos
float c = Vector2.Distance(pos, shoulderPos);
@@ -2018,12 +2019,9 @@ namespace Barotrauma
{
break;
}
if (character.SelectedItems[i]?.body != null && !character.SelectedItems[i].Removed)
if (character.SelectedItems[i]?.body != null && !character.SelectedItems[i].Removed && character.SelectedItems[i].GetComponent<Holdable>() != null)
{
/*character.SelectedItems[i].body.SetTransform(
character.SelectedItems[i].body.SimPosition,
MathUtils.WrapAngleTwoPi(character.SelectedItems[i].body.Rotation + MathHelper.Pi));*/
character.SelectedItems[i].GetComponent<Holdable>()?.Flip();
character.SelectedItems[i].FlipX(relativeToSub: false);
}
}
@@ -764,6 +764,13 @@ namespace Barotrauma
}
}
if (!string.IsNullOrEmpty(character.BloodDecalName))
{
character.CurrentHull?.AddDecal(character.BloodDecalName,
(limbJoint.LimbA.WorldPosition + limbJoint.LimbB.WorldPosition) / 2, MathHelper.Clamp(Math.Min(limbJoint.LimbA.Mass, limbJoint.LimbB.Mass), 0.5f, 2.0f), true);
}
SeverLimbJointProjSpecific(limbJoint, playSound: true);
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer)
{
@@ -1430,6 +1437,11 @@ namespace Barotrauma
}
}
public void ForceRefreshFloorY()
{
lastFloorCheckPos = Vector2.Zero;
}
private void RefreshFloorY(Limb refLimb = null, bool ignoreStairs = false)
{
PhysicsBody refBody = refLimb == null ? Collider : refLimb.body;