2022-06-27 20:14:51 -04:00
|
|
|
using Content.Shared.Inventory;
|
2023-02-14 00:29:34 +11:00
|
|
|
using Robust.Shared.GameStates;
|
2020-08-15 20:33:42 +02:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Strip.Components
|
2020-08-15 20:33:42 +02:00
|
|
|
{
|
2023-02-14 00:29:34 +11:00
|
|
|
[RegisterComponent, NetworkedComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class StrippableComponent : Component
|
2020-08-15 20:33:42 +02:00
|
|
|
{
|
2023-02-14 00:29:34 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// The strip delay for hands.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("handDelay")]
|
|
|
|
|
public float HandStripDelay = 4f;
|
2022-05-13 14:59:57 +10:00
|
|
|
}
|
2020-10-14 15:24:07 +02:00
|
|
|
|
2022-05-13 14:59:57 +10:00
|
|
|
[NetSerializable, Serializable]
|
|
|
|
|
public enum StrippingUiKey : byte
|
|
|
|
|
{
|
|
|
|
|
Key,
|
2020-08-15 20:33:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NetSerializable, Serializable]
|
2022-10-16 06:00:04 +13:00
|
|
|
public sealed class StrippingSlotButtonPressed : BoundUserInterfaceMessage
|
2020-08-15 20:33:42 +02:00
|
|
|
{
|
2022-10-16 06:00:04 +13:00
|
|
|
public readonly string Slot;
|
2020-08-15 20:33:42 +02:00
|
|
|
|
2022-10-16 06:00:04 +13:00
|
|
|
public readonly bool IsHand;
|
2020-08-25 08:54:23 -04:00
|
|
|
|
2022-10-16 06:00:04 +13:00
|
|
|
public StrippingSlotButtonPressed(string slot, bool isHand)
|
2020-08-25 08:54:23 -04:00
|
|
|
{
|
2022-10-16 06:00:04 +13:00
|
|
|
Slot = slot;
|
|
|
|
|
IsHand = isHand;
|
2020-08-25 08:54:23 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-24 10:50:31 -04:00
|
|
|
[NetSerializable, Serializable]
|
|
|
|
|
public sealed class StrippingEnsnareButtonPressed : BoundUserInterfaceMessage
|
|
|
|
|
{
|
2022-10-16 06:00:04 +13:00
|
|
|
public StrippingEnsnareButtonPressed()
|
2020-08-15 20:33:42 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-27 20:14:51 -04:00
|
|
|
|
2022-10-16 18:26:28 +13:00
|
|
|
public abstract class BaseBeforeStripEvent : EntityEventArgs, IInventoryRelayEvent
|
2022-06-27 20:14:51 -04:00
|
|
|
{
|
|
|
|
|
public readonly float InitialTime;
|
2022-10-16 18:26:28 +13:00
|
|
|
public float Time => MathF.Max(InitialTime * Multiplier + Additive, 0f);
|
2022-06-27 20:14:51 -04:00
|
|
|
public float Additive = 0;
|
2022-10-16 18:26:28 +13:00
|
|
|
public float Multiplier = 1f;
|
2022-06-27 20:14:51 -04:00
|
|
|
public bool Stealth;
|
|
|
|
|
|
|
|
|
|
public SlotFlags TargetSlots { get; } = SlotFlags.GLOVES;
|
|
|
|
|
|
2022-10-16 18:26:28 +13:00
|
|
|
public BaseBeforeStripEvent(float initialTime, bool stealth = false)
|
2022-06-27 20:14:51 -04:00
|
|
|
{
|
2022-10-16 18:26:28 +13:00
|
|
|
InitialTime = initialTime;
|
|
|
|
|
Stealth = stealth;
|
2022-06-27 20:14:51 -04:00
|
|
|
}
|
|
|
|
|
}
|
2022-10-16 18:26:28 +13:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to modify strip times. Raised directed at the user.
|
|
|
|
|
/// </summary>
|
2023-03-06 06:12:08 +13:00
|
|
|
/// <remarks>
|
|
|
|
|
/// This is also used by some stripping related interactions, i.e., interactions with items that are currently equipped by another player.
|
|
|
|
|
/// </remarks>
|
2022-10-16 18:26:28 +13:00
|
|
|
public sealed class BeforeStripEvent : BaseBeforeStripEvent
|
|
|
|
|
{
|
|
|
|
|
public BeforeStripEvent(float initialTime, bool stealth = false) : base(initialTime, stealth) { }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to modify strip times. Raised directed at the target.
|
|
|
|
|
/// </summary>
|
2023-03-06 06:12:08 +13:00
|
|
|
/// <remarks>
|
|
|
|
|
/// This is also used by some stripping related interactions, i.e., interactions with items that are currently equipped by another player.
|
|
|
|
|
/// </remarks>
|
2022-10-16 18:26:28 +13:00
|
|
|
public sealed class BeforeGettingStrippedEvent : BaseBeforeStripEvent
|
|
|
|
|
{
|
|
|
|
|
public BeforeGettingStrippedEvent(float initialTime, bool stealth = false) : base(initialTime, stealth) { }
|
|
|
|
|
}
|
2020-08-15 20:33:42 +02:00
|
|
|
}
|