mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +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
25 lines
802 B
C#
25 lines
802 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 partial class DamageOnLandSystem : EntitySystem
|
|
{
|
|
[Dependency] private Shared.Damage.Systems.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);
|
|
}
|
|
}
|
|
}
|