RatKingRummageableComponent.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Content.Shared.Random;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. namespace Content.Shared.RatKing;
  6. /// <summary>
  7. /// This is used for entities that can be
  8. /// rummaged through by the rat king to get loot.
  9. /// </summary>
  10. [RegisterComponent, NetworkedComponent, Access(typeof(SharedRatKingSystem))]
  11. [AutoGenerateComponentState]
  12. public sealed partial class RatKingRummageableComponent : Component
  13. {
  14. /// <summary>
  15. /// Whether or not this entity has been rummaged through already.
  16. /// </summary>
  17. [DataField("looted"), ViewVariables(VVAccess.ReadWrite)]
  18. [AutoNetworkedField]
  19. public bool Looted;
  20. /// <summary>
  21. /// How long it takes to rummage through a rummageable container.
  22. /// </summary>
  23. [DataField("rummageDuration"), ViewVariables(VVAccess.ReadWrite)]
  24. [AutoNetworkedField]
  25. public float RummageDuration = 3f;
  26. /// <summary>
  27. /// A weighted random entity prototype containing the different loot that rummaging can provide.
  28. /// </summary>
  29. [DataField("rummageLoot", customTypeSerializer: typeof(PrototypeIdSerializer<WeightedRandomEntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
  30. [AutoNetworkedField]
  31. public string RummageLoot = "RatKingLoot";
  32. /// <summary>
  33. /// Sound played on rummage completion.
  34. /// </summary>
  35. [DataField("sound")]
  36. public SoundSpecifier? Sound = new SoundCollectionSpecifier("storageRustle");
  37. }