New pump & railguncont sprites, saving fixes (disappearing items fixed?), moving LightManager.ViewPos to railgun when aiming, generating waypoints outside sub, easier wire node editing, characters stand when using a controller, shiftsummary crew status scrolling, stuff

This commit is contained in:
Regalis
2016-01-04 01:03:37 +02:00
parent cb1513f5e6
commit bc9ff32023
29 changed files with 279 additions and 126 deletions

View File

@@ -7,7 +7,8 @@ namespace Barotrauma.Lights
{
class LightManager
{
public static Vector2 ViewPos;
//public static Vector2 ViewPos;
public static Entity ViewTarget;
public Color AmbientLight;
@@ -58,9 +59,11 @@ namespace Barotrauma.Lights
lights.Remove(light);
}
public void DrawLOS(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, Vector2 pos)
public void DrawLOS(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam)
{
if (!LosEnabled) return;
if (!LosEnabled || ViewTarget==null) return;
Vector2 pos = ViewTarget.WorldPosition;
Rectangle camView = new Rectangle(cam.WorldView.X, cam.WorldView.Y - cam.WorldView.Height, cam.WorldView.Width, cam.WorldView.Height);
@@ -167,13 +170,13 @@ namespace Barotrauma.Lights
spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, cam.Transform);
Vector2 diff = lookAtPosition - ViewPos;
Vector2 diff = lookAtPosition - ViewTarget.WorldPosition;
diff.Y = -diff.Y;
float rotation = MathUtils.VectorToAngle(diff);
Vector2 scale = new Vector2(MathHelper.Clamp(diff.Length()/256.0f, 2.0f, 5.0f), 2.0f);
spriteBatch.Draw(visionCircle, new Vector2(ViewPos.X, -ViewPos.Y), null, Color.White, rotation,
spriteBatch.Draw(visionCircle, new Vector2(ViewTarget.WorldPosition.X, -ViewTarget.WorldPosition.Y), null, Color.White, rotation,
new Vector2(LightSource.LightTexture.Width*0.2f, LightSource.LightTexture.Height/2), scale, SpriteEffects.None, 0.0f);
spriteBatch.End();

View File

@@ -232,21 +232,19 @@ namespace Barotrauma
/// </summary>
public static void UpdateSelecting(Camera cam)
{
if (DisableSelect)
{
DisableSelect = false;
return;
}
foreach (MapEntity e in mapEntityList)
{
e.isHighlighted = false;
e.isSelected = false;
}
if (GUIComponent.MouseOn != null) return;
if (DisableSelect)
{
DisableSelect = false;
return;
}
if (GUIComponent.MouseOn != null || !PlayerInput.MouseInsideWindow) return;
if (MapEntityPrefab.Selected != null)
{
@@ -261,8 +259,7 @@ namespace Barotrauma
selectedList.Clear();
}
Vector2 position = new Vector2(PlayerInput.GetMouseState.X, PlayerInput.GetMouseState.Y);
position = cam.ScreenToWorld(position);
Vector2 position = cam.ScreenToWorld(PlayerInput.MousePosition);
MapEntity highLightedEntity = null;

View File

@@ -312,11 +312,11 @@ namespace Barotrauma
(Rand.Int(2) == 0) ? Borders.Y : Borders.Y - Borders.Height);
}
damagePos += submarine.Position + Submarine.HiddenSubPosition;
SoundPlayer.PlayDamageSound(DamageSoundType.Pressure, 50.0f, damagePos, 10000.0f);
GameMain.GameScreen.Cam.Shake = depth * PressureDamageMultiplier * 0.1f;
damagePos += submarine.Position + Submarine.HiddenSubPosition;
Explosion.RangedStructureDamage(damagePos, depth * PressureDamageMultiplier * 50.0f, depth * PressureDamageMultiplier);
//SoundPlayer.PlayDamageSound(DamageSoundType.StructureBlunt, Rand.Range(0.0f, 100.0f), damagePos, 5000.0f);

View File

@@ -249,6 +249,56 @@ namespace Barotrauma
}
}
float outSideWaypointInterval = 200.0f;
int outsideWaypointDist = 100;
Rectangle borders = new Rectangle(Submarine.Borders.X - outsideWaypointDist, Submarine.Borders.Y + outsideWaypointDist,
Submarine.Borders.Width + outsideWaypointDist*2, Submarine.Borders.Height+outsideWaypointDist*2);
WayPoint[,] cornerWaypoint = new WayPoint[2,2];
for (int i = 0; i<2; i++)
{
for (float x = borders.X + outSideWaypointInterval; x < borders.Right - outSideWaypointInterval; x += outSideWaypointInterval)
{
var wayPoint = new WayPoint(
new Vector2(x, borders.Y - borders.Height * i) + Submarine.HiddenSubPosition,
SpawnType.Path, Submarine.Loaded);
if (x == borders.X + outSideWaypointInterval)
{
cornerWaypoint[i, 0] = wayPoint;
}
else
{
wayPoint.ConnectTo(WayPoint.WayPointList[WayPointList.Count-2]);
}
}
cornerWaypoint[i, 1] = WayPoint.WayPointList[WayPointList.Count - 1];
}
for (int i = 0; i < 2; i++)
{
WayPoint wayPoint = null;
for (float y = borders.Y - borders.Height; y < borders.Y; y += outSideWaypointInterval)
{
wayPoint = new WayPoint(
new Vector2(borders.X + borders.Width * i, y) + Submarine.HiddenSubPosition,
SpawnType.Path, Submarine.Loaded);
if (y == borders.Y - borders.Height)
{
wayPoint.ConnectTo(cornerWaypoint[1, i]);
}
else
{
wayPoint.ConnectTo(WayPoint.WayPointList[WayPointList.Count - 2]);
}
}
wayPoint.ConnectTo(cornerWaypoint[0, i]);
}
List<Structure> stairList = new List<Structure>();
foreach (MapEntity me in MapEntity.mapEntityList)
{
@@ -292,7 +342,7 @@ namespace Barotrauma
for (int dir = -1; dir <= 1; dir += 2)
{
WayPoint closest = wayPoint.FindClosest(dir, true, 30.0f);
WayPoint closest = wayPoint.FindClosest(dir, true, gap.IsRoomToRoom ? 30.0f : outSideWaypointInterval/2.0f);
if (closest == null) continue;
wayPoint.ConnectTo(closest);
}