using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; namespace Content.Shared.Weapons.Melee { /// /// Raised directed on the used entity when a target entity is click attacked by a user. /// public class ClickAttackEvent : HandledEntityEventArgs { /// /// Entity used to attack, for broadcast purposes. /// public EntityUid Used { get; } /// /// Entity that triggered the attack. /// public EntityUid User { get; } /// /// The original location that was clicked by the user. /// public EntityCoordinates ClickLocation { get; } /// /// UID of the entity that was attacked. /// public EntityUid Target { get; } /// /// Entity that was attacked. /// public EntityUid? TargetEntity { get; } public ClickAttackEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation, EntityUid target = default) { Used = used; User = user; ClickLocation = clickLocation; Target = target; IoCManager.Resolve().TryGetEntity(Target, out var targetEntity); TargetEntity = targetEntity; } } /// /// Raised directed on the used entity when a target entity is wide attacked by a user. /// public class WideAttackEvent : HandledEntityEventArgs { /// /// Entity used to attack, for broadcast purposes. /// public EntityUid Used { get; } /// /// Entity that triggered the attack. /// public EntityUid User { get; } /// /// The original location that was clicked by the user. /// public EntityCoordinates ClickLocation { get; } public WideAttackEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation) { Used = used; User = user; ClickLocation = clickLocation; } } /// /// Event raised on entities that have been attacked. /// public class AttackedEvent : EntityEventArgs { /// /// Entity used to attack, for broadcast purposes. /// public EntityUid Used { get; } /// /// Entity that triggered the attack. /// public EntityUid User { get; } /// /// The original location that was clicked by the user. /// public EntityCoordinates ClickLocation { get; } public AttackedEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation) { Used = used; User = user; ClickLocation = clickLocation; } } }