Files
tbd-station-14/Content.Server/Damage/Systems/DamageOnLandSystem.cs
2025-02-09 20:24:10 -05:00

26 lines
781 B
C#

using Content.Server.Damage.Components;
using Content.Shared.Damage;
using Content.Shared.Throwing;
namespace Content.Server.Damage.Systems
{
/// <summary>
/// Damages the thrown item when it lands.
/// </summary>
public sealed class DamageOnLandSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DamageOnLandComponent, LandEvent>(DamageOnLand);
}
private void DamageOnLand(EntityUid uid, DamageOnLandComponent component, ref LandEvent args)
{
_damageableSystem.TryChangeDamage(uid, component.Damage, component.IgnoreResistances);
}
}
}