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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user