- fixed ruin doors being placed outside corridors if the corridor passes through multiple rooms
- fog of war isn't drawn or updated when not controlling a character - fixed topmost cells in the level not being placed in the cellgrid array, causing them to be ignored when enlarging the main path for the sub - fixed slices of the diving suit sprite "bleeding" into the torso sprite
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
@@ -68,14 +68,14 @@
|
||||
fireproof="true"
|
||||
description="An atmospheric diving suit capable of withstanding the immense pressure under Europa's crust.">
|
||||
|
||||
<Sprite texture ="DivingSuit.png" sourcerect="82,0,46,128" depth="0.55"/>
|
||||
<Sprite texture ="DivingSuit.png" sourcerect="85,0,43,128" depth="0.55"/>
|
||||
|
||||
<Body width="37" height="113" density="15"/>
|
||||
|
||||
<Wearable slots="Head+Torso+Legs" armorvalue="10.0">
|
||||
<sprite texture="DivingSuit.png" limb="Head" sourcerect="0,0,1,1" origin="0.5,0.5" hidelimb="true"/>
|
||||
|
||||
<sprite texture="DivingSuit.png" limb="Torso" sourcerect="40,0,42,97" origin="0.5,0.55" depthlimb="Head" hidelimb="true"/>
|
||||
<sprite texture="DivingSuit.png" limb="Torso" sourcerect="42,0,42,97" origin="0.5,0.55" depthlimb="Head" hidelimb="true"/>
|
||||
|
||||
<sprite texture="DivingSuit.png" limb="RightHand" sourcerect="0,78,15,50" origin="0.45,0.4" hidelimb="true"/>
|
||||
<sprite texture="DivingSuit.png" limb="LeftHand" sourcerect="0,78,15,50" origin="0.45,0.4" hidelimb="true"/>
|
||||
|
||||
@@ -391,7 +391,7 @@ namespace Barotrauma
|
||||
{
|
||||
for (int y = 0; y < cellGrid.GetLength(1); y++)
|
||||
{
|
||||
cellGrid[x, y] .Clear();
|
||||
cellGrid[x, y].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,17 +402,10 @@ namespace Barotrauma
|
||||
|
||||
if (x < 0 || y < 0 || x >= cellGrid.GetLength(0) || y >= cellGrid.GetLength(1)) continue;
|
||||
|
||||
cellGrid[x,y].Add(cell);
|
||||
cellGrid[x, y].Add(cell);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Vector2 ruinSize = new Vector2(Rand.Range(5000.0f, 8000.0f, false), Rand.Range(5000.0f, 8000.0f, false));
|
||||
float ruinRadius = Math.Max(ruinSize.X, ruinSize.Y) * 0.5f;
|
||||
|
||||
@@ -844,9 +837,9 @@ namespace Barotrauma
|
||||
|
||||
List<VoronoiCell> cells = new List<VoronoiCell>();
|
||||
|
||||
for (int x = startX; x < endX; x++)
|
||||
for (int x = startX; x <= endX; x++)
|
||||
{
|
||||
for (int y = startY; y < endY; y++)
|
||||
for (int y = startY; y <= endY; y++)
|
||||
{
|
||||
foreach (VoronoiCell cell in cellGrid[x, y])
|
||||
{
|
||||
|
||||
@@ -256,37 +256,6 @@ namespace Barotrauma.RuinGeneration
|
||||
|
||||
rooms.Remove(entranceRoom);
|
||||
|
||||
//var startCell = closestPathCell;
|
||||
|
||||
//Rectangle startCellRect = new Rectangle(
|
||||
// (int)startCell.edges.Min(e => Math.Min(e.point1.X, e.point2.X)),
|
||||
// (int)startCell.edges.Min(e => Math.Min(e.point1.Y, e.point2.Y)),
|
||||
// (int)startCell.edges.Max(e => Math.Max(e.point1.X, e.point2.X)),
|
||||
// (int)startCell.edges.Max(e => Math.Max(e.point1.Y, e.point2.Y)));
|
||||
|
||||
//startCellRect.Width = startCellRect.Width - startCellRect.X;
|
||||
//startCellRect.Height = startCellRect.Height - startCellRect.Y;
|
||||
|
||||
//int startX = Math.Min(entranceRoom.Rect.Center.X, startCellRect.Center.X);
|
||||
//int endX = Math.Max(entranceRoom.Rect.Right, startCellRect.Right);
|
||||
|
||||
//int startY = Math.Min(entranceRoom.Rect.Center.Y, startCellRect.Center.Y);
|
||||
//int endY = Math.Max(entranceRoom.Rect.Bottom, startCellRect.Bottom);
|
||||
|
||||
//if (entranceRoom.Rect.X > startCellRect.X && entranceRoom.Rect.Right < startCellRect.Right)
|
||||
//{
|
||||
// corridors.Add(new Corridor(new Rectangle(entranceRoom.Rect.Center.X, startY, 128, endY - startY)));
|
||||
//}
|
||||
//else if (entranceRoom.Rect.Y > startCellRect.Y && entranceRoom.Rect.Bottom < startCellRect.Bottom)
|
||||
//{
|
||||
// corridors.Add(new Corridor(new Rectangle(startX, entranceRoom.Rect.Center.Y, endX - startX, 128)));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// corridors.Add(new Corridor(new Rectangle(startX, entranceRoom.Rect.Center.Y, endX - startX, 128)));
|
||||
// corridors.Add(new Corridor(new Rectangle(endX, startY, 128, endY - startY)));
|
||||
//}
|
||||
|
||||
//---------------------------
|
||||
|
||||
foreach (BTRoom leaf in rooms)
|
||||
@@ -418,13 +387,32 @@ namespace Barotrauma.RuinGeneration
|
||||
|
||||
foreach (Corridor corridor in corridors)
|
||||
{
|
||||
var door = RuinStructure.GetRandom(corridor.IsHorizontal ? RuinStructureType.Door : RuinStructureType.Hatch, Alignment.Center);
|
||||
if (door == null) continue;
|
||||
var doorPrefab = RuinStructure.GetRandom(corridor.IsHorizontal ? RuinStructureType.Door : RuinStructureType.Hatch, Alignment.Center);
|
||||
if (doorPrefab == null) continue;
|
||||
|
||||
var item = new Item(door.Prefab as ItemPrefab, corridor.Center - new Vector2(door.Prefab.sprite.size.X, -door.Prefab.sprite.size.Y)/2.0f, null);
|
||||
item.MoveWithLevel = true;
|
||||
//find all walls that are parallel to the corridor
|
||||
var suitableWalls = corridor.IsHorizontal ?
|
||||
corridor.Walls.FindAll(c => c.A.Y == c.B.Y) : corridor.Walls.FindAll(c => c.A.X == c.B.X);
|
||||
|
||||
item.GetComponent<Items.Components.Door>().IsOpen = Rand.Range(0.0f, 1.0f, false) < 0.8f;
|
||||
if (!suitableWalls.Any()) continue;
|
||||
|
||||
Vector2 doorPos = corridor.Center;
|
||||
|
||||
//choose a random wall to place the door next to
|
||||
var wall = suitableWalls[Rand.Int(suitableWalls.Count, false)];
|
||||
if (corridor.IsHorizontal)
|
||||
{
|
||||
doorPos.X = (wall.A.X + wall.B.X) / 2.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
doorPos.Y = (wall.A.Y + wall.B.Y) / 2.0f;
|
||||
}
|
||||
|
||||
var door = new Item(doorPrefab.Prefab as ItemPrefab, doorPos - new Vector2(doorPrefab.Prefab.sprite.size.X, -doorPrefab.Prefab.sprite.size.Y)/2.0f, null);
|
||||
door.MoveWithLevel = true;
|
||||
|
||||
door.GetComponent<Items.Components.Door>().IsOpen = Rand.Range(0.0f, 1.0f, false) < 0.8f;
|
||||
|
||||
if (sensorPrefab == null || wirePrefab == null) continue;
|
||||
|
||||
@@ -439,7 +427,7 @@ namespace Barotrauma.RuinGeneration
|
||||
var wire = new Item(wirePrefab, sensorRoom.Center, null).GetComponent<Items.Components.Wire>();
|
||||
wire.Item.MoveWithLevel = false;
|
||||
|
||||
var conn1 = item.Connections.Find(c => c.Name == "set_state");
|
||||
var conn1 = door.Connections.Find(c => c.Name == "set_state");
|
||||
conn1.AddLink(0, wire);
|
||||
wire.Connect(conn1, false);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Barotrauma.Lights
|
||||
|
||||
public void DrawLOS(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, Effect effect)
|
||||
{
|
||||
//if (!LosEnabled || ViewTarget==null) return;
|
||||
if (!LosEnabled || ViewTarget==null) return;
|
||||
|
||||
//Vector2 pos = ViewTarget.WorldPosition;
|
||||
|
||||
|
||||
@@ -316,7 +316,10 @@ namespace Barotrauma
|
||||
|
||||
GameMain.LightManager.DrawLightMap(spriteBatch, cam, blurEffect);
|
||||
|
||||
GameMain.LightManager.DrawLOS(graphics, spriteBatch, cam, blurEffect);
|
||||
if (Character.Controlled != null)
|
||||
{
|
||||
GameMain.LightManager.DrawLOS(graphics, spriteBatch, cam, blurEffect);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user