2024-03-05 03:13:50 +00:00
|
|
|
using Content.Shared.Chemistry.EntitySystems;
|
2023-03-24 05:00:38 +00:00
|
|
|
using Content.Shared.Chemistry.Reagent;
|
|
|
|
|
using Content.Shared.FixedPoint;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
|
|
2024-03-05 03:13:50 +00:00
|
|
|
namespace Content.Shared.Chemistry.Components;
|
2023-03-24 05:00:38 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 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.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent, Access(typeof(RehydratableSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class RehydratableComponent : Component
|
2020-09-26 14:28:55 +01:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2023-03-24 05:00:38 +00:00
|
|
|
/// The reagent that must be present to count as hydrated.
|
2020-09-26 14:28:55 +01:00
|
|
|
/// </summary>
|
2024-03-05 03:13:50 +00:00
|
|
|
[DataField("catalyst")]
|
|
|
|
|
public ProtoId<ReagentPrototype> CatalystPrototype = "Water";
|
2021-09-06 15:49:44 +02:00
|
|
|
|
2023-03-24 05:00:38 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// The minimum amount of catalyst that must be present to be hydrated.
|
|
|
|
|
/// </summary>
|
2024-03-05 03:13:50 +00:00
|
|
|
[DataField]
|
2023-03-24 05:00:38 +00:00
|
|
|
public FixedPoint2 CatalystMinimum = FixedPoint2.Zero;
|
2020-09-26 14:28:55 +01:00
|
|
|
|
2023-03-24 05:00:38 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// The entity to create when hydrated.
|
|
|
|
|
/// </summary>
|
2024-03-05 03:13:50 +00:00
|
|
|
[DataField(required: true)]
|
|
|
|
|
public List<EntProtoId> PossibleSpawns = new();
|
2020-09-26 14:28:55 +01:00
|
|
|
}
|
2023-03-24 05:00:38 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised on the rehydrated entity with target being the new entity it became.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ByRefEvent]
|
|
|
|
|
public readonly record struct GotRehydratedEvent(EntityUid Target);
|