Hydrothermal vents emit sounds & being inside the smoke makes the camera shake

This commit is contained in:
Joonas Rikkonen
2017-08-24 20:25:17 +03:00
parent 4bdbf05875
commit 65094a02c1
2 changed files with 17 additions and 5 deletions
@@ -23,6 +23,8 @@ namespace Barotrauma
private List<Entity> triggerers = new List<Entity>();
private float cameraShake;
public Vector2 WorldPosition
{
get { return ConvertUnits.ToDisplayUnits(physicsBody.Position); }
@@ -52,6 +54,8 @@ namespace Barotrauma
physicsBody.FarseerBody.IsKinematic = true;
physicsBody.SetTransform(ConvertUnits.ToSimUnits(position), rotation);
cameraShake = ToolBox.GetAttributeFloat(element, "camerashake", 0.0f);
foreach (XElement subElement in element.Elements())
{
@@ -128,6 +132,11 @@ namespace Barotrauma
attack.DoDamage(null, damageable, WorldPosition, deltaTime, false);
}
}
if (triggerer == Character.Controlled || triggerer == Character.Controlled?.Submarine)
{
GameMain.GameScreen.Cam.Shake = Math.Max(GameMain.GameScreen.Cam.Shake, cameraShake);
}
}
}
}