Files
crystall-punk-14/Content.Shared/Weapons/Melee/AttackEvent.cs

95 lines
2.8 KiB
C#
Raw Normal View History

using Robust.Shared.Map;
2021-06-09 22:19:39 +02:00
namespace Content.Shared.Weapons.Melee
{
/// <summary>
/// Raised directed on the used entity when a target entity is click attacked by a user.
/// </summary>
public sealed class ClickAttackEvent : HandledEntityEventArgs
{
/// <summary>
/// Entity used to attack, for broadcast purposes.
/// </summary>
2021-12-04 12:59:44 +01:00
public EntityUid Used { get; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
2021-12-04 12:59:44 +01:00
public EntityUid User { get; }
/// <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.
/// </summary>
public EntityUid? Target { get; }
public ClickAttackEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation, EntityUid? target = null)
{
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>
public sealed class WideAttackEvent : HandledEntityEventArgs
{
/// <summary>
/// Entity used to attack, for broadcast purposes.
/// </summary>
2021-12-04 12:59:44 +01:00
public EntityUid Used { get; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
2021-12-04 12:59:44 +01:00
public EntityUid User { get; }
/// <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)
{
Used = used;
User = user;
ClickLocation = clickLocation;
}
}
/// <summary>
/// Event raised on entities that have been attacked.
/// </summary>
public sealed class AttackedEvent : EntityEventArgs
{
/// <summary>
/// Entity used to attack, for broadcast purposes.
/// </summary>
2021-12-04 12:59:44 +01:00
public EntityUid Used { get; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
2021-12-04 12:59:44 +01:00
public EntityUid User { get; }
/// <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)
{
Used = used;
User = user;
ClickLocation = clickLocation;
}
}
}