ProjectileGrenadeComponent.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Content.Server.Explosion.EntitySystems;
  2. using Robust.Shared.Containers;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Server.Explosion.Components;
  5. /// <summary>
  6. /// Grenades that, when triggered, explode into projectiles
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(ProjectileGrenadeSystem))]
  9. public sealed partial class ProjectileGrenadeComponent : Component
  10. {
  11. public Container Container = default!;
  12. /// <summary>
  13. /// The kind of projectile that the prototype is filled with.
  14. /// </summary>
  15. [DataField]
  16. public EntProtoId? FillPrototype;
  17. /// <summary>
  18. /// If we have a pre-fill how many more can we spawn.
  19. /// </summary>
  20. public int UnspawnedCount;
  21. /// <summary>
  22. /// Total amount of projectiles
  23. /// </summary>
  24. [DataField]
  25. public int Capacity = 3;
  26. /// <summary>
  27. /// Should the angle of the projectiles be uneven?
  28. /// </summary>
  29. [DataField]
  30. public bool RandomAngle = false;
  31. /// <summary>
  32. /// The minimum speed the projectiles may come out at
  33. /// </summary>
  34. [DataField]
  35. public float MinVelocity = 2f;
  36. /// <summary>
  37. /// The maximum speed the projectiles may come out at
  38. /// </summary>
  39. [DataField]
  40. public float MaxVelocity = 6f;
  41. }