Online quest mode, fixed bug when swimming from hull to another, monitors with editable text, choosing exe in content package, monster quests, misc bugfixes
This commit is contained in:
@@ -48,7 +48,7 @@ namespace Subsurface
|
||||
|
||||
private Rectangle borders;
|
||||
|
||||
private List<Body> bodies = new List<Body>();
|
||||
private List<Body> bodies;
|
||||
|
||||
private List<Vector2> positionsOfInterest;
|
||||
|
||||
@@ -151,6 +151,8 @@ namespace Subsurface
|
||||
|
||||
List<Vector2> sites = new List<Vector2>();
|
||||
|
||||
bodies = new List<Body>();
|
||||
|
||||
Random rand = new Random(seed.GetHashCode());
|
||||
|
||||
float siteVariance = siteInterval * 0.8f;
|
||||
@@ -273,7 +275,7 @@ namespace Subsurface
|
||||
|
||||
var newPathCells = GeneratePath(rand, new List<Vector2> { start, end }, cells, pathBorders, 0.0f, 0.8f, mirror);
|
||||
|
||||
for (int n = 1; n < newPathCells.Count; n += 3)
|
||||
for (int n = 0; n < newPathCells.Count-5; n += 3)
|
||||
{
|
||||
positionsOfInterest.Add(newPathCells[n].Center);
|
||||
}
|
||||
@@ -681,9 +683,11 @@ int currentTargetIndex = 1;
|
||||
// cell.body.SetTransform(cell.body.Position + simAmount, cell.body.Rotation);
|
||||
//}
|
||||
|
||||
|
||||
int i = 0;
|
||||
foreach (Body body in bodies)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(i);
|
||||
i++;
|
||||
body.SetTransform(body.Position + simAmount, body.Rotation);
|
||||
}
|
||||
|
||||
@@ -943,6 +947,9 @@ int currentTargetIndex = 1;
|
||||
|
||||
cells = null;
|
||||
|
||||
bodies.Clear();
|
||||
bodies = null;
|
||||
|
||||
vertexBuffer.Dispose();
|
||||
vertexBuffer = null;
|
||||
}
|
||||
|
||||
@@ -388,8 +388,12 @@ namespace Subsurface
|
||||
if (quest==null || quest.Completed)
|
||||
{
|
||||
if (quest !=null && quest.Completed) questsCompleted++;
|
||||
Random rand = new Random(GetHashCode() + questsCompleted);
|
||||
quest = Quest.LoadRandom(rand);
|
||||
|
||||
int seed = (int)locations[0].MapPosition.X + (int)locations[0].MapPosition.Y * 100;
|
||||
seed += (int)locations[1].MapPosition.X*10000 + (int)locations[1].MapPosition.Y * 1000000;
|
||||
|
||||
Random rand = new Random(seed + questsCompleted);
|
||||
quest = Quest.LoadRandom(locations, rand);
|
||||
}
|
||||
|
||||
return quest;
|
||||
|
||||
@@ -343,12 +343,16 @@ namespace Subsurface
|
||||
return closestBody;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// check visibility between two points (in sim units)
|
||||
/// </summary>
|
||||
/// <returns>a physics body that was between the points (or null)</returns>
|
||||
public static Body CheckVisibility(Vector2 rayStart, Vector2 rayEnd)
|
||||
{
|
||||
Body closestBody = null;
|
||||
float closestFraction = 1.0f;
|
||||
|
||||
if (Vector2.Distance(rayStart,rayEnd)<0.01f)
|
||||
if (Vector2.Distance(rayStart, rayEnd) < 0.01f)
|
||||
{
|
||||
closestFraction = 0.01f;
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user