Removing the obstruction element without flickering, better looking (& working) radar

This commit is contained in:
Regalis
2015-11-01 22:10:31 +02:00
parent 73bde75c2e
commit e4a048a54a
13 changed files with 167 additions and 57 deletions
+15 -7
View File
@@ -152,9 +152,17 @@ namespace Barotrauma
set { lowPassMultiplier = MathHelper.Clamp(value, 0.0f, 1.0f); }
}
private float obstructVisionAmount;
public bool ObstructVision
{
get; set;
get
{
return obstructVisionAmount > 0.5f;
}
set
{
obstructVisionAmount = 1.0f;
}
}
public float SoundRange
@@ -831,6 +839,8 @@ namespace Barotrauma
{
if (!Enabled) return;
obstructVisionAmount = Math.Max(obstructVisionAmount - deltaTime, 0.0f);
AnimController.SimplePhysicsEnabled = (Character.controlled != this && Vector2.Distance(cam.WorldViewCenter, Position) > 5000.0f);
if (isDead) return;
@@ -839,12 +849,11 @@ namespace Barotrauma
{
bool protectedFromPressure = PressureProtection > 0.0f;
if (Submarine.Loaded!=null && Level.Loaded !=null)
{
protectedFromPressure = protectedFromPressure && (Position-Level.Loaded.Position).Y > SubmarineBody.DamageDepth;
}
if (Submarine.Loaded!=null && Level.Loaded !=null)
{
protectedFromPressure = protectedFromPressure && (Position-Level.Loaded.Position).Y > SubmarineBody.DamageDepth;
}
if (!protectedFromPressure &&
(AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure >= 100.0f))
{
@@ -865,7 +874,6 @@ namespace Barotrauma
if (aiTarget != null) aiTarget.SoundRange = 0.0f;
lowPassMultiplier = MathHelper.Lerp(lowPassMultiplier, 1.0f, 0.1f);
ObstructVision = false;
if (needsAir)
{