From 064750d99ff349e3a96da190211afb40e0804c4c Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 25 Feb 2018 22:42:34 +0200 Subject: [PATCH] Fixed missing RepairTool HitStructure particles & missing ancient weapon beam (+ added hit particles to ancient weapon). Closes #285 --- .../Content/Items/Artifacts/artifacts.xml | 9 ++++++++- .../Source/Items/Components/Holdable/RepairTool.cs | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Content/Items/Artifacts/artifacts.xml b/Barotrauma/BarotraumaShared/Content/Items/Artifacts/artifacts.xml index da01ce8ce..e2b514805 100644 --- a/Barotrauma/BarotraumaShared/Content/Items/Artifacts/artifacts.xml +++ b/Barotrauma/BarotraumaShared/Content/Items/Artifacts/artifacts.xml @@ -158,9 +158,16 @@ - + + + + + + + + diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs index 75ce9a7e6..ac87842c5 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/RepairTool.cs @@ -235,6 +235,14 @@ namespace Barotrauma.Items.Components Color.Red, Color.Green); if (progressBar != null) progressBar.Size = new Vector2(60.0f, 20.0f); + + Vector2 particlePos = ConvertUnits.ToDisplayUnits(pickedPosition); + if (targetStructure.Submarine != null) particlePos += targetStructure.Submarine.DrawPosition; + foreach (var emitter in ParticleEmitterHitStructure) + { + float particleAngle = item.body.Rotation + ((item.body.Dir > 0.0f) ? 0.0f : MathHelper.Pi); + emitter.Emit(deltaTime, particlePos, item.CurrentHull, particleAngle + MathHelper.Pi, -particleAngle + MathHelper.Pi); + } #endif targetStructure.AddDamage(sectionIndex, -StructureFixAmount * degreeOfSuccess, user);