(bf212a41f) v0.9.2.0 pre-release test version
This commit is contained in:
@@ -286,7 +286,7 @@ namespace Barotrauma
|
||||
var waistJoint = GetJointBetweenLimbs(LimbType.Waist, upperLegType);
|
||||
Vector2 localAnchorWaist = Vector2.Zero;
|
||||
Vector2 localAnchorKnee = Vector2.Zero;
|
||||
if (shoulder != null)
|
||||
if (waistJoint != null)
|
||||
{
|
||||
localAnchorWaist = waistJoint.LimbA.type == upperLegType ? waistJoint.LocalAnchorA : waistJoint.LocalAnchorB;
|
||||
}
|
||||
@@ -298,6 +298,7 @@ namespace Barotrauma
|
||||
upperLegLength = Vector2.Distance(localAnchorWaist, localAnchorKnee);
|
||||
|
||||
LimbJoint ankleJoint = GetJointBetweenLimbs(lowerLegType, footType);
|
||||
if (ankleJoint == null || kneeJoint == null) { return; }
|
||||
lowerLegLength = Vector2.Distance(
|
||||
kneeJoint.LimbA.type == lowerLegType ? kneeJoint.LocalAnchorA : kneeJoint.LocalAnchorB,
|
||||
ankleJoint.LimbA.type == lowerLegType ? ankleJoint.LocalAnchorA : ankleJoint.LocalAnchorB);
|
||||
@@ -537,14 +538,13 @@ namespace Barotrauma
|
||||
|
||||
float limpAmount =
|
||||
character.CharacterHealth.GetAfflictionStrength("damage", leftFoot, true) +
|
||||
character.CharacterHealth.GetAfflictionStrength("damage", rightFoot, true);
|
||||
character.CharacterHealth.GetAfflictionStrength("damage", rightFoot, true) +
|
||||
character.CharacterHealth.GetAfflictionStrength("spaceherpes");
|
||||
limpAmount = MathHelper.Clamp(limpAmount / 100.0f, 0.0f, 1.0f);
|
||||
|
||||
float walkCycleMultiplier = 1.0f;
|
||||
if (Stairs != null)
|
||||
{
|
||||
//TODO: allow editing these values in character editor?
|
||||
bool running = Math.Abs(targetMovement.X) > 2.0f;
|
||||
TargetMovement = new Vector2(MathHelper.Clamp(TargetMovement.X, -1.7f, 1.7f), TargetMovement.Y);
|
||||
walkCycleMultiplier *= 1.5f;
|
||||
}
|
||||
@@ -579,7 +579,7 @@ namespace Barotrauma
|
||||
if (limpAmount > 0.0f)
|
||||
{
|
||||
//make the footpos oscillate when limping
|
||||
footMid += (Math.Max(Math.Abs(walkPosX) * limpAmount, 0.0f) * Math.Min(Math.Abs(TargetMovement.X), 0.3f));
|
||||
footMid += (Math.Max(Math.Abs(walkPosX) * limpAmount, 0.0f) * Math.Min(Math.Abs(TargetMovement.X), 0.3f)) * Dir;
|
||||
}
|
||||
|
||||
movement = overrideTargetMovement == Vector2.Zero ?
|
||||
@@ -663,7 +663,13 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (TorsoAngle.HasValue) torso.body.SmoothRotate(TorsoAngle.Value * Dir, 50.0f);
|
||||
if (TorsoAngle.HasValue)
|
||||
{
|
||||
float torsoAngle = TorsoAngle.Value;
|
||||
float herpesStrength = character.CharacterHealth.GetAfflictionStrength("spaceherpes");
|
||||
torsoAngle -= herpesStrength / 150.0f;
|
||||
torso.body.SmoothRotate(torsoAngle * Dir, 50.0f);
|
||||
}
|
||||
if (HeadAngle.HasValue) head.body.SmoothRotate(HeadAngle.Value * Dir, 50.0f);
|
||||
|
||||
if (!onGround)
|
||||
@@ -689,7 +695,6 @@ namespace Barotrauma
|
||||
for (int i = -1; i < 2; i += 2)
|
||||
{
|
||||
Limb foot = i == -1 ? leftFoot : rightFoot;
|
||||
Limb leg = i == -1 ? leftLeg : rightLeg;
|
||||
|
||||
Vector2 footPos = stepSize * -i;
|
||||
footPos += new Vector2(Math.Sign(movement.X) * FootMoveOffset.X, FootMoveOffset.Y);
|
||||
@@ -706,6 +711,15 @@ namespace Barotrauma
|
||||
}
|
||||
footPos.Y = Math.Min(waistPos.Y - colliderPos.Y - 0.4f, footPos.Y);
|
||||
|
||||
#if CLIENT
|
||||
if ((i == 1 && Math.Sign(Math.Sin(WalkPos)) > 0 && Math.Sign(walkPosY) < 0) ||
|
||||
(i == -1 && Math.Sign(Math.Sin(WalkPos)) < 0 && Math.Sign(walkPosY) > 0))
|
||||
{
|
||||
PlayImpactSound(foot);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (!foot.Disabled)
|
||||
{
|
||||
foot.DebugRefPos = colliderPos;
|
||||
@@ -766,7 +780,6 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
var foot = i == -1 ? rightFoot : leftFoot;
|
||||
Limb leg = i == -1 ? rightLeg : leftLeg;
|
||||
|
||||
if (!foot.Disabled)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user