From 1dc08b3019050c865162ddcbd7943282684d3462 Mon Sep 17 00:00:00 2001 From: Regalis Date: Tue, 8 Nov 2016 20:15:59 +0200 Subject: [PATCH] Added collider to humanhusk.xml, disabled the "zoom effect" when under pressure as a huskified human --- Subsurface/Content/Characters/Human/humanhusk.xml | 7 +++++-- Subsurface/Source/Characters/Character.cs | 15 ++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Subsurface/Content/Characters/Human/humanhusk.xml b/Subsurface/Content/Characters/Human/humanhusk.xml index fc593f3ad..73b9e9e13 100644 --- a/Subsurface/Content/Characters/Human/humanhusk.xml +++ b/Subsurface/Content/Characters/Human/humanhusk.xml @@ -9,8 +9,11 @@ movementlerp="0.4" legtorque="15.0" thightorque="-5.0" - walkspeed="2.0" - swimspeed="2.0"> + walkspeed="1.5" + swimspeed="2.5" + impacttolerance="7.5"> + + diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index 58e1841f1..0d5af0dc8 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -1052,17 +1052,18 @@ namespace Barotrauma } } - if (moveCam) + if (moveCam && needsAir) { - float pressureEffect = 0.0f; - - if (pressureProtection < 80.0f && AnimController.CurrentHull != null && AnimController.CurrentHull.LethalPressure > 50.0f) + if (pressureProtection < 80.0f && + (AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure > 50.0f)) { + float pressure = AnimController.CurrentHull == null ? 100.0f : AnimController.CurrentHull.LethalPressure; + cam.Zoom = MathHelper.Lerp(cam.Zoom, - (AnimController.CurrentHull.LethalPressure / 50.0f) * Rand.Range(1.0f, 1.05f), - (AnimController.CurrentHull.LethalPressure - 50.0f) / 50.0f); + (pressure / 50.0f) * Rand.Range(1.0f, 1.05f), + (pressure - 50.0f) / 50.0f); } - cam.OffsetAmount = MathHelper.Lerp(cam.OffsetAmount, (Submarine == null ? 400.0f : 250.0f)+pressureEffect, 0.05f); + cam.OffsetAmount = MathHelper.Lerp(cam.OffsetAmount, 250.0f, 0.05f); } cursorPosition = cam.ScreenToWorld(PlayerInput.MousePosition);