Added collider to humanhusk.xml, disabled the "zoom effect" when under pressure as a huskified human

This commit is contained in:
Regalis
2016-11-08 20:15:59 +02:00
parent cd5c72eff2
commit 1dc08b3019
2 changed files with 13 additions and 9 deletions
@@ -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">
<collider height="100" radius="15"/>
<!-- head -->
<limb id = "0" radius="13" mass = "6" type="Head" attackpriority="2">
+8 -7
View File
@@ -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);