Fixed server end cinematic, bugfix in submarine position syncing, CharacterIgnoreDistance bugfix, readded crew button to multiplayer, searching a path out of the sub

This commit is contained in:
Regalis
2016-01-06 20:17:41 +02:00
parent ca7febfcab
commit 48eabedb77
17 changed files with 156 additions and 57 deletions

View File

@@ -596,27 +596,51 @@ namespace Barotrauma.Networking
Character.Controlled = null;
GameMain.LightManager.LosEnabled = false;
float endPreviewLength = 10.0f;
DateTime endTime = DateTime.Now + new TimeSpan(0,0,0,0,(int)(1000.0f*endPreviewLength));
var cinematic = new TransitionCinematic(Submarine.Loaded, GameMain.GameScreen.Cam, endPreviewLength);
float secondsLeft = endPreviewLength;
do
{
secondsLeft = (float)(endTime - DateTime.Now).TotalSeconds;
secondsLeft -= CoroutineManager.DeltaTime;
float camAngle = (float)((DateTime.Now - endTime).TotalSeconds / endPreviewLength) * MathHelper.TwoPi;
Vector2 offset = (new Vector2(
(float)Math.Cos(camAngle) * (Submarine.Borders.Width / 2.0f),
(float)Math.Sin(camAngle) * (Submarine.Borders.Height / 2.0f)));
//float camAngle = (float)((DateTime.Now - endTime).TotalSeconds / endPreviewLength) * MathHelper.TwoPi;
//Vector2 offset = (new Vector2(
// (float)Math.Cos(camAngle) * (Submarine.Borders.Width / 2.0f),
// (float)Math.Sin(camAngle) * (Submarine.Borders.Height / 2.0f)));
GameMain.GameScreen.Cam.TargetPos = Submarine.Loaded.DrawPosition + offset * 0.8f;
//GameMain.GameScreen.Cam.TargetPos = Submarine.Loaded.Position + offset * 0.8f;
//Game1.GameScreen.Cam.MoveCamera((float)deltaTime);
messageBox.Text = endMessage + "\nReturning to lobby in " + (int)secondsLeft + " s";
yield return CoroutineStatus.Running;
} while (secondsLeft > 0.0f);
//float endPreviewLength = 10.0f;
//DateTime endTime = DateTime.Now + new TimeSpan(0,0,0,0,(int)(1000.0f*endPreviewLength));
//float secondsLeft = endPreviewLength;
//do
//{
// secondsLeft = (float)(endTime - DateTime.Now).TotalSeconds;
// float camAngle = (float)((DateTime.Now - endTime).TotalSeconds / endPreviewLength) * MathHelper.TwoPi;
// Vector2 offset = (new Vector2(
// (float)Math.Cos(camAngle) * (Submarine.Borders.Width / 2.0f),
// (float)Math.Sin(camAngle) * (Submarine.Borders.Height / 2.0f)));
// GameMain.GameScreen.Cam.TargetPos = Submarine.Loaded.DrawPosition + offset * 0.8f;
// //Game1.GameScreen.Cam.MoveCamera((float)deltaTime);
// messageBox.Text = endMessage + "\nReturning to lobby in " + (int)secondsLeft + " s";
// yield return CoroutineStatus.Running;
//} while (secondsLeft > 0.0f);
messageBox.Close(null,null);
Submarine.Unload();