diff --git a/Subsurface/Data/ContentPackages/Vanilla 0.3.xml b/Subsurface/Data/ContentPackages/Vanilla 0.3.xml
index 226776875..9348a625f 100644
--- a/Subsurface/Data/ContentPackages/Vanilla 0.3.xml
+++ b/Subsurface/Data/ContentPackages/Vanilla 0.3.xml
@@ -1,40 +1,41 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs
index f40f11617..63dd17eb2 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.2.4")]
-[assembly: AssemblyFileVersion("0.3.2.4")]
+[assembly: AssemblyVersion("0.3.2.5")]
+[assembly: AssemblyFileVersion("0.3.2.5")]
diff --git a/Subsurface/Source/GUI/GUIMessageBox.cs b/Subsurface/Source/GUI/GUIMessageBox.cs
index 545eb9409..5d25a0f2c 100644
--- a/Subsurface/Source/GUI/GUIMessageBox.cs
+++ b/Subsurface/Source/GUI/GUIMessageBox.cs
@@ -45,7 +45,11 @@ namespace Barotrauma
var frame = new GUIFrame(new Rectangle(0,0,width,height), null, Alignment.Center, GUI.Style, this);
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
- new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
+ if (!string.IsNullOrWhiteSpace(text))
+ {
+ new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text,
+ Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
+ }
int x = 0;
this.Buttons = new GUIButton[buttons.Length];
diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs
index 65fe392fb..e0883ab83 100644
--- a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs
+++ b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs
@@ -333,13 +333,21 @@ namespace Barotrauma.Tutorials
//fix everything except the command windows
foreach (Structure w in Structure.WallList)
{
- if (windows.Contains(w)) continue;
+ bool isWindow = windows.Contains(w);
for (int i = 0; i < w.SectionCount; i++)
{
if (!w.SectionIsLeaking(i)) continue;
- w.AddDamage(i, -100000.0f);
+ if (isWindow)
+ {
+ w.AddDamage(i, -w.SectionDamage(i) * 0.2f);
+ }
+ else
+ {
+ w.AddDamage(i, -100000.0f);
+ }
+
}
}
@@ -365,8 +373,19 @@ namespace Barotrauma.Tutorials
infoBox = CreateInfoFrame("You should quickly find yourself a diving mask or a diving suit. " +
"There are some in the room next to the airlock.");
+ bool divingMaskSelected = false;
+
while (!HasItem("Diving Mask") && !HasItem("Diving Suit"))
{
+ if (!divingMaskSelected &&
+ Character.Controlled.ClosestItem != null && Character.Controlled.ClosestItem.Name == "Diving Suit")
+ {
+ infoBox = CreateInfoFrame("The can only be one item in each inventory slot, so you need to take off "
+ +"the jumpsuit if you wish to wear a diving suit.");
+
+ divingMaskSelected = true;
+ }
+
yield return CoroutineStatus.Running;
}
diff --git a/Subsurface/Source/Items/Components/Machines/Radar.cs b/Subsurface/Source/Items/Components/Machines/Radar.cs
index 6ef73dd3c..a2fe024df 100644
--- a/Subsurface/Source/Items/Components/Machines/Radar.cs
+++ b/Subsurface/Source/Items/Components/Machines/Radar.cs
@@ -317,7 +317,8 @@ namespace Barotrauma.Items.Components
GUI.DrawRectangle(spriteBatch, new Rectangle((int)markerPos.X, (int)markerPos.Y, 5, 5), Color.LightGreen);
spriteBatch.DrawString(GUI.SmallFont, label, new Vector2(markerPos.X + 10, markerPos.Y), Color.LightGreen);
- spriteBatch.DrawString(GUI.SmallFont, (int)(dist / 80.0f) + " m", new Vector2(markerPos.X + 10, markerPos.Y + 15), Color.LightGreen);
+ spriteBatch.DrawString(GUI.SmallFont, (int)(dist * Physics.DisplayToRealWorldRatio) + " m",
+ new Vector2(markerPos.X + 10, markerPos.Y + 15), Color.LightGreen);
}
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
diff --git a/Subsurface/Source/Items/Components/Machines/Steering.cs b/Subsurface/Source/Items/Components/Machines/Steering.cs
index 5781a17db..9bc6e3bc1 100644
--- a/Subsurface/Source/Items/Components/Machines/Steering.cs
+++ b/Subsurface/Source/Items/Components/Machines/Steering.cs
@@ -164,7 +164,22 @@ namespace Barotrauma.Items.Components
Rectangle velRect = new Rectangle(x + 20, y + 20, width - 40, height - 40);
//GUI.DrawRectangle(spriteBatch, velRect, Color.White, false);
+
+ if (Submarine.Loaded != null && Level.Loaded != null)
+ {
+ Vector2 realWorldVelocity = ConvertUnits.ToDisplayUnits(Submarine.Loaded.Velocity * Physics.DisplayToRealWorldRatio) * 3.6f;
+ float realWorldDepth = (Submarine.Loaded.Position.Y - Level.Loaded.Size.Y) *Physics.DisplayToRealWorldRatio;
+ GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 65),
+ "Velocity: " + (int)realWorldVelocity.X + " km/h", Color.LightGreen, null, 0, GUI.SmallFont);
+ GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 50),
+ "Descent velocity: " + -(int)realWorldVelocity.Y + " km/h", Color.LightGreen, null, 0, GUI.SmallFont);
+
+ GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 30),
+ "Depth: " + (int)realWorldDepth + " m", Color.LightGreen, null, 0, GUI.SmallFont);
+ }
+
+
GUI.DrawLine(spriteBatch,
new Vector2(velRect.Center.X,velRect.Center.Y),
new Vector2(velRect.Center.X + currVelocity.X, velRect.Center.Y - currVelocity.Y),
diff --git a/Subsurface/Source/Items/Components/Power/PowerTransfer.cs b/Subsurface/Source/Items/Components/Power/PowerTransfer.cs
index b39f610a6..824ed435f 100644
--- a/Subsurface/Source/Items/Components/Power/PowerTransfer.cs
+++ b/Subsurface/Source/Items/Components/Power/PowerTransfer.cs
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Globalization;
+using System.Linq;
namespace Barotrauma.Items.Components
{
@@ -105,13 +106,19 @@ namespace Barotrauma.Items.Components
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
+ List alreadyChecked = new List();
+
List connections = item.Connections;
if (connections == null) return;
foreach (Connection c in connections)
{
if (!c.IsPower) continue;
- foreach (Connection recipient in c.Recipients)
+
+
+ var recipients = c.Recipients;
+
+ foreach (Connection recipient in recipients)
{
if (recipient == null || !c.IsPower) continue;
@@ -123,6 +130,8 @@ namespace Barotrauma.Items.Components
Powered powered = it.GetComponent();
if (powered == null) continue;
+ if (connectedList.Contains(powered)) continue;
+
PowerTransfer powerTransfer = powered as PowerTransfer;
PowerContainer powerContainer = powered as PowerContainer;
if (powerTransfer != null)
@@ -140,6 +149,8 @@ namespace Barotrauma.Items.Components
{
fullPower += powerContainer.CurrPowerOutput;
}
+
+ alreadyChecked.Add(recipient);
}
else
{
diff --git a/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs b/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs
index 5e675e31f..bc4cb8490 100644
--- a/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs
+++ b/Subsurface/Source/Items/Components/Signal/ConnectionPanel.cs
@@ -174,7 +174,7 @@ namespace Barotrauma.Items.Components
var otherConnection = c.Wires[i].OtherConnection(c);
Networking.GameServer.Log(
item.Name+" ("+ c.Name + ") -> " +
- otherConnection.Item.Name+" ("+(otherConnection == null ? "none" : otherConnection.Name)+")", Color.Orange);
+ (otherConnection == null ? "none" : otherConnection.Item.Name+" ("+(otherConnection.Name)+")"), Color.Orange);
}
c.UpdateRecipients();
}
diff --git a/Subsurface/Source/Map/Explosion.cs b/Subsurface/Source/Map/Explosion.cs
index 9e5d4d8cc..ed6ae9701 100644
--- a/Subsurface/Source/Map/Explosion.cs
+++ b/Subsurface/Source/Map/Explosion.cs
@@ -79,28 +79,8 @@ namespace Barotrauma
if (force == 0.0f && attack.Stun == 0.0f && attack.GetDamage(1.0f) == 0.0f) return;
- foreach (Character c in Character.CharacterList)
- {
+ ApplyExplosionForces(worldPosition, attack.Range, force, attack.GetDamage(1.0f), attack.Stun);
-
- foreach (Limb limb in c.AnimController.Limbs)
- {
- float dist = Vector2.Distance(limb.WorldPosition, worldPosition);
-
- if (dist > attack.Range) continue;
-
- float distFactor = 1.0f - dist / attack.Range;
-
- if (limb.WorldPosition == worldPosition) continue;
-
- c.AddDamage(limb.SimPosition, DamageType.None,
- attack.GetDamage(1.0f) / c.AnimController.Limbs.Length * distFactor, 0.0f, attack.Stun * distFactor, false);
- if (force > 0.0f)
- {
- limb.body.ApplyLinearImpulse(Vector2.Normalize(limb.WorldPosition - worldPosition) * distFactor * force);
- }
- }
- }
}
private IEnumerable