Polymorphs and Transformation (#8185)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.Polymorph;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Server.Polymorph.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class PolymorphableComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of all the polymorphs that the entity has.
|
||||
/// Used to manage them and remove them if needed.
|
||||
/// </summary>
|
||||
public Dictionary<string, InstantAction>? PolymorphActions = null;
|
||||
|
||||
/// <summary>
|
||||
/// The polymorphs that the entity starts out being able to do.
|
||||
/// </summary>
|
||||
[DataField("innatePolymorphs", customTypeSerializer : typeof(PrototypeIdListSerializer<PolymorphPrototype>))]
|
||||
public List<string>? InnatePolymorphs = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Content.Shared.Polymorph;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Polymorph.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class PolymorphedEntityComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The polymorph prototype, used to track various information
|
||||
/// about the polymorph
|
||||
/// </summary>
|
||||
public PolymorphPrototype Prototype = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The original entity that the player will revert back into
|
||||
/// </summary>
|
||||
[DataField("parent", required: true)]
|
||||
public EntityUid Parent = new();
|
||||
|
||||
/// <summary>
|
||||
/// The amount of time that has passed since the entity was created
|
||||
/// used for tracking the duration
|
||||
/// </summary>
|
||||
[DataField("time")]
|
||||
public float Time = 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user