using Content.Shared.Chemistry.Reagent; using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; namespace Content.Shared.Devour.Components; /// /// Allows an entity to eat whitelisted entities via an action. /// Eaten mobs will be stored inside a container and released when the devourer is gibbed. /// Eating something that fits their food preference will reward the devourer by being injected with a specific reagent. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [Access(typeof(DevourSystem))] public sealed partial class DevourerComponent : Component { /// /// Action prototype for devouring. /// [DataField] public EntProtoId DevourAction = "ActionDevour"; /// /// The spawned action entity for devouring. /// [DataField, AutoNetworkedField] public EntityUid? DevourActionEntity; /// /// The amount of time it takes to devour a mob. /// [DataField, AutoNetworkedField] public float DevourTime = 3f; /// /// The amount of time it takes to devour a structure. /// /// NOTE: original intended design was to increase this proportionally with damage thresholds, but those proved quite difficult to get consistently. right now it devours the structure at a fixed timer. /// /// [DataField, AutoNetworkedField] public float StructureDevourTime = 10f; /// /// The sound to play when finishing devouring something. /// [DataField, AutoNetworkedField] public SoundSpecifier? SoundDevour = new SoundPathSpecifier("/Audio/Effects/demon_consume.ogg") { Params = AudioParams.Default.WithVolume(-3f), }; /// /// The sound to play when starting to devour a structure. /// [DataField, AutoNetworkedField] public SoundSpecifier? SoundStructureDevour = new SoundPathSpecifier("/Audio/Machines/airlock_creaking.ogg") { Params = AudioParams.Default.WithVolume(-3f), }; /// /// The container to store the eaten entities in. /// [ViewVariables] public static string StomachContainerId = "stomach"; /// /// Where the entities go when it devours them, empties when it is butchered. /// [ViewVariables] public Container Stomach = default!; /// /// Determines what things the devourer can consume. /// [DataField, AutoNetworkedField] public EntityWhitelist? Whitelist = new() { Components = new[] { "MobState", } }; /// /// Determines what things end up in the dragon's stomach if they eat it. /// If it isn't in the whitelist, it's deleted. /// [DataField, AutoNetworkedField] public EntityWhitelist? StomachStorageWhitelist; /// /// Determine's the dragon's food preference. If the eaten thing matches, /// it is rewarded with the reward chemical. If null, all food is fine. /// [DataField, AutoNetworkedField] public EntityWhitelist? FoodPreferenceWhitelist; /// /// The chemical ID injected upon devouring. /// [DataField, AutoNetworkedField] public ProtoId Chemical = "Ichor"; /// /// The amount of solution injected per devour. /// [DataField, AutoNetworkedField] public float HealRate = 15f; }