Add spear embedding (#18578)

* Add spear embedding

* fuck this copy-paste

* Juicier

* the river
This commit is contained in:
metalgearsloth
2023-08-04 18:56:39 +10:00
committed by GitHub
parent dda3848a98
commit 321f337572
10 changed files with 159 additions and 26 deletions

View File

@@ -1,12 +1,36 @@
using System.Numerics;
using Robust.Shared.GameStates;
namespace Content.Shared.Weapons.Ranged.Components;
namespace Content.Shared.Projectiles;
/// <summary>
/// Embeds this entity inside of the hit target.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class EmbeddableProjectileComponent : Component
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmbeddableProjectileComponent : Component
{
/// <summary>
/// Minimum speed of the projectile to embed.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("minimumSpeed"), AutoNetworkedField]
public float MinimumSpeed = 5f;
/// <summary>
/// Delete the entity on embedded removal?
/// Does nothing if there's no RemovalTime.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("deleteOnRemove"), AutoNetworkedField]
public bool DeleteOnRemove;
/// <summary>
/// How long it takes to remove the embedded object.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("removalTime"), AutoNetworkedField]
public float? RemovalTime = 3f;
/// <summary>
/// How far into the entity should we offset (0 is wherever we collided).
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("offset"), AutoNetworkedField]
public Vector2 Offset = Vector2.Zero;
}