Only limbs with enough mass can cause impact damage to the sub, basictutorial changes, prevent ragdolls from teleporting inside submarinebody

This commit is contained in:
Regalis
2016-02-07 23:18:51 +02:00
parent 201dc1b733
commit 6de5bac61b
17 changed files with 53 additions and 21 deletions
@@ -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);
@@ -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);
@@ -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<MaxLinked; i++)
{
if (Wires[i]==null) continue;
if (Wires[i]==null || draggingConnected == Wires[i].Item) continue;
Connection recipient = Wires[i].OtherConnection(this);
@@ -358,9 +360,11 @@ namespace Barotrauma.Items.Components
}
}
int screwIndex = (position.Y % 60 < 30) ? 0 : 1;
if (Wires.Any(w => 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);
}
}