* Fix robusted dionas not being recoverable * Implement a polymorph cooldown field, used for TreeMorph Allows the polymorphed Diona some time to work off robust harvest without immediately polymorphing again. * Minor adjustment to polymorph cooldown timing * Apply suggestions from code review Co-authored-by: Kara <lunarautomaton6@gmail.com> * fix: trigger polymorph revert on destruction As suggested by mirrorcult, DamageThresholdReached is not the ideal candidate for reverting a polymorph on destruction, as there exists a DestructionEventArgs to listen for instead. --------- Co-authored-by: Kara <lunarautomaton6@gmail.com>
28 lines
998 B
C#
28 lines
998 B
C#
using Content.Shared.Polymorph;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
|
|
|
namespace Content.Server.Polymorph.Components
|
|
{
|
|
[RegisterComponent]
|
|
public sealed partial 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, EntityUid>? PolymorphActions = null;
|
|
|
|
/// <summary>
|
|
/// Timestamp for when the most recent polymorph ended.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
public TimeSpan? LastPolymorphEnd = null;
|
|
|
|
/// <summary>
|
|
/// The polymorphs that the entity starts out being able to do.
|
|
/// </summary>
|
|
[DataField("innatePolymorphs", customTypeSerializer : typeof(PrototypeIdListSerializer<PolymorphPrototype>))]
|
|
public List<string>? InnatePolymorphs;
|
|
}
|
|
}
|