]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
light ciggies with fire structures (#23196)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Mon, 1 Jan 2024 08:10:48 +0000 (08:10 +0000)
committerGitHub <noreply@github.com>
Mon, 1 Jan 2024 08:10:48 +0000 (00:10 -0800)
the pro ops

Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Shared/Temperature/Components/AlwaysHotComponent.cs [new file with mode: 0644]
Content.Shared/Temperature/Systems/AlwaysHotSystem.cs [new file with mode: 0644]
Resources/Prototypes/Entities/Structures/Decoration/bonfire.yml
Resources/Prototypes/Entities/Structures/Decoration/fireplace.yml

diff --git a/Content.Shared/Temperature/Components/AlwaysHotComponent.cs b/Content.Shared/Temperature/Components/AlwaysHotComponent.cs
new file mode 100644 (file)
index 0000000..8c4ba5f
--- /dev/null
@@ -0,0 +1,11 @@
+using Content.Shared.Temperature.Systems;
+
+namespace Content.Shared.Temperature.Components;
+
+/// <summary>
+/// Makes the entity always set <c>IsHotEvent.IsHot</c> to true, no matter what.
+/// </summary>
+[RegisterComponent, Access(typeof(AlwaysHotSystem))]
+public sealed partial class AlwaysHotComponent : Component
+{
+}
diff --git a/Content.Shared/Temperature/Systems/AlwaysHotSystem.cs b/Content.Shared/Temperature/Systems/AlwaysHotSystem.cs
new file mode 100644 (file)
index 0000000..605fc07
--- /dev/null
@@ -0,0 +1,19 @@
+using Content.Shared.Temperature;
+using Content.Shared.Temperature.Components;
+
+namespace Content.Shared.Temperature.Systems;
+
+public sealed class AlwaysHotSystem : EntitySystem
+{
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<AlwaysHotComponent, IsHotEvent>(OnIsHot);
+    }
+
+    private void OnIsHot(Entity<AlwaysHotComponent> ent, ref IsHotEvent args)
+    {
+        args.IsHot = true;
+    }
+}
index 6934b67c5eb181a97794fb5bff2bd17698fa1808..22aef79340b93190c41f85a9cd42385375cdb322 100644 (file)
@@ -29,6 +29,7 @@
     range: 5
     sound:
       path: /Audio/Ambience/Objects/fireplace.ogg
+  - type: AlwaysHot
 
 - type: entity
   id: LegionnaireBonfire
index f5bbafa40c69d8e6ae5923ee93cbaabfc9fae577..3446c4980b487de7f0cd572c3f192fbc70ace8d3 100644 (file)
@@ -45,3 +45,4 @@
         behaviors:
           - !type:DoActsBehavior
             acts: [ "Destruction" ]
+  - type: AlwaysHot