2021-08-21 09:18:23 +02:00
|
|
|
using Content.Server.Damage.Components;
|
2021-09-15 03:07:37 +10:00
|
|
|
using Content.Shared.Damage;
|
2021-08-21 09:18:23 +02:00
|
|
|
using Content.Shared.Throwing;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-09-15 03:07:37 +10:00
|
|
|
using Robust.Shared.IoC;
|
2021-08-21 09:18:23 +02:00
|
|
|
|
2021-09-12 16:22:58 +10:00
|
|
|
namespace Content.Server.Damage.Systems
|
2021-08-21 09:18:23 +02:00
|
|
|
{
|
|
|
|
|
public class DamageOtherOnHitSystem : EntitySystem
|
|
|
|
|
{
|
2021-09-15 03:07:37 +10:00
|
|
|
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
|
|
|
|
|
2021-08-21 09:18:23 +02:00
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
SubscribeLocalEvent<DamageOtherOnHitComponent, ThrowDoHitEvent>(OnDoHit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args)
|
|
|
|
|
{
|
2021-09-15 03:07:37 +10:00
|
|
|
_damageableSystem.TryChangeDamage(args.Target.Uid, component.Damage, component.IgnoreResistances);
|
2021-08-21 09:18:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|