6
StarHorizon_Public/Content.Shared/Damage/Systems/DamageProtectionBuffSystem.cs
2026-01-24 12:49:55 +03:00

20 lines
594 B
C#

using Content.Shared.Damage.Components;
namespace Content.Shared.Damage.Systems;
public sealed class DamageProtectionBuffSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DamageProtectionBuffComponent, DamageModifyEvent>(OnDamageModify);
}
private void OnDamageModify(EntityUid uid, DamageProtectionBuffComponent component, DamageModifyEvent args)
{
foreach (var modifier in component.Modifiers.Values)
args.Damage = DamageSpecifier.ApplyModifierSet(args.Damage, modifier);
}
}