Files
tbd-station-14/Content.Shared/Nutrition/Components/MessyDrinkerComponent.cs
2025-08-31 01:35:22 +02:00

40 lines
1.3 KiB
C#

using Content.Shared.FixedPoint;
using Content.Shared.Nutrition.Prototypes;
using Content.Shared.Tag;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Nutrition.Components;
/// <summary>
/// Entities with this component occasionally spill some of the solution they're ingesting.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class MessyDrinkerComponent : Component
{
[DataField, AutoNetworkedField]
public float SpillChance = 0.2f;
/// <summary>
/// The amount of solution that is spilled when <see cref="SpillChance"/> procs.
/// </summary>
[DataField, AutoNetworkedField]
public FixedPoint2 SpillAmount = 1.0;
/// <summary>
/// The types of food prototypes we can spill
/// </summary>
[DataField, AutoNetworkedField]
public List<ProtoId<EdiblePrototype>> SpillableTypes = new List<ProtoId<EdiblePrototype>> { "Drink" };
/// <summary>
/// Tag given to drinks that are immune to messy drinker.
/// For example, a spill-immune bottle.
/// </summary>
[DataField, AutoNetworkedField]
public ProtoId<TagPrototype>? SpillImmuneTag = "MessyDrinkerImmune";
[DataField, AutoNetworkedField]
public LocId? SpillMessagePopup;
}