EmbeddableProjectileComponent.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Numerics;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.GameStates;
  4. namespace Content.Shared.Projectiles;
  5. /// <summary>
  6. /// Embeds this entity inside of the hit target.
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  9. public sealed partial class EmbeddableProjectileComponent : Component
  10. {
  11. /// <summary>
  12. /// Minimum speed of the projectile to embed.
  13. /// </summary>
  14. [DataField, AutoNetworkedField]
  15. public float MinimumSpeed = 5f;
  16. /// <summary>
  17. /// Delete the entity on embedded removal?
  18. /// Does nothing if there's no RemovalTime.
  19. /// </summary>
  20. [DataField, AutoNetworkedField]
  21. public bool DeleteOnRemove;
  22. /// <summary>
  23. /// How long it takes to remove the embedded object.
  24. /// </summary>
  25. [DataField, AutoNetworkedField]
  26. public float? RemovalTime = 3f;
  27. /// <summary>
  28. /// Whether this entity will embed when thrown, or only when shot as a projectile.
  29. /// </summary>
  30. [DataField, AutoNetworkedField]
  31. public bool EmbedOnThrow = true;
  32. /// <summary>
  33. /// How far into the entity should we offset (0 is wherever we collided).
  34. /// </summary>
  35. [DataField, AutoNetworkedField]
  36. public Vector2 Offset = Vector2.Zero;
  37. /// <summary>
  38. /// Sound to play after embedding into a hit target.
  39. /// </summary>
  40. [DataField, AutoNetworkedField]
  41. public SoundSpecifier? Sound;
  42. /// <summary>
  43. /// Uid of the entity the projectile is embed into.
  44. /// </summary>
  45. [DataField, AutoNetworkedField]
  46. public EntityUid? EmbeddedIntoUid;
  47. }