From 397e6a5a9752c9ef2e43df64c2560cf97c087cb1 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 22 Jun 2017 19:04:22 +0300 Subject: [PATCH] The camera zooms out further when controlling a large non-humanoid character --- Barotrauma/Source/Characters/Character.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Barotrauma/Source/Characters/Character.cs b/Barotrauma/Source/Characters/Character.cs index 06449f436..471a0aab2 100644 --- a/Barotrauma/Source/Characters/Character.cs +++ b/Barotrauma/Source/Characters/Character.cs @@ -1159,9 +1159,10 @@ namespace Barotrauma } } - if (moveCam && needsAir) + if (moveCam) { - if (pressureProtection < 80.0f && + if (needsAir && + pressureProtection < 80.0f && (AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure > 50.0f)) { float pressure = AnimController.CurrentHull == null ? 100.0f : AnimController.CurrentHull.LethalPressure; @@ -1170,7 +1171,16 @@ namespace Barotrauma (pressure / 50.0f) * Rand.Range(1.0f, 1.05f), (pressure - 50.0f) / 50.0f); } - cam.OffsetAmount = MathHelper.Lerp(cam.OffsetAmount, 250.0f, 0.05f); + + if (IsHumanoid) + { + cam.OffsetAmount = MathHelper.Lerp(cam.OffsetAmount, 250.0f, deltaTime); + } + else + { + //increased visibility range when controlling large a non-humanoid + cam.OffsetAmount = MathHelper.Lerp(cam.OffsetAmount, MathHelper.Clamp(Mass, 250.0f, 800.0f), deltaTime); + } } cursorPosition = cam.ScreenToWorld(PlayerInput.MousePosition);