Functional networkevent validation, functional single player saving, requireditem ui texts, titlescreen & loading

This commit is contained in:
Regalis
2015-07-19 02:44:42 +03:00
parent 237df18765
commit baa207985c
78 changed files with 1237 additions and 596 deletions

View File

@@ -82,7 +82,13 @@ namespace Subsurface
get { return seed; }
}
public Level(string seed, int width, int height, int siteInterval)
public float Difficulty
{
get;
private set;
}
public Level(string seed, float difficulty, int width, int height, int siteInterval)
{
if (shaftTexture == null) shaftTexture = Game1.textureLoader.FromFile("Content/Map/shaft.png");
@@ -90,16 +96,24 @@ namespace Subsurface
this.siteInterval = siteInterval;
this.Difficulty = difficulty;
borders = new Rectangle(0, 0, width, height);
}
public static Level CreateRandom(LocationConnection locationConnection)
{
int seed = locationConnection.Locations[0].GetHashCode() | locationConnection.Locations[1].GetHashCode();
return new Level(seed.ToString(), locationConnection.Difficulty, 100000, 40000, 2000);
}
public static Level CreateRandom(string seed = "")
{
if (seed == "")
{
seed = Rand.Range(0, int.MaxValue, false).ToString();
}
return new Level(seed, 100000, 40000, 2000);
return new Level(seed, Rand.Range(30.0f,80.0f,false), 100000, 40000, 2000);
}
public void Generate(float minWidth, bool mirror=false)