diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index 2feb084e1..e2a117134 100644 --- a/Subsurface/Properties/AssemblyInfo.cs +++ b/Subsurface/Properties/AssemblyInfo.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Subsurface")] +[assembly: AssemblyTitle("Barotrauma")] [assembly: AssemblyProduct("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")] diff --git a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs index 7435d6459..ea9e77c32 100644 --- a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs +++ b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs @@ -33,7 +33,7 @@ namespace Subsurface } } - public void SpawnSprites(int count) + public void SpawnSprites(int count, Vector2? position = null) { activeSprites.Clear(); @@ -45,17 +45,25 @@ namespace Subsurface { Vector2 pos = Vector2.Zero; - if (WayPoint.WayPointList.Count>0) + if (position == null) { - WayPoint wp = WayPoint.WayPointList[Rand.Int(WayPoint.WayPointList.Count)]; + if (WayPoint.WayPointList.Count>0) + { + WayPoint wp = WayPoint.WayPointList[Rand.Int(WayPoint.WayPointList.Count)]; - pos = new Vector2(wp.Rect.X, wp.Rect.Y); - pos += Rand.Vector(200.0f); + pos = new Vector2(wp.Rect.X, wp.Rect.Y); + pos += Rand.Vector(200.0f); + } + else + { + pos = Rand.Vector(2000.0f); + } } else { - pos = Rand.Vector(2000.0f); - } + pos = (Vector2)position; + } + var prefab = prefabs[Rand.Int(prefabs.Count)]; diff --git a/Subsurface/Source/Characters/HumanoidAnimController.cs b/Subsurface/Source/Characters/HumanoidAnimController.cs index 240b00281..062b66cce 100644 --- a/Subsurface/Source/Characters/HumanoidAnimController.cs +++ b/Subsurface/Source/Characters/HumanoidAnimController.cs @@ -831,7 +831,7 @@ namespace Subsurface Vector2 bodyVelocity = torso.body.LinearVelocity / 60.0f; item.body.ResetDynamics(); - item.body.SetTransform(MathUtils.SmoothStep(item.body.SimPosition, transformedHoldPos + bodyVelocity, 0.5f), itemAngle); + item.SetTransform(MathUtils.SmoothStep(item.body.SimPosition, transformedHoldPos + bodyVelocity, 0.5f), itemAngle); for (int i = 0; i < 2; i++) { diff --git a/Subsurface/Source/GameSession/GameModes/TutorialMode.cs b/Subsurface/Source/GameSession/GameModes/TutorialMode.cs index c2a61cfef..228f2b02f 100644 --- a/Subsurface/Source/GameSession/GameModes/TutorialMode.cs +++ b/Subsurface/Source/GameSession/GameModes/TutorialMode.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using FarseerPhysics; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Subsurface.Items.Components; using System; @@ -16,7 +17,7 @@ namespace Subsurface public static void Start() { - Submarine.Load("Content/Map/TutorialSub.gz"); + Submarine.Load("Content/Map/TutorialSub.gz", ""); GameMain.GameSession = new GameSession(Submarine.Loaded, "", GameModePreset.list.Find(gm => gm.Name.ToLower()=="tutorial")); @@ -86,6 +87,8 @@ namespace Subsurface private IEnumerable UpdateState() { + GameMain.GameScreen.BackgroundSpriteManager.SpawnSprites(1, Submarine.Loaded.Position + Character.Controlled.Position); + yield return new WaitForSeconds(4.0f); infoBox = CreateInfoFrame("Use WASD to move and mouse to look around"); @@ -276,20 +279,20 @@ namespace Subsurface yield return CoroutineStatus.Running; } yield return new WaitForSeconds(4.0f); - - infoBox = CreateInfoFrame("The submarine moves up and down by pumping water in and out of the two ballast tanks at the bottom of the submarine. " - +"The engine at the back of the sub moves it forwards and backwards."); - - yield return new WaitForSeconds(8.0f); + infoBox = CreateInfoFrame("Steer the submarine downwards, heading further into the cavern."); - + while (Submarine.Loaded.Position.Y > 31000.0f) { yield return CoroutineStatus.Running; } - - var moloch = new Character("Content/Characters/Moloch/moloch.xml", steering.Item.SimPosition + Vector2.UnitX * 25.0f); + yield return new WaitForSeconds(8.0f); + + infoBox = CreateInfoFrame("The submarine moves up and down by pumping water in and out of the two ballast tanks at the bottom of the submarine. " + +"The engine at the back of the sub moves it forwards and backwards."); + + var moloch = new AICharacter("Content/Characters/Moloch/moloch.xml", steering.Item.SimPosition + Vector2.UnitX * 25.0f); moloch.PlaySound(AIController.AiState.Attack); yield return new WaitForSeconds(1.0f); diff --git a/Subsurface/Source/Map/Levels/Level.cs b/Subsurface/Source/Map/Levels/Level.cs index e05b90325..582852b28 100644 --- a/Subsurface/Source/Map/Levels/Level.cs +++ b/Subsurface/Source/Map/Levels/Level.cs @@ -76,7 +76,10 @@ namespace Subsurface public Vector2 Position { - get { return ConvertUnits.ToDisplayUnits(cells[0].body.Position); } + get + { + return cells==null ? Vector2.Zero : ConvertUnits.ToDisplayUnits(cells[0].body.Position); + } } public List PositionsOfInterest diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 6c4616040..d766cb5f2 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -623,11 +623,13 @@ namespace Subsurface loaded = this; } - public static Submarine Load(string fileName) + public static Submarine Load(string fileName, string folder = SavePath) { - Unload(); + Unload(); - Submarine sub = new Submarine(SavePath+"/"+fileName); + string path = string.IsNullOrWhiteSpace(folder) ? fileName : System.IO.Path.Combine(SavePath, fileName); + + Submarine sub = new Submarine(path); sub.Load(); //Entity.dictionary.Add(int.MaxValue, sub); diff --git a/Subsurface/Source/Screens/GameScreen.cs b/Subsurface/Source/Screens/GameScreen.cs index 90a781394..972793247 100644 --- a/Subsurface/Source/Screens/GameScreen.cs +++ b/Subsurface/Source/Screens/GameScreen.cs @@ -67,7 +67,8 @@ namespace Subsurface AmbientSoundManager.Update(); - if (GameMain.GameSession != null && GameMain.GameSession.Level != null) +#if DEBUG + if (GameMain.GameSession != null && GameMain.GameSession.Level != null && GameMain.GameSession.Submarine != null) { Vector2 targetMovement = Vector2.Zero; if (PlayerInput.KeyDown(Keys.I)) targetMovement.Y += 1.0f; @@ -77,6 +78,7 @@ namespace Subsurface GameMain.GameSession.Submarine.ApplyForce(targetMovement * 100000.0f); } +#endif if (GameMain.GameSession!=null) GameMain.GameSession.Update((float)deltaTime); //EventManager.Update(gameTime); diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 3eaab0352..e0e3c5377 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ diff --git a/UpgradeLog.htm b/UpgradeLog.htm deleted file mode 100644 index 14f56873d..000000000 Binary files a/UpgradeLog.htm and /dev/null differ