Unstable 0.15.15.0 (and the one before it I forgor)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Barotrauma.Extensions;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Voronoi2;
|
||||
|
||||
namespace Barotrauma.RuinGeneration
|
||||
@@ -41,6 +41,9 @@ namespace Barotrauma.RuinGeneration
|
||||
Submarine.Info.Name = $"Ruin ({level.Seed})";
|
||||
Submarine.Info.Type = SubmarineType.Ruin;
|
||||
Submarine.TeamID = CharacterTeamType.None;
|
||||
|
||||
//prevent the ruin from extending above the level "ceiling"
|
||||
position.Y = Math.Min(level.Size.Y - (Submarine.Borders.Height / 2) - 100, position.Y);
|
||||
Submarine.SetPosition(position.ToVector2());
|
||||
|
||||
if (mirror)
|
||||
@@ -52,9 +55,9 @@ namespace Barotrauma.RuinGeneration
|
||||
worldBorders.Location += Submarine.WorldPosition.ToPoint();
|
||||
Area = new Rectangle(worldBorders.X, worldBorders.Y - worldBorders.Height, worldBorders.Width, worldBorders.Height);
|
||||
|
||||
List<WayPoint> subWaypoints = WayPoint.WayPointList.FindAll(wp => wp.Submarine == Submarine);
|
||||
var waypoints = WayPoint.WayPointList.FindAll(wp => wp.Ruin == this || wp.Submarine == Submarine);
|
||||
int interestingPosCount = 0;
|
||||
foreach (WayPoint wp in subWaypoints)
|
||||
foreach (WayPoint wp in waypoints)
|
||||
{
|
||||
if (wp.SpawnType != SpawnType.Enemy) { continue; }
|
||||
level.PositionsOfInterest.Add(new Level.InterestingPosition(wp.WorldPosition.ToPoint(), Level.PositionType.Ruin, this));
|
||||
@@ -63,8 +66,8 @@ namespace Barotrauma.RuinGeneration
|
||||
|
||||
if (interestingPosCount == 0)
|
||||
{
|
||||
//make sure there's at least on PositionsOfInterest in the ruins
|
||||
level.PositionsOfInterest.Add(new Level.InterestingPosition(subWaypoints.GetRandom(Rand.RandSync.Server).WorldPosition.ToPoint(), Level.PositionType.Ruin, this));
|
||||
//make sure there's at least one PositionsOfInterest in the ruins
|
||||
level.PositionsOfInterest.Add(new Level.InterestingPosition(waypoints.GetRandom(Rand.RandSync.Server).WorldPosition.ToPoint(), Level.PositionType.Ruin, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user