From 32e4c24342e8fb7dcfeba134ac42af3069e8cbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Tue, 11 Aug 2020 22:34:37 +0200 Subject: [PATCH] Adds atmos helpers, welding tool now lights up fires --- Content.Server/Atmos/AtmosHelpers.cs | 25 +++++++++++++++++++ .../Interactable/WelderComponent.cs | 7 ++++++ 2 files changed, 32 insertions(+) create mode 100644 Content.Server/Atmos/AtmosHelpers.cs diff --git a/Content.Server/Atmos/AtmosHelpers.cs b/Content.Server/Atmos/AtmosHelpers.cs new file mode 100644 index 0000000000..4a4eb37d0c --- /dev/null +++ b/Content.Server/Atmos/AtmosHelpers.cs @@ -0,0 +1,25 @@ +using Content.Server.GameObjects.EntitySystems; +using Robust.Shared.GameObjects.Systems; +using Robust.Shared.Map; + +#nullable enable + +namespace Content.Server.Atmos +{ + public static class AtmosHelpers + { + public static TileAtmosphere? GetTileAtmosphere(this GridCoordinates coordinates) + { + var gridAtmos = EntitySystem.Get().GetGridAtmosphere(coordinates.GridID); + + return gridAtmos?.GetTile(coordinates); + } + + public static TileAtmosphere? GetTileAtmosphere(this MapIndices indices, GridId gridId) + { + var gridAtmos = EntitySystem.Get().GetGridAtmosphere(gridId); + + return gridAtmos?.GetTile(indices); + } + } +} diff --git a/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs b/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs index 46e13cd038..fdaa204f91 100644 --- a/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs @@ -1,6 +1,8 @@ #nullable enable using System; +using Content.Server.Atmos; using Content.Server.GameObjects.Components.Chemistry; +using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; @@ -19,6 +21,7 @@ using Robust.Shared.Utility; using Robust.Shared.ViewVariables; using Robust.Shared.Serialization; using Content.Shared.GameObjects.EntitySystems; +using Robust.Shared.GameObjects.Systems; namespace Content.Server.GameObjects.Components.Interactable { @@ -179,6 +182,10 @@ namespace Content.Server.GameObjects.Components.Interactable PlaySoundCollection("WelderOn", -5); _welderSystem.Subscribe(this); + + Owner.Transform.GridPosition + .GetTileAtmosphere()?.HotspotExpose(700f, 50f, true); + return true; }