using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Chemistry.Components;
///
/// Basically, monkey cubes.
/// But specifically, this component deletes the entity and spawns in a new entity when the entity is exposed to a certain amount of a given reagent.
///
[RegisterComponent, Access(typeof(RehydratableSystem))]
public sealed partial class RehydratableComponent : Component
{
///
/// The reagent that must be present to count as hydrated.
///
[DataField("catalyst")]
public ProtoId CatalystPrototype = "Water";
///
/// The minimum amount of catalyst that must be present to be hydrated.
///
[DataField]
public FixedPoint2 CatalystMinimum = FixedPoint2.Zero;
///
/// The entity to create when hydrated.
///
[DataField(required: true)]
public List PossibleSpawns = new();
}
///
/// Raised on the rehydrated entity with target being the new entity it became.
///
[ByRefEvent]
public readonly record struct GotRehydratedEvent(EntityUid Target);