TriggerOnPlayerSpawnComplete and ExplosionOnTrigger (#39820)

This commit is contained in:
āda
2025-09-23 15:24:45 -05:00
committed by GitHub
parent 3ee7d81944
commit eee5751a22
7 changed files with 127 additions and 20 deletions

View File

@@ -1,14 +1,26 @@
using Content.Shared.Armor;
using Content.Shared.Explosion.Components;
using Robust.Shared.Prototypes;
namespace Content.Shared.Explosion.EntitySystems;
// TODO some sort of struct like DamageSpecifier but for explosions.
/// <summary>
/// Lets code in shared trigger explosions and handles explosion resistance examining.
/// All processing is still done clientside.
/// </summary>
public abstract class SharedExplosionSystem : EntitySystem
{
/// <summary>
/// The "default" explosion prototype.
/// </summary>
/// <remarks>
/// Generally components should specify an explosion prototype via a yaml datafield, so that the yaml-linter can
/// find errors. However some components, like rogue arrows, or some commands like the admin-smite need to have
/// a "default" option specified outside of yaml data-fields. Hence this const string.
/// </remarks>
public static readonly ProtoId<ExplosionPrototype> DefaultExplosionPrototypeId = "Default";
public override void Initialize()
{
base.Initialize();
@@ -37,4 +49,24 @@ public abstract class SharedExplosionSystem : EntitySystem
public virtual void TriggerExplosive(EntityUid uid, ExplosiveComponent? explosive = null, bool delete = true, float? totalIntensity = null, float? radius = null, EntityUid? user = null)
{
}
/// <summary>
/// Queue an explosion centered on some entity. Bypasses needing <see cref="ExplosiveComponent"/>.
/// </summary>
/// <param name="uid">Where the explosion happens.</param>
/// <param name="typeId">A ProtoId of type <see cref="ExplosionPrototype"/>.</param>
/// <param name="user">The entity which caused the explosion.</param>
/// <param name="addLog">Whether to add an admin log about this explosion. Includes user.</param>
public virtual void QueueExplosion(EntityUid uid,
string typeId,
float totalIntensity,
float slope,
float maxTileIntensity,
float tileBreakScale = 1f,
int maxTileBreak = int.MaxValue,
bool canCreateVacuum = true,
EntityUid? user = null,
bool addLog = true)
{
}
}