2021-06-05 00:20:52 -07:00
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Weapons.Melee
|
2021-06-05 00:20:52 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised directed on the used entity when a target entity is click attacked by a user.
|
|
|
|
|
/// </summary>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class ClickAttackEvent : HandledEntityEventArgs
|
2021-06-05 00:20:52 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity used to attack, for broadcast purposes.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:59:44 +01:00
|
|
|
public EntityUid Used { get; }
|
2021-06-05 00:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that triggered the attack.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:59:44 +01:00
|
|
|
public EntityUid User { get; }
|
2021-06-05 00:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The original location that was clicked by the user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EntityCoordinates ClickLocation { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-12-16 23:42:02 +13:00
|
|
|
/// The entity that was attacked.
|
2021-06-05 00:20:52 -07:00
|
|
|
/// </summary>
|
2021-12-14 06:17:18 +01:00
|
|
|
public EntityUid? Target { get; }
|
2021-06-05 00:20:52 -07:00
|
|
|
|
2021-12-14 06:17:18 +01:00
|
|
|
public ClickAttackEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation, EntityUid? target = null)
|
2021-06-05 00:20:52 -07:00
|
|
|
{
|
|
|
|
|
Used = used;
|
|
|
|
|
User = user;
|
|
|
|
|
ClickLocation = clickLocation;
|
|
|
|
|
Target = target;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised directed on the used entity when a target entity is wide attacked by a user.
|
|
|
|
|
/// </summary>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class WideAttackEvent : HandledEntityEventArgs
|
2021-06-05 00:20:52 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity used to attack, for broadcast purposes.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:59:44 +01:00
|
|
|
public EntityUid Used { get; }
|
2021-06-05 00:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that triggered the attack.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:59:44 +01:00
|
|
|
public EntityUid User { get; }
|
2021-06-05 00:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The original location that was clicked by the user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EntityCoordinates ClickLocation { get; }
|
|
|
|
|
|
2021-12-04 12:59:44 +01:00
|
|
|
public WideAttackEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation)
|
2021-06-05 00:20:52 -07:00
|
|
|
{
|
|
|
|
|
Used = used;
|
|
|
|
|
User = user;
|
|
|
|
|
ClickLocation = clickLocation;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-10-25 16:21:56 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event raised on entities that have been attacked.
|
|
|
|
|
/// </summary>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class AttackedEvent : EntityEventArgs
|
2021-10-25 16:21:56 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity used to attack, for broadcast purposes.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:59:44 +01:00
|
|
|
public EntityUid Used { get; }
|
2021-10-25 16:21:56 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that triggered the attack.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:59:44 +01:00
|
|
|
public EntityUid User { get; }
|
2021-10-25 16:21:56 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The original location that was clicked by the user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EntityCoordinates ClickLocation { get; }
|
|
|
|
|
|
2021-12-04 12:59:44 +01:00
|
|
|
public AttackedEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation)
|
2021-10-25 16:21:56 +02:00
|
|
|
{
|
|
|
|
|
Used = used;
|
|
|
|
|
User = user;
|
|
|
|
|
ClickLocation = clickLocation;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-05 00:20:52 -07:00
|
|
|
}
|