From 69533a15d803c575c0562bd14fa58196a14142e6 Mon Sep 17 00:00:00 2001 From: komunre <49118681+komunre@users.noreply.github.com> Date: Thu, 8 Apr 2021 08:43:43 -0400 Subject: [PATCH] RangedWeapon now ignite plasma when shoot (#3746) * RangedWeapon now ignite plasma on shoot * Apply review Co-authored-by: metalgearsloth --- .../Weapon/Ranged/ServerRangedWeaponComponent.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/ServerRangedWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/ServerRangedWeaponComponent.cs index 450ffe7f11..8d803969ef 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/ServerRangedWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/ServerRangedWeaponComponent.cs @@ -1,4 +1,4 @@ -using System; +using System; using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Weapon.Ranged.Barrels; @@ -21,6 +21,7 @@ using Robust.Shared.Players; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Timing; using Robust.Shared.ViewVariables; +using Content.Server.Atmos; namespace Content.Server.GameObjects.Components.Weapon.Ranged { @@ -40,6 +41,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged [DataField("clumsyExplodeChance")] public float ClumsyExplodeChance { get; set; } = 0.5f; + [ViewVariables(VVAccess.ReadWrite)] + [DataField("canHotspot")] + private bool _canHotspot = true; + public Func? WeaponCanFireHandler; public Func? UserCanFireHandler; public Action? FireHandler; @@ -174,6 +179,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged return; } + if (_canHotspot && user.Transform.Coordinates.TryGetTileAtmosphere(out var tile)) + { + tile.HotspotExpose(700, 50); + } FireHandler?.Invoke(user, targetPos); }