Lavaland chasms (#19154)

This commit is contained in:
Kara
2023-08-14 19:29:24 -07:00
committed by GitHub
parent 71f5e38faf
commit cfccb5959a
20 changed files with 331 additions and 5 deletions

View File

@@ -0,0 +1,37 @@
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Chasm;
/// <summary>
/// Added to entities which have started falling into a chasm.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class ChasmFallingComponent : Component
{
/// <summary>
/// Time it should take for the falling animation (scaling down) to complete.
/// </summary>
[DataField("animationTime")]
public TimeSpan AnimationTime = TimeSpan.FromSeconds(1.5f);
/// <summary>
/// Time it should take in seconds for the entity to actually delete
/// </summary>
[DataField("deletionTime")]
public TimeSpan DeletionTime = TimeSpan.FromSeconds(1.8f);
[DataField("nextDeletionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan NextDeletionTime = TimeSpan.Zero;
/// <summary>
/// Original scale of the object so it can be restored if the component is removed in the middle of the animation
/// </summary>
public Vector2 OriginalScale = Vector2.Zero;
/// <summary>
/// Scale that the animation should bring entities to.
/// </summary>
public Vector2 AnimationScale = new Vector2(0.01f, 0.01f);
}