CatStation/Content.Shared/Fax/Systems/FaxecuteSystem.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* 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
2026-05-09 03:29:58 +00:00

34 lines
1.1 KiB
C#

using Content.Shared.Damage.Systems;
using Content.Shared.Popups;
using Content.Shared.Fax.Components;
namespace Content.Shared.Fax.Systems;
/// <summary>
/// System for handling execution of a mob within fax when copy or send attempt is made.
/// </summary>
public sealed partial class FaxecuteSystem : EntitySystem
{
[Dependency] private DamageableSystem _damageable = default!;
[Dependency] private SharedPopupSystem _popupSystem = default!;
public override void Initialize()
{
base.Initialize();
}
public void Faxecute(EntityUid uid, FaxMachineComponent component, DamageOnFaxecuteEvent? args = null)
{
var sendEntity = component.PaperSlot.Item;
if (sendEntity == null)
return;
if (!TryComp<FaxecuteComponent>(uid, out var faxecute))
return;
var damageSpec = faxecute.Damage;
_damageable.ChangeDamage(sendEntity.Value, damageSpec);
_popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-error", ("target", uid)), uid, PopupType.LargeCaution);
return;
}
}