Running speed can be adjusted from the character configs, added a parameter for the "running speed" in water (characters now swim faster when holding shift).

TODO: make AI-controlled monsters run/swim faster in specific situations (fleeing, attacking, etc).
This commit is contained in:
Joonas Rikkonen
2017-06-12 19:27:52 +03:00
parent ed0a5f0f66
commit c5ce1be6c2
6 changed files with 28 additions and 16 deletions
+2 -4
View File
@@ -785,16 +785,14 @@ namespace Barotrauma
if (IsKeyDown(InputType.Run))
{
//can't run if
// - not a humanoid
// - dragging someone
// - crouching
// - moving backwards
if (AnimController is HumanoidAnimController &&
selectedCharacter == null &&
if (selectedCharacter == null &&
!((HumanoidAnimController)AnimController).Crouching &&
Math.Sign(targetMovement.X) != -Math.Sign(AnimController.Dir))
{
targetMovement *= 3.0f;
targetMovement *= AnimController.InWater ? AnimController.SwimSpeedMultiplier : AnimController.RunSpeedMultiplier;
}
}