]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Ignite atmosphere on explosions (#41262)
authorJesterX666 <32009105+JesterX666@users.noreply.github.com>
Mon, 15 Dec 2025 23:27:40 +0000 (18:27 -0500)
committerGitHub <noreply@github.com>
Mon, 15 Dec 2025 23:27:40 +0000 (23:27 +0000)
* Ignite atmosphere on explosions

* Fixed to add a temperature property

* Code review corrections

* Removed unused usings

* Correction to use TryComp instead of EntityManager to make it prettier

* Code review corrections

* Code review corrections

* Corrections

* misc fixes

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Content.Shared/Explosion/ExplosionPrototype.cs
Resources/Prototypes/explosion.yml

index c6528b0142f277ad8b3e20324a5466900bbf3fa4..2cec8d707aab221d67b283ee59bcbe63af65f9dc 100644 (file)
@@ -1,4 +1,3 @@
-using System.Numerics;
 using Content.Shared.CCVar;
 using Content.Shared.Damage;
 using Content.Shared.Damage.Components;
@@ -17,6 +16,7 @@ using Robust.Shared.Physics.Dynamics;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
+using System.Numerics;
 using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
 
 namespace Content.Server.Explosion.EntitySystems;
@@ -202,6 +202,8 @@ public sealed partial class ExplosionSystem
         HashSet<EntityUid> processed,
         string id,
         float? fireStacks,
+        float? temperature,
+        float currentIntensity,
         EntityUid? cause)
     {
         var size = grid.Comp.TileSize;
@@ -234,6 +236,12 @@ public sealed partial class ExplosionSystem
             ProcessEntity(entity, epicenter, damage, throwForce, id, null, fireStacks, cause);
         }
 
+        // heat the atmosphere
+        if (temperature != null)
+        {
+            _atmosphere.HotspotExpose(grid.Owner, tile, temperature.Value, currentIntensity, cause, true);
+        }
+
         // Walls and reinforced walls will break into girders. These girders will also be considered turf-blocking for
         // the purposes of destroying floors. Again, ideally the process of damaging an entity should somehow return
         // information about the entities that were spawned as a result, but without that information we just have to
@@ -457,7 +465,7 @@ public sealed partial class ExplosionSystem
             }
         }
 
-        // ignite
+        // ignite entities with the flammable component
         if (fireStacksOnIgnite != null)
         {
             if (_flammableQuery.TryGetComponent(uid, out var flammable))
@@ -855,6 +863,8 @@ sealed class Explosion
                     ProcessedEntities,
                     ExplosionType.ID,
                     ExplosionType.FireStacks,
+                    ExplosionType.Temperature,
+                    _currentIntensity,
                     Cause);
 
                 // If the floor is not blocked by some dense object, damage the floor tiles.
index b5163c6157eb65fa36c06e371c2605d1df9f1c17..4824810dae5d153aa5ebd406a0149ce998b7a793 100644 (file)
@@ -54,6 +54,7 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
     [Dependency] private readonly SharedMapSystem _map = default!;
     [Dependency] private readonly FlammableSystem _flammableSystem = default!;
     [Dependency] private readonly DestructibleSystem _destructibleSystem = default!;
+    [Dependency] private readonly AtmosphereSystem _atmosphere = default!;
 
     private EntityQuery<FlammableComponent> _flammableQuery;
     private EntityQuery<PhysicsComponent> _physicsQuery;
index b20c6891a861b62cc0c1b6b47dcd5f589a0babcb..2ab9508ded4248c322837757fb42ac80533d0a23 100644 (file)
@@ -31,6 +31,12 @@ public sealed partial class ExplosionPrototype : IPrototype
     [DataField]
     public float? FireStacks;
 
+    /// <summary>
+    ///     Temperature of the explosion
+    /// </summary>
+    [DataField]
+    public float? Temperature;
+
     /// <summary>
     ///     This set of points, together with <see cref="_tileBreakIntensity"/> define a function that maps the
     ///     explosion intensity to a tile break chance via linear interpolation.
index 4d3febeda7d2ab84a76094948a7ef018c4f0bea5..2c97f5b755b4905c726a4bec701e7ca4391e2b3e 100644 (file)
@@ -11,6 +11,7 @@
   lightColor: Orange
   texturePath: /Textures/Effects/fire.rsi
   fireStates: 3
+  temperature: 800
 
 - type: explosion
   id: DemolitionCharge
@@ -26,6 +27,7 @@
   lightColor: Orange
   texturePath: /Textures/Effects/fire.rsi
   fireStates: 3
+  temperature: 800
 
 - type: explosion
   id: MicroBomb
@@ -42,6 +44,7 @@
   lightColor: Orange
   texturePath: /Textures/Effects/fire.rsi
   fireStates: 3
+  temperature: 800
 
 - type: explosion
   id: Radioactive
@@ -83,6 +86,7 @@
   lightColor: Orange
   texturePath: /Textures/Effects/fire.rsi
   fireStates: 3
+  temperature: 800
 
 - type: explosion
   id: PowerSink
   lightColor: Orange
   texturePath: /Textures/Effects/fire.rsi
   fireStates: 3
+  temperature: 800
 
 - type: explosion
   id: HardBomb
   lightColor: Orange
   texturePath: /Textures/Effects/fire.rsi
   fireStates: 3
+  temperature: 800
 
 - type: explosion
   id: FireBomb
   texturePath: /Textures/Effects/fire.rsi
   fireStates: 3
   fireStacks: 2
+  temperature: 1500