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
+20 -2
View File
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
namespace Subsurface
{
@@ -61,8 +62,25 @@ namespace Subsurface
private void CreateScriptedEvents(Level level)
{
ScriptedEvent scriptedEvent = ScriptedEvent.LoadRandom(level.Seed);
AddTask(new ScriptedTask(scriptedEvent));
Random rand = new Random(level.Seed.GetHashCode());
float totalDifficulty = level.Difficulty;
int tries = 0;
do
{
ScriptedEvent scriptedEvent = ScriptedEvent.LoadRandom(rand);
if (scriptedEvent==null || scriptedEvent.Difficulty > totalDifficulty)
{
tries++;
continue;
}
AddTask(new ScriptedTask(scriptedEvent));
totalDifficulty -= scriptedEvent.Difficulty;
tries = 0;
} while (tries < 5);
}
public void TaskStarted(Task task)