Progress
This commit is contained in:
@@ -76,7 +76,7 @@
|
|||||||
<sound file ="Content/step.ogg"/>
|
<sound file ="Content/step.ogg"/>
|
||||||
</limb>
|
</limb>
|
||||||
|
|
||||||
<limb id = "13" height="100" radius="15" mass = "6" type="Controller" attackpriority="2" impacttolerance="5000.0">
|
<limb id = "13" height="130" radius="15" mass = "6" type="Controller" attackpriority="2" impacttolerance="5000.0">
|
||||||
<sprite texture="Content/Characters/Human/[GENDER]head[HEADID].png" sourcerect="1,1,1,1" depth="0.0" origin="0.5,0.5"/>
|
<sprite texture="Content/Characters/Human/[GENDER]head[HEADID].png" sourcerect="1,1,1,1" depth="0.0" origin="0.5,0.5"/>
|
||||||
</limb>
|
</limb>
|
||||||
|
|
||||||
|
|||||||
@@ -348,12 +348,12 @@ namespace Barotrauma
|
|||||||
TargetMovement.X < 0.0f && stairs.StairDirection == Direction.Left)
|
TargetMovement.X < 0.0f && stairs.StairDirection == Direction.Left)
|
||||||
{
|
{
|
||||||
TargetMovement *= 1.7f;
|
TargetMovement *= 1.7f;
|
||||||
walkCycleSpeed *= 1.7f;
|
walkCycleSpeed *= 2.0f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TargetMovement /= 1.0f;
|
TargetMovement /= 1.0f;
|
||||||
walkCycleSpeed *= 1.5f;
|
walkCycleSpeed *= 2.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,7 +414,12 @@ namespace Barotrauma
|
|||||||
|
|
||||||
//if (LowestLimb == null) return;
|
//if (LowestLimb == null) return;
|
||||||
|
|
||||||
if (onGround) collider.body.LinearVelocity = new Vector2(movement.X * 1.5f, collider.LinearVelocity.Y);
|
if (onGround)
|
||||||
|
{
|
||||||
|
collider.body.LinearVelocity = new Vector2(
|
||||||
|
movement.X * 1.5f,
|
||||||
|
collider.LinearVelocity.Y > 0.0f ? collider.LinearVelocity.Y * 0.5f : collider.LinearVelocity.Y);
|
||||||
|
}
|
||||||
|
|
||||||
//float? ceilingY = null;
|
//float? ceilingY = null;
|
||||||
//if (Submarine.PickBody(head.SimPosition, head.SimPosition + Vector2.UnitY, null, Physics.CollisionWall)!=null)
|
//if (Submarine.PickBody(head.SimPosition, head.SimPosition + Vector2.UnitY, null, Physics.CollisionWall)!=null)
|
||||||
@@ -826,14 +831,18 @@ namespace Barotrauma
|
|||||||
ladderSimPos += character.SelectedConstruction.Submarine.SimPosition - currentHull.Submarine.SimPosition;
|
ladderSimPos += character.SelectedConstruction.Submarine.SimPosition - currentHull.Submarine.SimPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
MoveLimb(head, new Vector2(ladderSimPos.X - 0.27f * Dir, head.SimPosition.Y + 0.05f), 10.5f);
|
|
||||||
MoveLimb(torso, new Vector2(ladderSimPos.X - 0.27f * Dir, torso.SimPosition.Y), 10.5f);
|
|
||||||
MoveLimb(waist, new Vector2(ladderSimPos.X - 0.35f * Dir, waist.SimPosition.Y), 10.5f);
|
|
||||||
|
|
||||||
|
|
||||||
|
MoveLimb(head, new Vector2(ladderSimPos.X - 0.27f * Dir, collider.SimPosition.Y + 0.7f), 10.5f);
|
||||||
|
MoveLimb(torso, new Vector2(ladderSimPos.X - 0.27f * Dir, collider.SimPosition.Y+0.5f), 10.5f);
|
||||||
|
MoveLimb(waist, new Vector2(ladderSimPos.X - 0.35f * Dir, collider.SimPosition.Y+0.4f), 10.5f);
|
||||||
|
|
||||||
|
|
||||||
|
MoveLimb(collider, new Vector2(ladderSimPos.X - 0.2f * Dir, collider.SimPosition.Y), 10.5f);
|
||||||
|
|
||||||
Vector2 handPos = new Vector2(
|
Vector2 handPos = new Vector2(
|
||||||
ladderSimPos.X,
|
ladderSimPos.X,
|
||||||
head.SimPosition.Y + movement.Y * 0.1f - ladderSimPos.Y);
|
collider.SimPosition.Y + 0.6f + movement.Y * 0.1f - ladderSimPos.Y);
|
||||||
|
|
||||||
handPos.Y = Math.Min(-0.5f, handPos.Y);
|
handPos.Y = Math.Min(-0.5f, handPos.Y);
|
||||||
|
|
||||||
@@ -852,7 +861,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
Vector2 footPos = new Vector2(
|
Vector2 footPos = new Vector2(
|
||||||
handPos.X - Dir * 0.05f,
|
handPos.X - Dir * 0.05f,
|
||||||
head.SimPosition.Y - stepHeight * 2.7f - ladderSimPos.Y - 0.7f);
|
collider.SimPosition.Y + 0.7f - stepHeight * 2.7f - ladderSimPos.Y - 0.7f);
|
||||||
|
|
||||||
//if (movement.Y < 0) footPos.Y += 0.05f;
|
//if (movement.Y < 0) footPos.Y += 0.05f;
|
||||||
|
|
||||||
@@ -880,9 +889,10 @@ namespace Barotrauma
|
|||||||
Vector2 subSpeed = currentHull != null || character.SelectedConstruction.Submarine == null
|
Vector2 subSpeed = currentHull != null || character.SelectedConstruction.Submarine == null
|
||||||
? Vector2.Zero : character.SelectedConstruction.Submarine.Velocity;
|
? Vector2.Zero : character.SelectedConstruction.Submarine.Velocity;
|
||||||
|
|
||||||
Vector2 climbForce = new Vector2(0.0f, movement.Y + (inWater ? -0.05f : 0.6f)) * movementFactor;
|
Vector2 climbForce = new Vector2(0.0f, movement.Y + 0.3f) * movementFactor;
|
||||||
if (climbForce.Y > 0.5f) climbForce.Y = Math.Max(climbForce.Y, 1.3f);
|
//if (climbForce.Y > 0.5f) climbForce.Y = Math.Max(climbForce.Y, 1.3f);
|
||||||
torso.body.ApplyForce((climbForce * 40.0f + subSpeed * 50.0f) * torso.Mass);
|
|
||||||
|
collider.body.ApplyForce((climbForce * 20.0f + subSpeed * 50.0f) * collider.Mass);
|
||||||
head.body.SmoothRotate(0.0f);
|
head.body.SmoothRotate(0.0f);
|
||||||
|
|
||||||
if (!character.SelectedConstruction.Prefab.Triggers.Any())
|
if (!character.SelectedConstruction.Prefab.Triggers.Any())
|
||||||
|
|||||||
@@ -361,19 +361,29 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
else if (structure.StairDirection != Direction.None)
|
else if (structure.StairDirection != Direction.None)
|
||||||
{
|
{
|
||||||
|
stairs = null;
|
||||||
|
|
||||||
|
//---------------
|
||||||
|
|
||||||
float stairBottomPos = ConvertUnits.ToSimUnits(structure.Rect.Y - structure.Rect.Height + 10);
|
float stairBottomPos = ConvertUnits.ToSimUnits(structure.Rect.Y - structure.Rect.Height + 10);
|
||||||
if (colliderBottom.Y < stairBottomPos && targetMovement.Y < 0.5f)
|
if (colliderBottom.Y < stairBottomPos && targetMovement.Y < 0.5f) return false;
|
||||||
{
|
|
||||||
stairs = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (targetMovement.Y >= 0.0f && colliderBottom.Y > ConvertUnits.ToSimUnits(structure.Rect.Y - Submarine.GridSize.Y * 8.0f))
|
//---------------
|
||||||
{
|
|
||||||
stairs = null;
|
if (targetMovement.Y >= 0.0f && colliderBottom.Y >= ConvertUnits.ToSimUnits(structure.Rect.Y - Submarine.GridSize.Y*5)) return false;
|
||||||
return false;
|
|
||||||
}
|
//---------------
|
||||||
|
|
||||||
|
if (contact.Manifold.LocalNormal.Y < 0.0f) return false;
|
||||||
|
|
||||||
|
//---------------
|
||||||
|
|
||||||
|
Vector2 normal; FarseerPhysics.Common.FixedArray2<Vector2> points;
|
||||||
|
|
||||||
|
contact.GetWorldManifold(out normal, out points);
|
||||||
|
if (points[0].Y > collider.SimPosition.Y) return false;
|
||||||
|
|
||||||
|
//---------------
|
||||||
|
|
||||||
stairs = structure;
|
stairs = structure;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user