mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
28 lines
1 KiB
C#
28 lines
1 KiB
C#
using Content.Server.Explosion.EntitySystems;
|
|
using Content.Shared.EntityEffects;
|
|
using ExplosionEffect = Content.Shared.EntityEffects.Effects.Transform.Explosion;
|
|
|
|
namespace Content.Server.EntityEffects.Effects.Transform;
|
|
|
|
/// <summary>
|
|
/// Creates an explosion at this entity's position.
|
|
/// Intensity is modified by scale.
|
|
/// </summary>
|
|
/// <inheritdoc cref="EntityEffectSystem{T,TEffect}"/>
|
|
public sealed partial class ExplosionEntityEffectSystem : EntityEffectSystem<TransformComponent, ExplosionEffect>
|
|
{
|
|
[Dependency] private ExplosionSystem _explosion = default!;
|
|
|
|
protected override void Effect(Entity<TransformComponent> entity, ref EntityEffectEvent<ExplosionEffect> args)
|
|
{
|
|
var intensity = MathF.Min(args.Effect.IntensityPerUnit * args.Scale, args.Effect.MaxTotalIntensity);
|
|
|
|
_explosion.QueueExplosion(
|
|
entity,
|
|
args.Effect.ExplosionType,
|
|
intensity,
|
|
args.Effect.IntensitySlope,
|
|
args.Effect.MaxIntensity,
|
|
args.Effect.TileBreakScale);
|
|
}
|
|
}
|