Class ExplosionSystem
Inheritance
System.Object
ExplosionSystem
Assembly: Content.Server.dll
Syntax
public sealed class ExplosionSystem : EntitySystem, EntitySystem
Fields
|
Improve this Doc
View Source
DefaultExplosionPrototypeId
The "default" explosion prototype.
Declaration
public const string DefaultExplosionPrototypeId = null
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
DefaultTileSize
"Tile-size" for space when there are no nearby grids to use as a reference.
Declaration
public const ushort DefaultTileSize = null
Field Value
Type |
Description |
System.UInt16 |
|
Properties
|
Improve this Doc
View Source
IncrementalTileBreaking
Declaration
public bool IncrementalTileBreaking { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
MaxArea
Declaration
public int MaxArea { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
MaxIterations
Declaration
public int MaxIterations { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
MaxProcessingTime
Declaration
public float MaxProcessingTime { get; }
Property Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
SingleTickAreaLimit
Declaration
public int SingleTickAreaLimit { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
SleepNodeSys
Declaration
public bool SleepNodeSys { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ThrowLimit
Declaration
public int ThrowLimit { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
TilesPerTick
Declaration
public int TilesPerTick { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
|
Improve this Doc
View Source
DamageFloorTile(TileRef, Single, Int32, Boolean, List<(Vector2i GridIndices, Tile Tile)>, ExplosionPrototype)
Tries to damage floor tiles. Not to be confused with the function that damages entities intersecting the
grid tile.
Declaration
public void DamageFloorTile(TileRef tileRef, float effectiveIntensity, int maxTileBreak, bool canCreateVacuum, List<(Vector2i GridIndices, Tile Tile)> damagedTiles, ExplosionPrototype type)
Parameters
Type |
Name |
Description |
Robust.Shared.Map.TileRef |
tileRef |
|
System.Single |
effectiveIntensity |
|
System.Int32 |
maxTileBreak |
|
System.Boolean |
canCreateVacuum |
|
List<System.ValueTuple<Vector2i, Robust.Shared.Map.Tile>> |
damagedTiles |
|
ExplosionPrototype |
type |
|
|
Improve this Doc
View Source
GenerateExplosionPreview(SpawnExplosionEuiMsg.PreviewRequest)
Declaration
public ExplosionVisualsState GenerateExplosionPreview(SpawnExplosionEuiMsg.PreviewRequest request)
Parameters
Returns
|
Improve this Doc
View Source
GetExplosionTolerance(EntityUid, EntityQuery<DamageableComponent>, EntityQuery<DestructibleComponent>)
Return a dictionary that specifies how intense a given explosion type needs to be in order to destroy an entity.
Declaration
public float[] GetExplosionTolerance(EntityUid uid, EntityQuery<DamageableComponent> damageQuery, EntityQuery<DestructibleComponent> destructibleQuery)
Parameters
Returns
Type |
Description |
System.Single[] |
|
|
Improve this Doc
View Source
GetLocalGrids(MapCoordinates, Single, Single, Single)
Look for grids in an area and returns them. Also selects a special grid that will be used to determine the
orientation of an explosion in space.
Declaration
public (List<EntityUid>, EntityUid? , float) GetLocalGrids(MapCoordinates epicenter, float totalIntensity, float slope, float maxIntensity)
Parameters
Type |
Name |
Description |
Robust.Shared.Map.MapCoordinates |
epicenter |
|
System.Single |
totalIntensity |
|
System.Single |
slope |
|
System.Single |
maxIntensity |
|
Returns
Type |
Description |
System.ValueTuple<List<EntityUid>, System.Nullable<EntityUid>, System.Single> |
|
|
Improve this Doc
View Source
Initialize()
Declaration
public override void Initialize()
|
Improve this Doc
View Source
InitVisuals()
Declaration
public void InitVisuals()
|
Improve this Doc
View Source
IntensityToRadius(Single, Single, Single)
Declaration
public float IntensityToRadius(float totalIntensity, float slope, float maxIntensity)
Parameters
Type |
Name |
Description |
System.Single |
totalIntensity |
|
System.Single |
slope |
|
System.Single |
maxIntensity |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
IsBlockingTurf(EntityUid, EntityQuery<PhysicsComponent>)
Determines whether an entity is blocking a tile or not. (whether it can prevent the tile from being uprooted
by an explosion).
Declaration
public bool IsBlockingTurf(EntityUid uid, EntityQuery<PhysicsComponent> physicsQuery)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EntityQuery<Robust.Shared.Physics.Components.PhysicsComponent> |
physicsQuery |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
QueueExplosion(EntityUid, String, Single, Single, Single, Single, Int32, Boolean, Nullable<EntityUid>, Boolean)
Queue an explosions, centered on some entity.
Declaration
public void QueueExplosion(EntityUid uid, string typeId, float totalIntensity, float slope, float maxTileIntensity, float tileBreakScale = 1F, int maxTileBreak = null, bool canCreateVacuum = true, EntityUid? user = null, bool addLog = true)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.String |
typeId |
|
System.Single |
totalIntensity |
|
System.Single |
slope |
|
System.Single |
maxTileIntensity |
|
System.Single |
tileBreakScale |
|
System.Int32 |
maxTileBreak |
|
System.Boolean |
canCreateVacuum |
|
System.Nullable<EntityUid> |
user |
|
System.Boolean |
addLog |
|
|
Improve this Doc
View Source
QueueExplosion(MapCoordinates, String, Single, Single, Single, Single, Int32, Boolean, Boolean)
Queue an explosion, with a specified epicenter and set of starting tiles.
Declaration
public void QueueExplosion(MapCoordinates epicenter, string typeId, float totalIntensity, float slope, float maxTileIntensity, float tileBreakScale = 1F, int maxTileBreak = null, bool canCreateVacuum = true, bool addLog = true)
Parameters
Type |
Name |
Description |
Robust.Shared.Map.MapCoordinates |
epicenter |
|
System.String |
typeId |
|
System.Single |
totalIntensity |
|
System.Single |
slope |
|
System.Single |
maxTileIntensity |
|
System.Single |
tileBreakScale |
|
System.Int32 |
maxTileBreak |
|
System.Boolean |
canCreateVacuum |
|
System.Boolean |
addLog |
|
|
Improve this Doc
View Source
RadiusToIntensity(Single, Single, Single)
Find the strength needed to generate an explosion of a given radius. More useful for radii larger then 4, when the explosion becomes less "blocky".
Declaration
public float RadiusToIntensity(float radius, float slope, float maxIntensity = null)
Parameters
Type |
Name |
Description |
System.Single |
radius |
|
System.Single |
slope |
|
System.Single |
maxIntensity |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Shutdown()
Declaration
public override void Shutdown()
|
Improve this Doc
View Source
TransformGridEdges(MapCoordinates, Nullable<EntityUid>, List<EntityUid>, Single)
Take our map of grid edges, where each is defined in their own grid's reference frame, and map those
edges all onto one grids reference frame.
Declaration
public (Dictionary<Vector2i, BlockedSpaceTile>, ushort) TransformGridEdges(MapCoordinates epicentre, EntityUid? referenceGrid, List<EntityUid> localGrids, float maxDistance)
Parameters
Type |
Name |
Description |
Robust.Shared.Map.MapCoordinates |
epicentre |
|
System.Nullable<EntityUid> |
referenceGrid |
|
List<EntityUid> |
localGrids |
|
System.Single |
maxDistance |
|
Returns
Type |
Description |
System.ValueTuple<Dictionary<Vector2i, BlockedSpaceTile>, System.UInt16> |
|
|
Improve this Doc
View Source
TriggerExplosive(EntityUid, ExplosiveComponent, Boolean, Nullable<Single>, Nullable<Single>, Nullable<EntityUid>)
Given an entity with an explosive component, spawn the appropriate explosion.
Declaration
public void TriggerExplosive(EntityUid uid, ExplosiveComponent explosive = null, bool delete = true, float? totalIntensity = null, float? radius = null, EntityUid? user = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
ExplosiveComponent |
explosive |
|
System.Boolean |
delete |
|
System.Nullable<System.Single> |
totalIntensity |
|
System.Nullable<System.Single> |
radius |
|
System.Nullable<EntityUid> |
user |
|
|
Improve this Doc
View Source
Update(Single)
Process the explosion queue.
Declaration
public override void Update(float frameTime)
Parameters
Type |
Name |
Description |
System.Single |
frameTime |
|
|
Improve this Doc
View Source
UpdateAirtightMap(EntityUid, MapGridComponent, Vector2i, Nullable<EntityQuery<AirtightComponent>>)
Update the map of explosion blockers.
Declaration
public void UpdateAirtightMap(EntityUid gridId, MapGridComponent grid, Vector2i tile, EntityQuery<AirtightComponent>? query = null)
Parameters
Type |
Name |
Description |
EntityUid |
gridId |
|
Robust.Shared.Map.Components.MapGridComponent |
grid |
|
Vector2i |
tile |
|
System.Nullable<EntityQuery<AirtightComponent>> |
query |
|
|
Improve this Doc
View Source
UpdateAirtightMap(EntityUid, Vector2i, MapGridComponent, Nullable<EntityQuery<AirtightComponent>>)
Declaration
public void UpdateAirtightMap(EntityUid gridId, Vector2i tile, MapGridComponent grid = null, EntityQuery<AirtightComponent>? query = null)
Parameters
Type |
Name |
Description |
EntityUid |
gridId |
|
Vector2i |
tile |
|
Robust.Shared.Map.Components.MapGridComponent |
grid |
|
System.Nullable<EntityQuery<AirtightComponent>> |
query |
|
Implements
EntitySystem