(b35e82550) Added a longer delay to getting killed by pressure (5 seconds in max pressure), made the pressure-zoom-in effect appear as soon as the pressure in a room starts to rise (not after it's half-way to lethal pressure), added blood particle effects when under high pressure
This commit is contained in:
@@ -1898,15 +1898,22 @@ namespace Barotrauma
|
||||
//cannot be protected from pressure when below crush depth
|
||||
protectedFromPressure = protectedFromPressure && WorldPosition.Y > CharacterHealth.CrushDepth;
|
||||
//implode if not protected from pressure, and either outside or in a high-pressure hull
|
||||
if (!protectedFromPressure &&
|
||||
if (!protectedFromPressure &&
|
||||
(AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure >= 80.0f))
|
||||
{
|
||||
PressureTimer += ((AnimController.CurrentHull == null) ?
|
||||
100.0f : AnimController.CurrentHull.LethalPressure) * deltaTime;
|
||||
if (CharacterHealth.PressureKillDelay <= 0.0f)
|
||||
{
|
||||
PressureTimer = 100.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
PressureTimer += ((AnimController.CurrentHull == null) ?
|
||||
100.0f : AnimController.CurrentHull.LethalPressure) / CharacterHealth.PressureKillDelay * deltaTime;
|
||||
}
|
||||
|
||||
if (PressureTimer >= 100.0f)
|
||||
{
|
||||
if (Controlled == this) cam.Zoom = 5.0f;
|
||||
if (Controlled == this) { cam.Zoom = 5.0f; }
|
||||
if (GameMain.NetworkMember == null || !GameMain.NetworkMember.IsClient)
|
||||
{
|
||||
Implode();
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
public float CrushDepth { get; private set; }
|
||||
public float PressureKillDelay { get; private set; } = 5.0f;
|
||||
|
||||
public float Vitality { get; private set; }
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private float blinkTimer;
|
||||
|
||||
private bool itemLoaded;
|
||||
|
||||
private float blinkTimer;
|
||||
|
||||
public PhysicsBody ParentBody;
|
||||
|
||||
[Editable(MinValueFloat = 0.0f, MaxValueFloat = 2048.0f), Serialize(100.0f, true)]
|
||||
|
||||
Reference in New Issue
Block a user