Tweaked AITarget ranges: now it's possible to evade some monsters by stopping the sub and/or turning off noisy devices, AITarget ranges can be made visible by entering "ShowAITargets" in the console, misc cleanup

This commit is contained in:
Regalis
2016-03-12 21:35:08 +02:00
parent c99f94b1de
commit d713874bd6
11 changed files with 113 additions and 104 deletions

View File

@@ -59,7 +59,7 @@ namespace Barotrauma
get { return Submarine == null ? Position : Submarine.Position + Position; }
}
public Vector2 DrawPosition
public virtual Vector2 DrawPosition
{
get { return Submarine == null ? Position : Submarine.DrawPosition + Position; }
}

View File

@@ -201,7 +201,6 @@ namespace Barotrauma
surface = rect.Y - rect.Height;
aiTarget = new AITarget(this);
aiTarget.SightRange = (rect.Width + rect.Height)*5.0f;
hullList.Add(this);
@@ -353,6 +352,9 @@ namespace Barotrauma
FireSource.UpdateAll(fireSources, deltaTime);
aiTarget.SightRange = Submarine == null ? 0.0f : Submarine.Velocity.Length() * 500.0f;
aiTarget.SoundRange -= deltaTime*1000.0f;
float strongestFlow = 0.0f;
foreach (Gap gap in ConnectedGaps)
{
@@ -495,6 +497,8 @@ namespace Barotrauma
if (!ShowHulls && !GameMain.DebugDraw) return;
if (!editing && !GameMain.DebugDraw) return;
if (aiTarget != null) aiTarget.Draw(spriteBatch);
Rectangle drawRect =
Submarine == null ? rect : new Rectangle((int)(Submarine.DrawPosition.X + rect.X), (int)(Submarine.DrawPosition.Y + rect.Y), rect.Width, rect.Height);