24 lines
747 B
C#
24 lines
747 B
C#
using Content.Server.Damage.Components;
|
|
using Content.Shared.Damage;
|
|
using Content.Shared.Throwing;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
|
|
namespace Content.Server.Damage.Systems
|
|
{
|
|
public class DamageOtherOnHitSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<DamageOtherOnHitComponent, ThrowDoHitEvent>(OnDoHit);
|
|
}
|
|
|
|
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args)
|
|
{
|
|
_damageableSystem.TryChangeDamage(args.Target.Uid, component.Damage, component.IgnoreResistances);
|
|
}
|
|
}
|
|
}
|