diff --git a/Subsurface/Content/Items/Weapons/depthcharge.xml b/Subsurface/Content/Items/Weapons/depthcharge.xml index 6e1579ea6..bdd2ef693 100644 --- a/Subsurface/Content/Items/Weapons/depthcharge.xml +++ b/Subsurface/Content/Items/Weapons/depthcharge.xml @@ -11,7 +11,7 @@ @@ -28,7 +28,7 @@ - + @@ -45,9 +45,9 @@ - + - + @@ -74,9 +74,9 @@ - + - + diff --git a/Subsurface/Content/Items/Weapons/railgunetc.png b/Subsurface/Content/Items/Weapons/railgunetc.png index 980f272ae..64018dbeb 100644 Binary files a/Subsurface/Content/Items/Weapons/railgunetc.png and b/Subsurface/Content/Items/Weapons/railgunetc.png differ diff --git a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs index 20f91b576..e23911b06 100644 --- a/Subsurface/Source/Items/Components/Holdable/RepairTool.cs +++ b/Subsurface/Source/Items/Components/Holdable/RepairTool.cs @@ -20,6 +20,8 @@ namespace Barotrauma.Items.Components private string particles; + private float activeTimer; + [HasDefaultValue(0.0f, false)] public float Range { @@ -92,11 +94,11 @@ namespace Barotrauma.Items.Components } } - //public override void Update(float deltaTime, Camera cam) - //{ - // base.Update(deltaTime, cam); - - //} + public override void Update(float deltaTime, Camera cam) + { + activeTimer -= deltaTime; + if (activeTimer <= 0.0f) IsActive = false; + } public override bool Use(float deltaTime, Character character = null) { @@ -127,6 +129,9 @@ namespace Barotrauma.Items.Components ignoredBodies.Add(limb.body.FarseerBody); } + IsActive = true; + activeTimer = 0.1f; + for (int n = 0; n < 2; n++) { diff --git a/Subsurface/Source/Items/Components/Machines/Fabricator.cs b/Subsurface/Source/Items/Components/Machines/Fabricator.cs index 0af8ff80e..e1edc0e64 100644 --- a/Subsurface/Source/Items/Components/Machines/Fabricator.cs +++ b/Subsurface/Source/Items/Components/Machines/Fabricator.cs @@ -114,12 +114,9 @@ namespace Barotrauma.Items.Components foreach (FabricableItem fi in fabricableItems) { - Color color = ((itemList.CountChildren % 2) == 0) ? Color.Transparent : Color.Black*0.3f; - - new GUITextBlock( - new Rectangle(0, 0, 0, 25), fi.TargetItem.Name, - color, Color.White, - Alignment.Left, Alignment.Left, null, itemList) + Color color = ((itemList.CountChildren % 2) == 0) ? Color.Transparent : Color.Black * 0.3f; + + GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 50), Color.Transparent, null, itemList) { UserData = fi, Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f), @@ -128,6 +125,21 @@ namespace Barotrauma.Items.Components ToolTip = fi.TargetItem.Description }; + GUITextBlock textBlock = new GUITextBlock( + new Rectangle(40, 0, 0, 25), + fi.TargetItem.Name, + Color.Transparent, Color.White, + Alignment.Left, Alignment.Left, + null, frame); + textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f); + + if (fi.TargetItem.sprite != null) + { + GUIImage img = new GUIImage(new Rectangle(0, 0, 40, 40), fi.TargetItem.sprite, Alignment.Left, frame); + img.Scale = Math.Min(Math.Min(40.0f / img.SourceRect.Width, 40.0f / img.SourceRect.Height), 1.0f); + img.Color = fi.TargetItem.SpriteColor; + } + } } diff --git a/Subsurface/Source/Items/Components/Machines/Radar.cs b/Subsurface/Source/Items/Components/Machines/Radar.cs index 3f025d29b..be281b135 100644 --- a/Subsurface/Source/Items/Components/Machines/Radar.cs +++ b/Subsurface/Source/Items/Components/Machines/Radar.cs @@ -141,7 +141,7 @@ namespace Barotrauma.Items.Components CreateBlipsForLine( start + Submarine.Loaded.WorldPosition, end + Submarine.Loaded.WorldPosition, - radius, displayScale, 2.0f); + radius, displayScale, 200.0f, 2.0f); } } @@ -170,7 +170,7 @@ namespace Barotrauma.Items.Components CreateBlipsForLine( new Vector2(item.WorldPosition.X - range, Level.Loaded.Size.Y), new Vector2(item.WorldPosition.X + range, Level.Loaded.Size.Y), - radius, displayScale, 1.0f); + radius, displayScale, 300.0f, 1.0f); } List cells = Level.Loaded.GetCells(item.WorldPosition, 7); @@ -179,14 +179,14 @@ namespace Barotrauma.Items.Components foreach (GraphEdge edge in cell.edges) { if (!edge.isSolid) continue; - float cellDot = Vector2.Dot(cell.Center - item.WorldPosition, (edge.Center+cell.Translation) - cell.Center); + float cellDot = Vector2.Dot(cell.Center - item.WorldPosition, (edge.Center + cell.Translation) - cell.Center); if (cellDot > 0) continue; float facingDot = Vector2.Dot( - Vector2.Normalize(edge.point1 - edge.point2), - Vector2.Normalize(cell.Center-item.WorldPosition)); + Vector2.Normalize(edge.point1 - edge.point2), + Vector2.Normalize(cell.Center - item.WorldPosition)); - CreateBlipsForLine(edge.point1 + cell.Translation, edge.point2+cell.Translation, radius, displayScale, 3.0f * (Math.Abs(facingDot) + 1.0f)); + CreateBlipsForLine(edge.point1 + cell.Translation, edge.point2 + cell.Translation, radius, displayScale, 350.0f, 3.0f * (Math.Abs(facingDot) + 1.0f)); } } @@ -204,7 +204,7 @@ namespace Barotrauma.Items.Components Vector2.Normalize((wall.A+wall.B)/2.0f - ruinShape.Center)); if (cellDot > 0) continue; - CreateBlipsForLine(wall.A, wall.B, radius, displayScale, -cellDot*5.0f); + CreateBlipsForLine(wall.A, wall.B, radius, displayScale, 100.0f, 1000.0f); } } } @@ -295,7 +295,7 @@ namespace Barotrauma.Items.Components } } - private void CreateBlipsForLine(Vector2 point1, Vector2 point2, float radius, float displayScale, float step) + private void CreateBlipsForLine(Vector2 point1, Vector2 point2, float radius, float displayScale, float lineStep, float zStep) { float pingRadius = radius * pingState; @@ -303,7 +303,7 @@ namespace Barotrauma.Items.Components Vector2 lineDir = (point2 - point1) / length; - for (float x = 0; x < length; x += Rand.Range(300.0f, 400.0f)) + for (float x = 0; x < length; x += lineStep*Rand.Range(0.8f,1.2f)) { Vector2 point = point1 + lineDir * x; //point += cell.Translation; @@ -316,7 +316,7 @@ namespace Barotrauma.Items.Components //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) + for (float z = 0; z < radius - pointDist; z += zStep) { var blip = new RadarBlip( @@ -324,7 +324,7 @@ namespace Barotrauma.Items.Components alpha); radarBlips.Add(blip); - step += 0.5f; + zStep += 0.5f; alpha -= (z == 0) ? 0.5f : 0.1f; } diff --git a/Subsurface/Source/Items/Components/Signal/Connection.cs b/Subsurface/Source/Items/Components/Signal/Connection.cs index 3297cd537..323dd6f99 100644 --- a/Subsurface/Source/Items/Components/Signal/Connection.cs +++ b/Subsurface/Source/Items/Components/Signal/Connection.cs @@ -409,6 +409,8 @@ namespace Barotrauma.Items.Components SpriteEffects.None, 0.0f); + connector.Draw(spriteBatch, end, Color.White, new Vector2(10.0f, 10.0f), MathUtils.VectorToAngle(end - start)+MathHelper.PiOver2); + if (draggingConnected == null && !wireEquipped) { if (mouseOn) diff --git a/Subsurface/Source/Items/Components/Turret.cs b/Subsurface/Source/Items/Components/Turret.cs index 1b134937e..9bab38897 100644 --- a/Subsurface/Source/Items/Components/Turret.cs +++ b/Subsurface/Source/Items/Components/Turret.cs @@ -131,6 +131,8 @@ namespace Barotrauma.Items.Components ApplyStatusEffects(ActionType.OnActive, deltaTime, null); + if (minRotation == maxRotation) return; + float targetMidDiff = MathHelper.WrapAngle(targetRotation - (minRotation + maxRotation) / 2.0f); float maxDist = (maxRotation - minRotation) / 2.0f; @@ -184,6 +186,7 @@ namespace Barotrauma.Items.Components Item projectile = projectiles[0].Item; projectile.Drop(); + projectile.body.Dir = 1.0f; projectile.body.ResetDynamics(); projectile.body.Enabled = true; diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 018bc98bb..59446d81d 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -224,7 +224,7 @@ namespace Barotrauma public static void Draw(SpriteBatch spriteBatch, bool editing = false) { - for (int i = 0; i < MapEntity.mapEntityList.Count(); i++ ) + for (int i = 0; i < MapEntity.mapEntityList.Count; i++ ) { MapEntity.mapEntityList[i].Draw(spriteBatch, editing); } @@ -232,7 +232,7 @@ namespace Barotrauma public static void DrawFront(SpriteBatch spriteBatch, bool editing = false) { - for (int i = 0; i < MapEntity.mapEntityList.Count(); i++) + for (int i = 0; i < MapEntity.mapEntityList.Count; i++) { if (MapEntity.mapEntityList[i].Sprite == null || MapEntity.mapEntityList[i].Sprite.Depth < 0.5f) MapEntity.mapEntityList[i].Draw(spriteBatch, editing, false); @@ -241,7 +241,7 @@ namespace Barotrauma public static void DrawBack(SpriteBatch spriteBatch, bool editing = false) { - for (int i = 0; i < MapEntity.mapEntityList.Count(); i++) + for (int i = 0; i < MapEntity.mapEntityList.Count; i++) { if (MapEntity.mapEntityList[i].Sprite == null || MapEntity.mapEntityList[i].Sprite.Depth >= 0.5f) MapEntity.mapEntityList[i].Draw(spriteBatch, editing, true); @@ -608,7 +608,6 @@ namespace Barotrauma foreach (string path in filePaths) { - //Map savedMap = new Map(mapPath); SavedSubmarines.Add(new Submarine(path)); }