--- /dev/null
+namespace Content.Shared.Interaction.Events;
+
+/// <summary>
+/// Raised on the target when failing to pet/hug something.
+/// </summary>
+[ByRefEvent]
+public readonly record struct InteractionFailureEvent(EntityUid User);
--- /dev/null
+namespace Content.Shared.Interaction.Events;
+
+/// <summary>
+/// Raised on the target when successfully petting/hugging something.
+/// </summary>
+[ByRefEvent]
+public readonly record struct InteractionSuccessEvent(EntityUid User);
using Content.Shared.Bed.Sleep;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction.Components;
+using Content.Shared.Interaction.Events;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;
if (component.InteractSuccessSpawn != null)
Spawn(component.InteractSuccessSpawn, _transform.GetMapCoordinates(uid));
+
+ var ev = new InteractionSuccessEvent(user);
+ RaiseLocalEvent(target, ref ev);
}
else
{
if (component.InteractFailureSpawn != null)
Spawn(component.InteractFailureSpawn, _transform.GetMapCoordinates(uid));
+
+ var ev = new InteractionFailureEvent(user);
+ RaiseLocalEvent(target, ref ev);
}
if (!string.IsNullOrEmpty(component.MessagePerceivedByOthers))