Files
Delta-v/Content.Shared/RatKing/Components/RummageableComponent.cs
T
c2589751b3 Rat King Refactor Part 0: Separate Rummaging from RatKingComponent. (#40530)
* separate rummager into its own component/system

* thing

* address review and entitytables

* reviews

* review

* warnings

* Update Content.Shared/RatKing/Systems/RummagerSystem.cs

---------

Co-authored-by: Jessica M <jessica@maybe.sh>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-12-29 11:39:12 -06:00

54 lines
1.6 KiB
C#

using Content.Shared.EntityTable.EntitySelectors;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.RatKing.Components;
/// <summary>
/// This is used for entities that can be
/// rummaged through by the rat king to get loot.
/// </summary>
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class RummageableComponent : Component
{
/// <summary>
/// Whether or not this entity has been rummaged through already.
/// </summary>
[DataField("looted"), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public bool Looted;
/// <summary>
/// DeltaV: Last time the object was looted, used to check if cooldown has expired
/// </summary>
[ViewVariables]
public TimeSpan? LastLooted;
/// <summary>
/// DeltaV: Minimum time between rummage attempts
/// </summary>
[DataField("rummageCooldown"), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public TimeSpan RummageCooldown = TimeSpan.FromMinutes(5);
/// <summary>
/// How long it takes to rummage through a rummageable container.
/// </summary>
[DataField("rummageDuration"), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public float RummageDuration = 3f;
/// <summary>
/// The entity table to select loot from.
/// </summary>
[DataField(required: true)]
public EntityTableSelector Table = default!;
/// <summary>
/// Sound played on rummage completion.
/// </summary>
[DataField("sound")]
public SoundSpecifier? Sound = new SoundCollectionSpecifier("storageRustle");
}