diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index 49b1d72d8..1d3b32f53 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -1023,6 +1023,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Subsurface/Content/Items/Diving/divinggear.xml b/Subsurface/Content/Items/Diving/divinggear.xml index 67dc8e0ec..fda2d77d4 100644 --- a/Subsurface/Content/Items/Diving/divinggear.xml +++ b/Subsurface/Content/Items/Diving/divinggear.xml @@ -122,7 +122,7 @@ - + @@ -130,6 +130,7 @@ + \ No newline at end of file diff --git a/Subsurface/Content/Items/Electricity/poweritems.xml b/Subsurface/Content/Items/Electricity/poweritems.xml index 34cce621c..c509c77b7 100644 --- a/Subsurface/Content/Items/Electricity/poweritems.xml +++ b/Subsurface/Content/Items/Electricity/poweritems.xml @@ -68,7 +68,7 @@ category="Electrical" linkable="true" pickdistance="150" - description="Can take in and deliver power much faster than batteries."> + description="Can deliver charge much faster than batteries."> diff --git a/Subsurface/Content/Map/TutorialSub.sub b/Subsurface/Content/Map/TutorialSub.sub index 01fabb912..a525518a9 100644 Binary files a/Subsurface/Content/Map/TutorialSub.sub and b/Subsurface/Content/Map/TutorialSub.sub differ diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index dc527216d..d8e05518c 100644 --- a/Subsurface/Properties/AssemblyInfo.cs +++ b/Subsurface/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.0.5")] -[assembly: AssemblyFileVersion("0.3.0.5")] +[assembly: AssemblyVersion("0.3.1.0")] +[assembly: AssemblyFileVersion("0.3.1.0")] diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs index 4bf6c609e..47e6f52d0 100644 --- a/Subsurface/Source/Characters/Animation/Ragdoll.cs +++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs @@ -428,6 +428,7 @@ namespace Barotrauma if (limb.pullJoint != null) { Vector2 pos = ConvertUnits.ToDisplayUnits(limb.pullJoint.WorldAnchorA); + if (currentHull != null) pos += currentHull.Submarine.Position; pos.Y = -pos.Y; GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X, (int)pos.Y, 5, 5), Color.Red, true, 0.01f); @@ -455,6 +456,7 @@ namespace Barotrauma if (limb.body.TargetPosition != Vector2.Zero) { Vector2 pos = ConvertUnits.ToDisplayUnits(limb.body.TargetPosition); + if (currentHull != null) pos += currentHull.Submarine.Position; pos.Y = -pos.Y; GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X - 10, (int)pos.Y - 10, 20, 20), Color.Cyan, false, 0.01f); @@ -764,6 +766,19 @@ namespace Barotrauma //if the limb is closer than alloweddistance, just ignore the difference float allowedDistance = NetConfig.AllowedRagdollDistance * ((inWater) ? 2.0f : 1.0f); + if (currentHull == null) + { + var overLappingHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(refLimb.body.TargetPosition), null, true); + + if (overLappingHull != null) + { + Submarine.PickBody(refLimb.SimPosition, refLimb.body.TargetPosition, null, Physics.CollisionWall); + + refLimb.body.TargetPosition = refLimb.SimPosition + (refLimb.body.TargetPosition - refLimb.SimPosition) * Submarine.LastPickedFraction * 0.9f; + } + } + + float dist = Vector2.Distance(refLimb.body.SimPosition, refLimb.body.TargetPosition); //if the limb is further away than resetdistance, all limbs are immediately snapped to their targetpositions @@ -786,8 +801,6 @@ namespace Barotrauma { if (inWater) { - - if (character is AICharacter) { correctionMovement = @@ -802,8 +815,6 @@ namespace Barotrauma limb.body.SetTransform(limb.SimPosition + Vector2.Normalize(diff) * 0.1f, limb.Rotation); } } - - } else { diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs index 3ef2a8432..5caeb23fd 100644 --- a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs +++ b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs @@ -162,7 +162,7 @@ namespace Barotrauma.Tutorials { yield return CoroutineStatus.Running; } - yield return new WaitForSeconds(5.0f); + yield return new WaitForSeconds(1.0f); infoBox = CreateInfoFrame("You need a screwdriver to check the wiring of the terminal." + " Equip a screwdriver by pulling it to either of the slots with a hand symbol, and then use it on the terminal by left clicking."); @@ -275,7 +275,7 @@ namespace Barotrauma.Tutorials infoBox = CreateInfoFrame("Steer the submarine downwards, heading further into the cavern."); - while (Submarine.Loaded.WorldPosition.Y > 33000.0f) + while (Submarine.Loaded.WorldPosition.Y > 31000.0f) { yield return CoroutineStatus.Running; } @@ -293,7 +293,7 @@ namespace Barotrauma.Tutorials { if (s.CastShadow || !s.HasBody) continue; - if (s.Rect.Right > steering.Item.Position.X) windows.Add(s); + if (s.Rect.Right > steering.Item.CurrentHull.Rect.Right) windows.Add(s); } bool broken = false; @@ -407,8 +407,7 @@ namespace Barotrauma.Tutorials yield return new WaitForSeconds(1.0f); } - infoBox = CreateInfoFrame("The capacitors consume large amounts of power when they're being charged at a high rate, so " + - "be careful not to overload the electrical grid or the reactor. They also take some time to recharge, so now is a good " + + infoBox = CreateInfoFrame("The capacitors take some time to recharge, so now is a good " + "time to head to the room below and load some shells for the railgun."); @@ -489,7 +488,7 @@ namespace Barotrauma.Tutorials yield return new WaitForSeconds(1.0f); } while (broken); - infoBox = CreateInfoFrame("Great! However, there's still quite a bit of water inside the sub. It should be pumped out " + infoBox = CreateInfoFrame("The hull is fixed now, but there's still quite a bit of water inside the sub. It should be pumped out " + "using the bilge pump in the room at the bottom of the submarine."); Pump pump = Item.ItemList.Find(i => i.HasTag("tutorialpump")).GetComponent(); diff --git a/Subsurface/Source/Items/Components/Machines/Reactor.cs b/Subsurface/Source/Items/Components/Machines/Reactor.cs index 811bfd925..e43a4a1dd 100644 --- a/Subsurface/Source/Items/Components/Machines/Reactor.cs +++ b/Subsurface/Source/Items/Components/Machines/Reactor.cs @@ -445,7 +445,7 @@ namespace Barotrauma.Items.Components spriteBatch.DrawString(GUI.Font, "Output: " + (int)temperature + " kW", new Vector2(x + 450, y + 30), Color.Red); spriteBatch.DrawString(GUI.Font, "Grid load: " + (int)load + " kW", - new Vector2(x + 620, y + 30), Color.Yellow); + new Vector2(x + 600, y + 30), Color.Yellow); DrawGraph(tempGraph, spriteBatch, new Rectangle(x + 30, y + 30, 400, 250), 10000.0f, xOffset, Color.Red); diff --git a/Subsurface/Source/Items/Components/Power/PowerContainer.cs b/Subsurface/Source/Items/Components/Power/PowerContainer.cs index f78ba08c2..48005e690 100644 --- a/Subsurface/Source/Items/Components/Power/PowerContainer.cs +++ b/Subsurface/Source/Items/Components/Power/PowerContainer.cs @@ -247,7 +247,7 @@ namespace Barotrauma.Items.Components //GUI.DrawRectangle(spriteBatch, new Rectangle(x, y, width, height), Color.Black, true); spriteBatch.DrawString(GUI.Font, - "Charge: " + (int)charge + "/" + (int)capacity + "kWm (" + (int)((charge / capacity) * 100.0f) + " %)", + "Charge: " + (int)charge + "/" + (int)capacity + " kWm (" + (int)((charge / capacity) * 100.0f) + " %)", new Vector2(x + 30, y + 30), Color.White); spriteBatch.DrawString(GUI.Font, "Recharge rate: " + (int)((rechargeSpeed / maxRechargeSpeed) * 100.0f) + " %", new Vector2(x + 30, y + 95), Color.White); diff --git a/Subsurface/Source/Items/Components/Signal/Connection.cs b/Subsurface/Source/Items/Components/Signal/Connection.cs index b021e0095..cf16ab31d 100644 --- a/Subsurface/Source/Items/Components/Signal/Connection.cs +++ b/Subsurface/Source/Items/Components/Signal/Connection.cs @@ -221,7 +221,7 @@ namespace Barotrauma.Items.Components float wireInterval = 10.0f; - float rightWireX = x+width / 2 + wireInterval; + float rightWireX = x + width / 2 + wireInterval; float leftWireX = x + width / 2 - wireInterval; foreach (Connection c in panel.Connections) { @@ -291,6 +291,8 @@ namespace Barotrauma.Items.Components if (draggingConnected != null) { + DrawWire(spriteBatch, draggingConnected, draggingConnected, PlayerInput.MousePosition, new Vector2(x + width / 2, y + height), mouseInRect, false); + if (!PlayerInput.LeftButtonHeld()) { panel.Item.NewComponentEvent(panel, true, true); @@ -313,7 +315,7 @@ namespace Barotrauma.Items.Components for (int i = 0; i w != null && w.Item != draggingConnected)) { - spriteBatch.Draw(panelTexture, position - new Vector2(16.0f, 16.0f), new Rectangle(32, 256, 32, 32), Color.White); + spriteBatch.Draw(panelTexture, position - new Vector2(16.0f, 16.0f), new Rectangle(screwIndex*32, 256, 32, 32), Color.White); } } diff --git a/Subsurface/Source/Map/Md5Hash.cs b/Subsurface/Source/Map/Md5Hash.cs index ff01bac91..495a3f6a2 100644 --- a/Subsurface/Source/Map/Md5Hash.cs +++ b/Subsurface/Source/Map/Md5Hash.cs @@ -50,6 +50,8 @@ namespace Barotrauma public Md5Hash(XDocument doc) { + if (doc == null) return; + string docString = Regex.Replace(doc.ToString(), @"\s+", ""); byte[] inputBytes = Encoding.ASCII.GetBytes(docString); diff --git a/Subsurface/Source/Map/SubmarineBody.cs b/Subsurface/Source/Map/SubmarineBody.cs index 6e1094c55..3b6667486 100644 --- a/Subsurface/Source/Map/SubmarineBody.cs +++ b/Subsurface/Source/Map/SubmarineBody.cs @@ -349,13 +349,13 @@ namespace Barotrauma { bool collision = HandleLimbCollision(contact, limb); - if (collision) + if (collision && limb.Mass>100.0f) { Vector2 normal = Vector2.Normalize(body.Position - limb.SimPosition); //normal *= Math.Min(limb.Mass,100)/100.0f; - float impact = Math.Min(Vector2.Dot(Velocity - limb.LinearVelocity, -normal),5.0f); + float impact = Math.Min(Vector2.Dot(Velocity - limb.LinearVelocity, -normal), 5.0f); ApplyImpact(impact * Math.Min(limb.Mass/200.0f, 1), -normal, contact); diff --git a/Subsurface/Submarines/Aegir Mark II.sub b/Subsurface/Submarines/Aegir Mark II.sub index 974cbbb76..24bb65643 100644 Binary files a/Subsurface/Submarines/Aegir Mark II.sub and b/Subsurface/Submarines/Aegir Mark II.sub differ diff --git a/Subsurface/Submarines/Nehalennia.sub b/Subsurface/Submarines/Nehalennia.sub index e10a0a6bc..ed020c7e6 100644 Binary files a/Subsurface/Submarines/Nehalennia.sub and b/Subsurface/Submarines/Nehalennia.sub differ diff --git a/Subsurface/Submarines/Vellamo.sub b/Subsurface/Submarines/Vellamo.sub index 59efc6351..20bcbefd8 100644 Binary files a/Subsurface/Submarines/Vellamo.sub and b/Subsurface/Submarines/Vellamo.sub differ diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 83f1d06d5..9aa4fb76a 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,15 @@ +--------------------------------------------------------------------------------------------------------- +v0.3.1.0 +--------------------------------------------------------------------------------------------------------- + +- batteries have separate power_in and power_out connections, which allows recharging and powering devices +simultaneously and using separate recharge circuits +- using supercapacitors as a substitute for batteries now longer works: they have a very low energy storage +capacity and are only suitable for providing short high-energy power surges +- improved connection panel graphics +- fixed a bug that caused the submarine to swoop to a random direction when a character enters it +- fixed crashed caused by EntityGrid.GetEntites() + --------------------------------------------------------------------------------------------------------- v0.3.0.5 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index e0b68e41f..1f8d22e37 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ