more accurate submarine body generation, multiplayer fixes, saving takes HiddenSubPosition into account, fire coordinate fixes, editscreen fixes, checking item triggers in AIObjectiveGoto, netlobbyscreen sync fixes, re-enabled level start/end positions, water edit fixed

This commit is contained in:
Regalis
2015-12-17 18:26:40 +02:00
parent 859be53d28
commit af470eab2e
53 changed files with 1065 additions and 427 deletions

View File

@@ -46,6 +46,7 @@ namespace Barotrauma.Items.Components
if (linkedGap != null) return linkedGap;
}
linkedGap = new Gap(item.Rect, Item.Submarine);
linkedGap.Submarine = item.Submarine;
linkedGap.Open = openState;
item.linkedTo.Add(linkedGap);
return linkedGap;

View File

@@ -110,6 +110,9 @@ namespace Barotrauma.Items.Components
public override void Drop(Character dropper)
{
item.body.Enabled = true;
IsActive = false;
if (picker == null)
{
if (dropper==null) return;
@@ -117,8 +120,8 @@ namespace Barotrauma.Items.Components
}
if (picker.Inventory == null) return;
item.body.Enabled = true;
IsActive = false;
item.Submarine = picker.Submarine;
//item.Unequip();

View File

@@ -107,6 +107,8 @@ namespace Barotrauma.Items.Components
}
if (picker==null || picker.Inventory == null) return;
item.Submarine = picker.Submarine;
if (item.body!= null && !item.body.Enabled)
{

View File

@@ -129,9 +129,9 @@ namespace Barotrauma.Items.Components
foreach (GraphEdge edge in cell.edges)
{
//if (!edge.isSolid) continue;
float cellDot = Vector2.Dot(cell.Center - item.WorldPosition, (edge.point1 + edge.point2) / 2.0f - cell.Center);
//if (cellDot > 0) continue;
if (!edge.isSolid) continue;
float cellDot = Vector2.Dot(cell.Center - item.WorldPosition, edge.Center - cell.Center);
if (cellDot > 0) continue;
float facingDot = Vector2.Dot(Vector2.Normalize(edge.point1 - edge.point2), Vector2.Normalize(cell.Center-item.WorldPosition));
facingDot = 1.0f;// MathHelper.Clamp(facingDot, -1.0f, 1.0f);
@@ -150,7 +150,7 @@ namespace Barotrauma.Items.Components
if (pointDist < prevPingRadius || pointDist > pingRadius) continue;
float step = 5.0f * (Math.Abs(facingDot) + 1.0f);
float step = 3.0f * (Math.Abs(facingDot) + 1.0f);
float alpha = Rand.Range(1.5f, 2.0f);
for (float z = 0; z < radius - pointDist; z += step)
{

View File

@@ -75,7 +75,7 @@ namespace Barotrauma.Items.Components
if (FireProbability > 0.0f && Rand.Int((int)(1.0f / FireProbability)) == 1)
{
new FireSource(pt.item.Position);
new FireSource(pt.item.WorldPosition);
}
}
}

View File

@@ -98,7 +98,7 @@ namespace Barotrauma.Items.Components
{
if (!powerOnSoundPlayed)
{
powerOnSound.Play(1.0f, 600.0f, item.Position);
powerOnSound.Play(1.0f, 600.0f, item.WorldPosition);
powerOnSoundPlayed = true;
}
}

View File

@@ -318,7 +318,7 @@ namespace Barotrauma.Items.Components
if (item.Submarine != null) worldPos += item.Submarine.Position;
worldPos.Y = -worldPos.Y;
GUI.DrawRectangle(spriteBatch, worldPos+new Vector2(-3,3), new Vector2(6, 6), Color.Red, true, 0.0f);
GUI.DrawRectangle(spriteBatch, worldPos+new Vector2(-3,-3), new Vector2(6, 6), Color.Red, true, 0.0f);
if (GUIComponent.MouseOn != null ||
Vector2.Distance(GameMain.EditMapScreen.Cam.ScreenToWorld(PlayerInput.MousePosition), Nodes[i]) > 10.0f)
@@ -326,7 +326,7 @@ namespace Barotrauma.Items.Components
continue;
}
GUI.DrawRectangle(spriteBatch, worldPos + new Vector2(-10, 10), new Vector2(20, 20), Color.Red, false, 0.0f);
GUI.DrawRectangle(spriteBatch, worldPos + new Vector2(-10, -10), new Vector2(20, 20), Color.Red, false, 0.0f);
if (selectedNodeIndex == null && !MapEntity.SelectedAny)
{