forked from space-syndicate/space-station-14
Ignite atmosphere on explosions (#41262)
* 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>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
@@ -99,6 +103,7 @@
|
||||
lightColor: Orange
|
||||
texturePath: /Textures/Effects/fire.rsi
|
||||
fireStates: 3
|
||||
temperature: 800
|
||||
|
||||
- type: explosion
|
||||
id: HardBomb
|
||||
@@ -115,6 +120,7 @@
|
||||
lightColor: Orange
|
||||
texturePath: /Textures/Effects/fire.rsi
|
||||
fireStates: 3
|
||||
temperature: 800
|
||||
|
||||
- type: explosion
|
||||
id: FireBomb
|
||||
@@ -127,3 +133,4 @@
|
||||
texturePath: /Textures/Effects/fire.rsi
|
||||
fireStates: 3
|
||||
fireStacks: 2
|
||||
temperature: 1500
|
||||
|
||||
Reference in New Issue
Block a user