2023-05-14 13:15:18 +10:00
|
|
|
using Content.Shared.Damage;
|
2022-09-29 15:51:59 +10:00
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Weapons.Melee.Events
|
|
|
|
|
{
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public abstract class AttackEvent : EntityEventArgs
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Coordinates being attacked.
|
|
|
|
|
/// </summary>
|
2023-09-11 09:42:41 +10:00
|
|
|
public readonly NetCoordinates Coordinates;
|
2022-09-29 15:51:59 +10:00
|
|
|
|
2023-09-11 09:42:41 +10:00
|
|
|
protected AttackEvent(NetCoordinates coordinates)
|
2022-09-29 15:51:59 +10:00
|
|
|
{
|
|
|
|
|
Coordinates = coordinates;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event raised on entities that have been attacked.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class AttackedEvent : EntityEventArgs
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity used to attack, for broadcast purposes.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EntityUid Used { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that triggered the attack.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EntityUid User { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The original location that was clicked by the user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EntityCoordinates ClickLocation { get; }
|
|
|
|
|
|
2023-05-14 13:15:18 +10:00
|
|
|
public DamageSpecifier BonusDamage = new();
|
|
|
|
|
|
2022-09-29 15:51:59 +10:00
|
|
|
public AttackedEvent(EntityUid used, EntityUid user, EntityCoordinates clickLocation)
|
|
|
|
|
{
|
|
|
|
|
Used = used;
|
|
|
|
|
User = user;
|
|
|
|
|
ClickLocation = clickLocation;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|