- camera follows the closest sub

- WIP "respawn shuttle"
- submarine size affects its mass
- electricity fixes
This commit is contained in:
Regalis
2016-06-18 14:46:40 +03:00
parent cf822cfae6
commit dc7956274c
23 changed files with 413 additions and 99 deletions
@@ -33,8 +33,10 @@ namespace Barotrauma.Items.Components
private float autopilotRayCastTimer;
private float neutralBallastLevel;
public Vector2? TargetPosition;
bool AutoPilot
public bool AutoPilot
{
get { return autoPilot; }
set
@@ -52,7 +54,7 @@ namespace Barotrauma.Items.Components
if (pathFinder==null) pathFinder = new PathFinder(WayPoint.WayPointList, false);
steeringPath = pathFinder.FindPath(
ConvertUnits.ToSimUnits(item.WorldPosition),
ConvertUnits.ToSimUnits(Level.Loaded.EndPosition));
TargetPosition == null ? ConvertUnits.ToSimUnits(Level.Loaded.EndPosition) : (Vector2)TargetPosition);
}
else
{
@@ -62,6 +64,12 @@ namespace Barotrauma.Items.Components
}
}
public bool MaintainPos
{
get { return maintainPosTickBox.Selected; }
set { maintainPosTickBox.Selected = value; }
}
[Editable, HasDefaultValue(0.5f, true)]
public float NeutralBallastLevel
@@ -128,7 +136,7 @@ namespace Barotrauma.Items.Components
}
}
if (voltage < minVoltage) return;
if (voltage < minVoltage && powerConsumption > 0.0f) return;
if (autoPilot)
{
@@ -158,7 +166,7 @@ namespace Barotrauma.Items.Components
GuiFrame.Update(1.0f / 60.0f);
GuiFrame.Draw(spriteBatch);
if (voltage < minVoltage) return;
if (voltage < minVoltage && powerConsumption > 0.0f) return;
Rectangle velRect = new Rectangle(x + 20, y + 20, width - 40, height - 40);
//GUI.DrawRectangle(spriteBatch, velRect, Color.White, false);